From f54b92be16bfd76ebeae7262f22331a2a98ec6e3 Mon Sep 17 00:00:00 2001 From: Electroblob <35599699+Electroblob77@users.noreply.github.com> Date: Thu, 22 Feb 2018 13:32:09 +0000 Subject: [PATCH] Replace hasKey with hasUniqueId where appropriate, should fix some weirdness with a few spells --- src/main/java/electroblob/wizardry/spell/Intimidate.java | 4 ++-- src/main/java/electroblob/wizardry/spell/LightningBolt.java | 2 +- src/main/java/electroblob/wizardry/spell/MindControl.java | 2 +- .../java/electroblob/wizardry/util/WizardryUtilities.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/electroblob/wizardry/spell/Intimidate.java b/src/main/java/electroblob/wizardry/spell/Intimidate.java index 1d062b3a..a733f93f 100644 --- a/src/main/java/electroblob/wizardry/spell/Intimidate.java +++ b/src/main/java/electroblob/wizardry/spell/Intimidate.java @@ -121,12 +121,12 @@ public class Intimidate extends Spell { NBTTagCompound entityNBT = event.getEntityLiving().getEntityData(); EntityCreature creature = (EntityCreature)event.getEntityLiving(); - if(entityNBT != null && entityNBT.hasKey(NBT_KEY)){ + if(entityNBT != null && entityNBT.hasUniqueId(NBT_KEY)){ Entity caster = WizardryUtilities.getEntityByUUID(creature.world, entityNBT.getUniqueId(NBT_KEY)); if(caster instanceof EntityLivingBase){ - Intimidate.runAway(creature, (EntityLivingBase)caster); + runAway(creature, (EntityLivingBase)caster); } } } diff --git a/src/main/java/electroblob/wizardry/spell/LightningBolt.java b/src/main/java/electroblob/wizardry/spell/LightningBolt.java index 9dcc53a9..06281d3b 100644 --- a/src/main/java/electroblob/wizardry/spell/LightningBolt.java +++ b/src/main/java/electroblob/wizardry/spell/LightningBolt.java @@ -103,7 +103,7 @@ public class LightningBolt extends Spell { @SubscribeEvent public static void onEntityStruckByLightningEvent(EntityStruckByLightningEvent event){ - if(event.getLightning().getEntityData() != null && event.getLightning().getEntityData().hasKey(NBT_KEY)){ + if(event.getLightning().getEntityData() != null && event.getLightning().getEntityData().hasUniqueId(NBT_KEY)){ EntityPlayer player = (EntityPlayer)WizardryUtilities.getEntityByUUID(event.getLightning().world, event.getLightning().getEntityData().getUniqueId("summoningPlayer")); diff --git a/src/main/java/electroblob/wizardry/spell/MindControl.java b/src/main/java/electroblob/wizardry/spell/MindControl.java index cc6ff184..52180686 100644 --- a/src/main/java/electroblob/wizardry/spell/MindControl.java +++ b/src/main/java/electroblob/wizardry/spell/MindControl.java @@ -206,7 +206,7 @@ public class MindControl extends Spell { NBTTagCompound entityNBT = event.getEntityLiving().getEntityData(); - if(entityNBT != null && entityNBT.hasKey(MindControl.NBT_KEY + "Most")){ + if(entityNBT != null && entityNBT.hasUniqueId(MindControl.NBT_KEY)){ Entity caster = WizardryUtilities.getEntityByUUID(event.getEntity().world, entityNBT.getUniqueId(MindControl.NBT_KEY)); diff --git a/src/main/java/electroblob/wizardry/util/WizardryUtilities.java b/src/main/java/electroblob/wizardry/util/WizardryUtilities.java index 385213d4..b2c79d6b 100644 --- a/src/main/java/electroblob/wizardry/util/WizardryUtilities.java +++ b/src/main/java/electroblob/wizardry/util/WizardryUtilities.java @@ -948,7 +948,7 @@ public final class WizardryUtilities { NBTTagCompound entityNBT = target.getEntityData(); - if(entityNBT != null && entityNBT.hasKey(MindControl.NBT_KEY)){ + if(entityNBT != null && entityNBT.hasUniqueId(MindControl.NBT_KEY)){ if(attacker == WizardryUtilities.getEntityByUUID(target.world, entityNBT.getUniqueId(MindControl.NBT_KEY))){ return false;