Add fixes from 52d12c0, a4695bc and f4d7ba6 to 1.11.2 branch

This commit is contained in:
Electroblob
2018-02-22 14:50:20 +00:00
parent f54b92be16
commit 3632511983
8 changed files with 17 additions and 15 deletions
@@ -143,6 +143,8 @@ public class Wizardry {
// Moved to preInit, because apparently it has to be here now.
proxy.registerRenderers();
// It seems this also has to be here
proxy.registerKeyBindings();
}
@@ -151,8 +153,6 @@ public class Wizardry {
settings.initConfigExtras();
proxy.registerKeyBindings();
// Event Handlers
GameRegistry.registerWorldGenerator(generator, 0);
MinecraftForge.EVENT_BUS.register(new WizardryKeyHandler());
@@ -155,8 +155,8 @@ public class ClientProxy extends CommonProxy {
public static MixedFontRenderer mixedFontRenderer;
// Key Bindings
public static final KeyBinding NEXT_SPELL = new KeyBinding("key.wizardry:next_spell", Keyboard.KEY_N, "key.categories.wizardry");
public static final KeyBinding PREVIOUS_SPELL = new KeyBinding("key.wizardry:previous_spell", Keyboard.KEY_B, "key.categories.wizardry");
public static final KeyBinding NEXT_SPELL = new KeyBinding("key.wizardry.next_spell", Keyboard.KEY_N, "key.categories.wizardry");
public static final KeyBinding PREVIOUS_SPELL = new KeyBinding("key.wizardry.previous_spell", Keyboard.KEY_B, "key.categories.wizardry");
// Armour Model
public static final ModelBiped WIZARD_ARMOUR_MODEL = new ModelWizardArmour(0.75f);
@@ -200,6 +200,8 @@ public class MindControl extends Spell {
@SubscribeEvent
public static void onLivingSetAttackTargetEvent(LivingSetAttackTargetEvent event){
if(event.getTarget() == null) return; // Prevents infinite loops with mind trick
if(event.getEntityLiving().isPotionActive(WizardryPotions.mind_control)
&& MindControl.canControl(event.getEntityLiving())){
@@ -212,7 +214,7 @@ public class MindControl extends Spell {
entityNBT.getUniqueId(MindControl.NBT_KEY));
// If the target that the event tried to set is already a valid mind control target, nothing happens.
if(event.getTarget() != null && WizardryUtilities.isValidTarget(caster, event.getTarget())) return;
if(WizardryUtilities.isValidTarget(caster, event.getTarget())) return;
if(caster instanceof EntityLivingBase){
@@ -224,8 +226,7 @@ public class MindControl extends Spell {
}
}
// If the caster couldn't be found or no valid target was found, this just acts like mind trick.
// If the target is null already, no need to set it to null, or infinite loops will occur.
if(event.getTarget() != null) ((EntityLiving)event.getEntityLiving()).setAttackTarget(null);
((EntityLiving)event.getEntityLiving()).setAttackTarget(null);
}
}
@@ -1079,6 +1079,7 @@ public final class WizardryUtilities {
*/
public static Item getWand(Tier tier, Element element){
if(tier == null) throw new NullPointerException("The given tier cannot be null.");
if(element == null) element = Element.MAGIC;
return WizardryItems.WAND_MAP.get(ImmutablePair.of(tier, element));
}
}