diff --git a/src/main/java/net/citizensnpcs/npc/entity/BatController.java b/src/main/java/net/citizensnpcs/npc/entity/BatController.java index 2fbc94096..06ccec716 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/BatController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/BatController.java @@ -132,6 +132,11 @@ public class BatController extends MobEntityController { } } + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } + public void setFlying(boolean flying) { a(flying); } diff --git a/src/main/java/net/citizensnpcs/npc/entity/BlazeController.java b/src/main/java/net/citizensnpcs/npc/entity/BlazeController.java index 16f63c6ed..188b7a4a3 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/BlazeController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/BlazeController.java @@ -122,5 +122,10 @@ public class BlazeController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } } \ No newline at end of file diff --git a/src/main/java/net/citizensnpcs/npc/entity/CaveSpiderController.java b/src/main/java/net/citizensnpcs/npc/entity/CaveSpiderController.java index 7fc169226..81d852760 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CaveSpiderController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CaveSpiderController.java @@ -165,5 +165,10 @@ public class CaveSpiderController extends MobEntityController { return false; } } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } } \ No newline at end of file diff --git a/src/main/java/net/citizensnpcs/npc/entity/ChickenController.java b/src/main/java/net/citizensnpcs/npc/entity/ChickenController.java index 75d4a48f5..3ad77dc2a 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/ChickenController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/ChickenController.java @@ -150,5 +150,10 @@ public class ChickenController extends MobEntityController { return false; } } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } } \ No newline at end of file diff --git a/src/main/java/net/citizensnpcs/npc/entity/CowController.java b/src/main/java/net/citizensnpcs/npc/entity/CowController.java index 9d78f7e33..ddf7e7594 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CowController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CowController.java @@ -153,5 +153,10 @@ public class CowController extends MobEntityController { return false; } } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } } \ No newline at end of file diff --git a/src/main/java/net/citizensnpcs/npc/entity/CreeperController.java b/src/main/java/net/citizensnpcs/npc/entity/CreeperController.java index aa9a0fa57..3c65cd8f7 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/CreeperController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/CreeperController.java @@ -108,15 +108,6 @@ public class CreeperController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -160,6 +151,20 @@ public class CreeperController extends MobEntityController { return npc; } + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } + public void setAllowPowered(boolean allowPowered) { this.allowPowered = allowPowered; } diff --git a/src/main/java/net/citizensnpcs/npc/entity/EnderDragonController.java b/src/main/java/net/citizensnpcs/npc/entity/EnderDragonController.java index 3accbd4b7..cdd4ad3aa 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/EnderDragonController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/EnderDragonController.java @@ -143,5 +143,10 @@ public class EnderDragonController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } } \ No newline at end of file diff --git a/src/main/java/net/citizensnpcs/npc/entity/EndermanController.java b/src/main/java/net/citizensnpcs/npc/entity/EndermanController.java index cce267f12..5f9d86ec3 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/EndermanController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/EndermanController.java @@ -172,6 +172,11 @@ public class EndermanController extends MobEntityController { } } + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } + @Override protected boolean k(double d1, double d2, double d3) { if (npc == null) { diff --git a/src/main/java/net/citizensnpcs/npc/entity/GhastController.java b/src/main/java/net/citizensnpcs/npc/entity/GhastController.java index 1b6638616..a97c7ae8c 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/GhastController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/GhastController.java @@ -105,6 +105,11 @@ public class GhastController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class GhastNPC extends CraftGhast implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/GiantController.java b/src/main/java/net/citizensnpcs/npc/entity/GiantController.java index a08311a75..f26df9615 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/GiantController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/GiantController.java @@ -88,15 +88,6 @@ public class GiantController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -139,6 +130,20 @@ public class GiantController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class GiantNPC extends CraftGiant implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/HorseController.java b/src/main/java/net/citizensnpcs/npc/entity/HorseController.java index 0e781e87a..d0777165e 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/HorseController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/HorseController.java @@ -152,6 +152,11 @@ public class HorseController extends MobEntityController { } } + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } + private void updateAIWithMovement() { NMS.updateAI(this); // taken from EntityLiving update method diff --git a/src/main/java/net/citizensnpcs/npc/entity/IronGolemController.java b/src/main/java/net/citizensnpcs/npc/entity/IronGolemController.java index a97f67afc..643c1692d 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/IronGolemController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/IronGolemController.java @@ -85,15 +85,6 @@ public class IronGolemController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -136,6 +127,20 @@ public class IronGolemController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class IronGolemNPC extends CraftIronGolem implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/MagmaCubeController.java b/src/main/java/net/citizensnpcs/npc/entity/MagmaCubeController.java index 2601369f2..fc27ec280 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/MagmaCubeController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/MagmaCubeController.java @@ -96,15 +96,6 @@ public class MagmaCubeController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -147,6 +138,20 @@ public class MagmaCubeController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class MagmaCubeNPC extends CraftMagmaCube implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/MushroomCowController.java b/src/main/java/net/citizensnpcs/npc/entity/MushroomCowController.java index 0e4ba57ed..eeef9418a 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/MushroomCowController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/MushroomCowController.java @@ -86,15 +86,6 @@ public class MushroomCowController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -137,6 +128,20 @@ public class MushroomCowController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class MushroomCowNPC extends CraftMushroomCow implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/OcelotController.java b/src/main/java/net/citizensnpcs/npc/entity/OcelotController.java index 5f63d0f6b..8c63a9307 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/OcelotController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/OcelotController.java @@ -86,15 +86,6 @@ public class OcelotController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -137,6 +128,20 @@ public class OcelotController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class OcelotNPC extends CraftOcelot implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/PigController.java b/src/main/java/net/citizensnpcs/npc/entity/PigController.java index 534bb14c2..50dd3dcaf 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/PigController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/PigController.java @@ -92,15 +92,6 @@ public class PigController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -143,6 +134,20 @@ public class PigController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class PigNPC extends CraftPig implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/PigZombieController.java b/src/main/java/net/citizensnpcs/npc/entity/PigZombieController.java index e1313c295..fd36c929b 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/PigZombieController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/PigZombieController.java @@ -96,15 +96,6 @@ public class PigZombieController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -147,6 +138,20 @@ public class PigZombieController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class PigZombieNPC extends CraftPigZombie implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/SheepController.java b/src/main/java/net/citizensnpcs/npc/entity/SheepController.java index c7789231d..79e3d9c5a 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SheepController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SheepController.java @@ -86,15 +86,6 @@ public class SheepController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -137,6 +128,20 @@ public class SheepController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class SheepNPC extends CraftSheep implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/SilverfishController.java b/src/main/java/net/citizensnpcs/npc/entity/SilverfishController.java index c3cfe8d51..7764d3adc 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SilverfishController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SilverfishController.java @@ -95,15 +95,6 @@ public class SilverfishController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -146,6 +137,20 @@ public class SilverfishController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class SilverfishNPC extends CraftSilverfish implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/SkeletonController.java b/src/main/java/net/citizensnpcs/npc/entity/SkeletonController.java index 404a0b37f..ef2903092 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SkeletonController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SkeletonController.java @@ -85,15 +85,6 @@ public class SkeletonController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -136,6 +127,20 @@ public class SkeletonController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class SkeletonNPC extends CraftSkeleton implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/SlimeController.java b/src/main/java/net/citizensnpcs/npc/entity/SlimeController.java index 136aa30a1..c04fcadb5 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SlimeController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SlimeController.java @@ -97,15 +97,6 @@ public class SlimeController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -148,6 +139,20 @@ public class SlimeController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class SlimeNPC extends CraftSlime implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/SnowmanController.java b/src/main/java/net/citizensnpcs/npc/entity/SnowmanController.java index c34a38cea..6d0a373c8 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SnowmanController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SnowmanController.java @@ -85,15 +85,6 @@ public class SnowmanController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -136,6 +127,20 @@ public class SnowmanController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class SnowmanNPC extends CraftSnowman implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/SpiderController.java b/src/main/java/net/citizensnpcs/npc/entity/SpiderController.java index 541ec79ab..be63625d5 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SpiderController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SpiderController.java @@ -95,15 +95,6 @@ public class SpiderController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -146,6 +137,20 @@ public class SpiderController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class SpiderNPC extends CraftSpider implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/SquidController.java b/src/main/java/net/citizensnpcs/npc/entity/SquidController.java index ba225f6df..262f47e80 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/SquidController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/SquidController.java @@ -86,15 +86,6 @@ public class SquidController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -137,6 +128,20 @@ public class SquidController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class SquidNPC extends CraftSquid implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/VillagerController.java b/src/main/java/net/citizensnpcs/npc/entity/VillagerController.java index 89a2246f0..5364e0a19 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/VillagerController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/VillagerController.java @@ -54,7 +54,7 @@ public class VillagerController extends MobEntityController { @Override public boolean a(EntityHuman entityhuman) { return npc == null || !blockTrades ? super.a(entityhuman) : false; // block - // trades + // trades } @Override @@ -80,8 +80,9 @@ public class VillagerController extends MobEntityController { @Override public void bn() { super.bn(); - if (npc != null) + if (npc != null) { npc.update(); + } } @Override @@ -89,16 +90,8 @@ public class VillagerController extends MobEntityController { // this method is called by both the entities involved - cancelling // it will not stop the NPC from moving. super.collide(entity); - if (npc != null) + if (npc != null) { Util.callCollisionEvent(npc, entity.getBukkitEntity()); - } - - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; } } @@ -145,10 +138,24 @@ public class VillagerController extends MobEntityController { return npc; } + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + public boolean isBlockingTrades() { return blockTrades; } + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } + public void setBlockTrades(boolean blocked) { this.blockTrades = blocked; } diff --git a/src/main/java/net/citizensnpcs/npc/entity/WitchController.java b/src/main/java/net/citizensnpcs/npc/entity/WitchController.java index cec2a651f..e61e3f5b6 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/WitchController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/WitchController.java @@ -85,15 +85,6 @@ public class WitchController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -136,6 +127,20 @@ public class WitchController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class WitchNPC extends CraftWitch implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/WitherController.java b/src/main/java/net/citizensnpcs/npc/entity/WitherController.java index 9d8a159d6..01f21cad3 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/WitherController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/WitherController.java @@ -116,6 +116,11 @@ public class WitherController extends MobEntityController { return npc; } + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } + private void updateAIWithMovement() { NMS.updateAI(this); // taken from EntityLiving update method diff --git a/src/main/java/net/citizensnpcs/npc/entity/WolfController.java b/src/main/java/net/citizensnpcs/npc/entity/WolfController.java index b4ac399ce..8aa971530 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/WolfController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/WolfController.java @@ -139,6 +139,11 @@ public class WolfController extends MobEntityController { return false; } } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class WolfNPC extends CraftWolf implements NPCHolder { diff --git a/src/main/java/net/citizensnpcs/npc/entity/ZombieController.java b/src/main/java/net/citizensnpcs/npc/entity/ZombieController.java index fd1cc801a..1c6a5acdf 100644 --- a/src/main/java/net/citizensnpcs/npc/entity/ZombieController.java +++ b/src/main/java/net/citizensnpcs/npc/entity/ZombieController.java @@ -86,15 +86,6 @@ public class ZombieController extends MobEntityController { Util.callCollisionEvent(npc, entity.getBukkitEntity()); } - @Override - public boolean h_() { - if (npc == null || !npc.isFlyable()) { - return super.h_(); - } else { - return false; - } - } - @Override public void e(float f, float f1) { if (npc == null || !npc.isFlyable()) { @@ -137,6 +128,20 @@ public class ZombieController extends MobEntityController { public NPC getNPC() { return npc; } + + @Override + public boolean h_() { + if (npc == null || !npc.isFlyable()) { + return super.h_(); + } else { + return false; + } + } + + @Override + protected boolean isTypeNotPersistent() { + return npc == null ? super.isTypeNotPersistent() : false; + } } public static class ZombieNPC extends CraftZombie implements NPCHolder {