diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/BatController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/BatController.java index 6a13dd261..8c7974dcd 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/BatController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/BatController.java @@ -130,8 +130,8 @@ public class BatController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new BatNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new BatNPC(this)); } return super.getBukkitEntity(); } @@ -176,4 +176,4 @@ public class BatController extends MobEntityController { setAsleep(flying); } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/BlazeController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/BlazeController.java index 4d1e8b0fc..38ddb00ad 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/BlazeController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/BlazeController.java @@ -121,8 +121,8 @@ public class BlazeController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new BlazeNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new BlazeNPC(this)); } return super.getBukkitEntity(); } @@ -167,4 +167,4 @@ public class BlazeController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CatController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CatController.java index 3bf068af6..1401238e2 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CatController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CatController.java @@ -158,8 +158,8 @@ public class CatController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new CatNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new CatNPC(this)); } return super.getBukkitEntity(); } @@ -214,4 +214,4 @@ public class CatController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CaveSpiderController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CaveSpiderController.java index 322233619..3f27d0750 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CaveSpiderController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CaveSpiderController.java @@ -145,8 +145,8 @@ public class CaveSpiderController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new CaveSpiderNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new CaveSpiderNPC(this)); } return super.getBukkitEntity(); } @@ -212,4 +212,4 @@ public class CaveSpiderController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ChickenController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ChickenController.java index c61de6008..9c990c9db 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ChickenController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ChickenController.java @@ -159,8 +159,8 @@ public class ChickenController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new ChickenNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new ChickenNPC(this)); } return super.getBukkitEntity(); } diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CodController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CodController.java index 1169303f1..0af469bd9 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CodController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CodController.java @@ -147,8 +147,9 @@ public class CodController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new CodNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new CodNPC(this)); + } return super.getBukkitEntity(); } @@ -205,4 +206,4 @@ public class CodController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CowController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CowController.java index d92ec0380..edbc28f4f 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CowController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CowController.java @@ -157,8 +157,8 @@ public class CowController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new CowNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new CowNPC(this)); } return super.getBukkitEntity(); } @@ -213,4 +213,4 @@ public class CowController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CreeperController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CreeperController.java index d3ca55a7c..8d53b30dc 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CreeperController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/CreeperController.java @@ -147,8 +147,8 @@ public class CreeperController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new CreeperNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new CreeperNPC(this)); } return super.getBukkitEntity(); } @@ -223,4 +223,4 @@ public class CreeperController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/DolphinController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/DolphinController.java index d65efdc93..7731134d5 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/DolphinController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/DolphinController.java @@ -146,8 +146,9 @@ public class DolphinController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new DolphinNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new DolphinNPC(this)); + } return super.getBukkitEntity(); } @@ -201,4 +202,4 @@ public class DolphinController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/DrownedController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/DrownedController.java index 9c2991a4b..91e81b4c9 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/DrownedController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/DrownedController.java @@ -145,8 +145,9 @@ public class DrownedController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new DrownedNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new DrownedNPC(this)); + } return super.getBukkitEntity(); } @@ -200,4 +201,4 @@ public class DrownedController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EnderDragonController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EnderDragonController.java index d2da294ef..caf795d99 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EnderDragonController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EnderDragonController.java @@ -119,8 +119,8 @@ public class EnderDragonController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new EnderDragonNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new EnderDragonNPC(this)); } return super.getBukkitEntity(); } diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EndermanController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EndermanController.java index 6a193f8cf..6a1e69ab4 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EndermanController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EndermanController.java @@ -152,8 +152,8 @@ public class EndermanController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new EndermanNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new EndermanNPC(this)); } return super.getBukkitEntity(); } @@ -217,4 +217,4 @@ public class EndermanController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EndermiteController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EndermiteController.java index ef1b23cea..749f3ac86 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EndermiteController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EndermiteController.java @@ -144,8 +144,8 @@ public class EndermiteController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new EndermiteNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new EndermiteNPC(this)); } return super.getBukkitEntity(); } @@ -208,4 +208,4 @@ public class EndermiteController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EntityHumanNPC.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EntityHumanNPC.java index 8c811b32c..680e6d167 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EntityHumanNPC.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EntityHumanNPC.java @@ -221,8 +221,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable @Override public CraftPlayer getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new PlayerNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new PlayerNPC(this)); } return super.getBukkitEntity(); } @@ -411,7 +411,7 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable if (updateCounter + 1 > Setting.PACKET_UPDATE_DELAY.asInt()) { updateEffects = true; } - Bukkit.getServer().getPluginManager().unsubscribeFromPermission("bukkit.broadcast.user", bukkitEntity); + Bukkit.getServer().getPluginManager().unsubscribeFromPermission("bukkit.broadcast.user", getBukkitEntity()); livingEntityBaseTick(); boolean navigating = npc.getNavigator().isNavigating(); diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EvokerController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EvokerController.java index c61e49828..d67ad002a 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EvokerController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/EvokerController.java @@ -132,8 +132,8 @@ public class EvokerController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new EvokerNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new EvokerNPC(this)); } return super.getBukkitEntity(); } @@ -202,4 +202,4 @@ public class EvokerController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/FoxController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/FoxController.java index f51fbb4c1..614a293dd 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/FoxController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/FoxController.java @@ -144,8 +144,8 @@ public class FoxController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new FoxNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new FoxNPC(this)); } return super.getBukkitEntity(); } diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GhastController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GhastController.java index 79fc58bfc..4ea5b4874 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GhastController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GhastController.java @@ -107,8 +107,8 @@ public class GhastController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new GhastNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new GhastNPC(this)); } return super.getBukkitEntity(); } @@ -173,4 +173,4 @@ public class GhastController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GiantController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GiantController.java index f4d7c17e7..d5cba1767 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GiantController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GiantController.java @@ -130,8 +130,8 @@ public class GiantController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new GiantNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new GiantNPC(this)); } return super.getBukkitEntity(); } @@ -209,4 +209,4 @@ public class GiantController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GuardianController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GuardianController.java index c0cb5041a..7351cd6a6 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GuardianController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GuardianController.java @@ -131,8 +131,8 @@ public class GuardianController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new GuardianNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new GuardianNPC(this)); } return super.getBukkitEntity(); } diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GuardianElderController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GuardianElderController.java index 29dac3ffe..4cbb4913f 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GuardianElderController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/GuardianElderController.java @@ -131,8 +131,8 @@ public class GuardianElderController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new GuardianElderNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new GuardianElderNPC(this)); } return super.getBukkitEntity(); } diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseController.java index 3158851af..98dd679fa 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseController.java @@ -155,8 +155,8 @@ public class HorseController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new HorseNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new HorseNPC(this)); } return super.getBukkitEntity(); } @@ -226,4 +226,4 @@ public class HorseController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseDonkeyController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseDonkeyController.java index e31f744be..065b7bd05 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseDonkeyController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseDonkeyController.java @@ -155,8 +155,8 @@ public class HorseDonkeyController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new HorseDonkeyNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new HorseDonkeyNPC(this)); } return super.getBukkitEntity(); } @@ -226,4 +226,4 @@ public class HorseDonkeyController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseMuleController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseMuleController.java index 756354a21..f4346c43e 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseMuleController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseMuleController.java @@ -155,8 +155,8 @@ public class HorseMuleController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new HorseMuleNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new HorseMuleNPC(this)); } return super.getBukkitEntity(); } @@ -226,4 +226,4 @@ public class HorseMuleController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseSkeletonController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseSkeletonController.java index 597a74d1b..c7e0e734f 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseSkeletonController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseSkeletonController.java @@ -156,8 +156,8 @@ public class HorseSkeletonController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new HorseSkeletonNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new HorseSkeletonNPC(this)); } return super.getBukkitEntity(); } @@ -227,4 +227,4 @@ public class HorseSkeletonController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseZombieController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseZombieController.java index 58fe415f6..42e2fb15c 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseZombieController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/HorseZombieController.java @@ -156,8 +156,8 @@ public class HorseZombieController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new HorseZombieNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new HorseZombieNPC(this)); } return super.getBukkitEntity(); } @@ -227,4 +227,4 @@ public class HorseZombieController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/IllusionerController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/IllusionerController.java index 5ec8f5c03..b4f731d0a 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/IllusionerController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/IllusionerController.java @@ -132,8 +132,9 @@ public class IllusionerController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new IllusionerNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new IllusionerNPC(this)); + } return super.getBukkitEntity(); } @@ -201,4 +202,4 @@ public class IllusionerController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/IronGolemController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/IronGolemController.java index 3929f0786..ec35f3200 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/IronGolemController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/IronGolemController.java @@ -130,8 +130,8 @@ public class IronGolemController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new IronGolemNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new IronGolemNPC(this)); } return super.getBukkitEntity(); } @@ -209,4 +209,4 @@ public class IronGolemController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/LlamaController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/LlamaController.java index ed56548cc..0752cb76a 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/LlamaController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/LlamaController.java @@ -155,8 +155,8 @@ public class LlamaController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new LlamaNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new LlamaNPC(this)); } return super.getBukkitEntity(); } @@ -227,4 +227,4 @@ public class LlamaController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/MagmaCubeController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/MagmaCubeController.java index 4198406d5..4bd725673 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/MagmaCubeController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/MagmaCubeController.java @@ -134,8 +134,8 @@ public class MagmaCubeController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new MagmaCubeNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new MagmaCubeNPC(this)); } return super.getBukkitEntity(); } @@ -220,4 +220,4 @@ public class MagmaCubeController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/MushroomCowController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/MushroomCowController.java index 7f25a09ca..63a1aa236 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/MushroomCowController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/MushroomCowController.java @@ -145,8 +145,8 @@ public class MushroomCowController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new MushroomCowNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new MushroomCowNPC(this)); } return super.getBukkitEntity(); } @@ -214,4 +214,4 @@ public class MushroomCowController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/OcelotController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/OcelotController.java index 7baa8dd80..d6f8f6c62 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/OcelotController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/OcelotController.java @@ -151,8 +151,8 @@ public class OcelotController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new OcelotNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new OcelotNPC(this)); } return super.getBukkitEntity(); } @@ -221,4 +221,4 @@ public class OcelotController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PandaController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PandaController.java index 86a7a30b4..0b3c7f5b9 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PandaController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PandaController.java @@ -144,8 +144,8 @@ public class PandaController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new PandaNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new PandaNPC(this)); } return super.getBukkitEntity(); } @@ -214,4 +214,4 @@ public class PandaController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ParrotController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ParrotController.java index b2487ced6..520ea5300 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ParrotController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ParrotController.java @@ -116,8 +116,8 @@ public class ParrotController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new ParrotNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new ParrotNPC(this)); } return super.getBukkitEntity(); } @@ -180,4 +180,4 @@ public class ParrotController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PhantomController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PhantomController.java index f133d6047..2f9ca9e40 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PhantomController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PhantomController.java @@ -144,8 +144,9 @@ public class PhantomController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new PhantomNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new PhantomNPC(this)); + } return super.getBukkitEntity(); } diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PigController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PigController.java index 7bd92781b..8952bc205 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PigController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PigController.java @@ -152,8 +152,8 @@ public class PigController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new PigNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new PigNPC(this)); } return super.getBukkitEntity(); } @@ -229,4 +229,4 @@ public class PigController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PigZombieController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PigZombieController.java index 36c658b95..c6c5e81a3 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PigZombieController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PigZombieController.java @@ -133,8 +133,8 @@ public class PigZombieController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new PigZombieNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new PigZombieNPC(this)); } return super.getBukkitEntity(); } @@ -203,4 +203,4 @@ public class PigZombieController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PillagerController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PillagerController.java index 4527f24d8..a3e643da4 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PillagerController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PillagerController.java @@ -158,8 +158,8 @@ public class PillagerController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new PillagerNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new PillagerNPC(this)); } return super.getBukkitEntity(); } @@ -214,4 +214,4 @@ public class PillagerController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PolarBearController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PolarBearController.java index b355ea13a..b4bdd879f 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PolarBearController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PolarBearController.java @@ -119,8 +119,8 @@ public class PolarBearController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new PolarBearNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new PolarBearNPC(this)); } return super.getBukkitEntity(); } @@ -181,4 +181,4 @@ public class PolarBearController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PufferFishController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PufferFishController.java index e35e99606..4855ca56f 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PufferFishController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/PufferFishController.java @@ -133,8 +133,9 @@ public class PufferFishController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new PufferFishNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new PufferFishNPC(this)); + } return super.getBukkitEntity(); } diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/RabbitController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/RabbitController.java index 0d727961d..8dbd567c3 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/RabbitController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/RabbitController.java @@ -147,8 +147,8 @@ public class RabbitController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new RabbitNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new RabbitNPC(this)); } return super.getBukkitEntity(); } diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/RavagerController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/RavagerController.java index 3144a55e6..6c91ec887 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/RavagerController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/RavagerController.java @@ -158,8 +158,8 @@ public class RavagerController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new RavagerNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new RavagerNPC(this)); } return super.getBukkitEntity(); } @@ -214,4 +214,4 @@ public class RavagerController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SalmonController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SalmonController.java index ed5212e4f..f407b6ebb 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SalmonController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SalmonController.java @@ -133,8 +133,9 @@ public class SalmonController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new SalmonNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new SalmonNPC(this)); + } return super.getBukkitEntity(); } @@ -205,4 +206,4 @@ public class SalmonController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SheepController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SheepController.java index d0acc75ed..4d409ebaa 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SheepController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SheepController.java @@ -144,8 +144,8 @@ public class SheepController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new SheepNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new SheepNPC(this)); } return super.getBukkitEntity(); } @@ -213,4 +213,4 @@ public class SheepController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ShulkerController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ShulkerController.java index b376ee2c9..f99ca76fa 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ShulkerController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ShulkerController.java @@ -131,8 +131,9 @@ public class ShulkerController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new ShulkerNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new ShulkerNPC(this)); + } return super.getBukkitEntity(); } diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SilverfishController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SilverfishController.java index 8615624f1..4e6f3728d 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SilverfishController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SilverfishController.java @@ -129,8 +129,9 @@ public class SilverfishController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new SilverfishNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new SilverfishNPC(this)); + } return super.getBukkitEntity(); } @@ -206,4 +207,4 @@ public class SilverfishController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SkeletonController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SkeletonController.java index 5bbf5fff1..2ba92e3ad 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SkeletonController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SkeletonController.java @@ -131,8 +131,9 @@ public class SkeletonController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new SkeletonNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new SkeletonNPC(this)); + } return super.getBukkitEntity(); } @@ -209,4 +210,4 @@ public class SkeletonController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SkeletonStrayController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SkeletonStrayController.java index 35646c2e9..666ff052a 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SkeletonStrayController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SkeletonStrayController.java @@ -131,8 +131,9 @@ public class SkeletonStrayController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new StrayNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new StrayNPC(this)); + } return super.getBukkitEntity(); } @@ -209,4 +210,4 @@ public class SkeletonStrayController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SkeletonWitherController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SkeletonWitherController.java index 7cc2ac45c..db2606b96 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SkeletonWitherController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SkeletonWitherController.java @@ -131,8 +131,9 @@ public class SkeletonWitherController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new SkeletonWitherNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new SkeletonWitherNPC(this)); + } return super.getBukkitEntity(); } @@ -209,4 +210,4 @@ public class SkeletonWitherController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SlimeController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SlimeController.java index adfc3fcee..124c2ca6c 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SlimeController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SlimeController.java @@ -135,8 +135,9 @@ public class SlimeController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new SlimeNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new SlimeNPC(this)); + } return super.getBukkitEntity(); } @@ -220,4 +221,4 @@ public class SlimeController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SnowmanController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SnowmanController.java index a1ac23ca6..02b9a0852 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SnowmanController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SnowmanController.java @@ -130,8 +130,9 @@ public class SnowmanController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new SnowmanNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new SnowmanNPC(this)); + } return super.getBukkitEntity(); } diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SpiderController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SpiderController.java index e6a108a89..df34b07ca 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SpiderController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SpiderController.java @@ -131,8 +131,9 @@ public class SpiderController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new SpiderNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new SpiderNPC(this)); + } return super.getBukkitEntity(); } @@ -209,4 +210,4 @@ public class SpiderController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SquidController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SquidController.java index 9c65f5684..b93d97db0 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SquidController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/SquidController.java @@ -131,8 +131,9 @@ public class SquidController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new SquidNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new SquidNPC(this)); + } return super.getBukkitEntity(); } @@ -201,4 +202,4 @@ public class SquidController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/TraderLlamaController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/TraderLlamaController.java index b46214b45..494188f75 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/TraderLlamaController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/TraderLlamaController.java @@ -158,8 +158,8 @@ public class TraderLlamaController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new TraderLlamaNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new TraderLlamaNPC(this)); } return super.getBukkitEntity(); } @@ -238,4 +238,4 @@ public class TraderLlamaController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/TropicalFishController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/TropicalFishController.java index 4d14ac5c8..b2ab8dbf7 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/TropicalFishController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/TropicalFishController.java @@ -133,8 +133,9 @@ public class TropicalFishController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new TropicalFishNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new TropicalFishNPC(this)); + } return super.getBukkitEntity(); } @@ -205,4 +206,4 @@ public class TropicalFishController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/TurtleController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/TurtleController.java index d9478a948..350b7aa85 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/TurtleController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/TurtleController.java @@ -135,8 +135,9 @@ public class TurtleController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new TurtleNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new TurtleNPC(this)); + } return super.getBukkitEntity(); } diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/VexController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/VexController.java index f2d611eb7..b866f3271 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/VexController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/VexController.java @@ -108,8 +108,9 @@ public class VexController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new VexNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new VexNPC(this)); + } return super.getBukkitEntity(); } @@ -169,4 +170,4 @@ public class VexController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/VillagerController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/VillagerController.java index 8a37b592f..0b3085af5 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/VillagerController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/VillagerController.java @@ -175,8 +175,9 @@ public class VillagerController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new VillagerNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new VillagerNPC(this)); + } return super.getBukkitEntity(); } @@ -267,4 +268,4 @@ public class VillagerController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/VindicatorController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/VindicatorController.java index d6ec231f6..8132b9720 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/VindicatorController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/VindicatorController.java @@ -145,8 +145,9 @@ public class VindicatorController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new VindicatorNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new VindicatorNPC(this)); + } return super.getBukkitEntity(); } @@ -214,4 +215,4 @@ public class VindicatorController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WanderingTraderController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WanderingTraderController.java index 71142e428..63f5864be 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WanderingTraderController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WanderingTraderController.java @@ -175,8 +175,9 @@ public class WanderingTraderController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new WanderingTraderNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new WanderingTraderNPC(this)); + } return super.getBukkitEntity(); } @@ -267,4 +268,4 @@ public class WanderingTraderController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WitchController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WitchController.java index c5ab9257b..6d196fe1b 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WitchController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WitchController.java @@ -131,8 +131,9 @@ public class WitchController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new WitchNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new WitchNPC(this)); + } return super.getBukkitEntity(); } diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WitherController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WitherController.java index 2c403b62c..43975d178 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WitherController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WitherController.java @@ -106,8 +106,9 @@ public class WitherController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new WitherNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new WitherNPC(this)); + } return super.getBukkitEntity(); } @@ -172,4 +173,4 @@ public class WitherController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WolfController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WolfController.java index 520fa7be8..2c4189dce 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WolfController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/WolfController.java @@ -147,8 +147,9 @@ public class WolfController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new WolfNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new WolfNPC(this)); + } return super.getBukkitEntity(); } @@ -226,4 +227,4 @@ public class WolfController extends MobEntityController { getHandle().setSitting(sitting); } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ZombieController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ZombieController.java index 05d5b9b85..8997b3939 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ZombieController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ZombieController.java @@ -131,8 +131,9 @@ public class ZombieController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new ZombieNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new ZombieNPC(this)); + } return super.getBukkitEntity(); } @@ -200,4 +201,4 @@ public class ZombieController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ZombieHuskController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ZombieHuskController.java index 7e3bd98f1..9c9945762 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ZombieHuskController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ZombieHuskController.java @@ -131,8 +131,9 @@ public class ZombieHuskController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new ZombieHuskNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new ZombieHuskNPC(this)); + } return super.getBukkitEntity(); } @@ -200,4 +201,4 @@ public class ZombieHuskController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ZombieVillagerController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ZombieVillagerController.java index b4ae048fb..57e18191c 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ZombieVillagerController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/ZombieVillagerController.java @@ -131,8 +131,9 @@ public class ZombieVillagerController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) - bukkitEntity = new ZombieVillagerNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new ZombieVillagerNPC(this)); + } return super.getBukkitEntity(); } @@ -200,4 +201,4 @@ public class ZombieVillagerController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/AreaEffectCloudController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/AreaEffectCloudController.java index 0f1b64aa0..155fc14c6 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/AreaEffectCloudController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/AreaEffectCloudController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftAreaEffectCloud; @@ -93,8 +94,8 @@ public class AreaEffectCloudController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new AreaEffectCloudNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new AreaEffectCloudNPC(this)); } return super.getBukkitEntity(); } @@ -113,4 +114,4 @@ public class AreaEffectCloudController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ArmorStandController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ArmorStandController.java index 78478af36..51367eb26 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ArmorStandController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ArmorStandController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftArmorStand; @@ -110,8 +111,8 @@ public class ArmorStandController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new ArmorStandNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new ArmorStandNPC(this)); } return super.getBukkitEntity(); } @@ -129,4 +130,4 @@ public class ArmorStandController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/BoatController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/BoatController.java index 002452552..cded3bc74 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/BoatController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/BoatController.java @@ -94,8 +94,8 @@ public class BoatController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new BoatNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new BoatNPC(this)); } return super.getBukkitEntity(); } @@ -123,4 +123,4 @@ public class BoatController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/DragonFireballController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/DragonFireballController.java index cc649ac62..f95ada412 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/DragonFireballController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/DragonFireballController.java @@ -94,8 +94,8 @@ public class DragonFireballController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new DragonFireballNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new DragonFireballNPC(this)); } return super.getBukkitEntity(); } @@ -126,4 +126,4 @@ public class DragonFireballController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EggController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EggController.java index f0870d3e1..bbe82e1fd 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EggController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EggController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; @@ -109,8 +110,8 @@ public class EggController extends AbstractEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new EggNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new EggNPC(this)); } return super.getBukkitEntity(); } @@ -132,4 +133,4 @@ public class EggController extends AbstractEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EnderCrystalController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EnderCrystalController.java index f5b1e69ee..2a6caebca 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EnderCrystalController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EnderCrystalController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEnderCrystal; @@ -93,8 +94,8 @@ public class EnderCrystalController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new EnderCrystalNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new EnderCrystalNPC(this)); } return super.getBukkitEntity(); } @@ -113,4 +114,4 @@ public class EnderCrystalController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EnderPearlController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EnderPearlController.java index 349020810..a5ec0d432 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EnderPearlController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EnderPearlController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEnderPearl; @@ -93,8 +94,8 @@ public class EnderPearlController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new EnderPearlNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new EnderPearlNPC(this)); } return super.getBukkitEntity(); } @@ -116,4 +117,4 @@ public class EnderPearlController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EnderSignalController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EnderSignalController.java index e6880a8c2..eec1db72e 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EnderSignalController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EnderSignalController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEnderSignal; @@ -93,8 +94,8 @@ public class EnderSignalController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new EnderSignalNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new EnderSignalNPC(this)); } return super.getBukkitEntity(); } @@ -113,4 +114,4 @@ public class EnderSignalController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EvokerFangsController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EvokerFangsController.java index 82e1feb0c..a861b9677 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EvokerFangsController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/EvokerFangsController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; @@ -96,8 +97,8 @@ public class EvokerFangsController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new EvokerFangsNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new EvokerFangsNPC(this)); } return super.getBukkitEntity(); } @@ -129,4 +130,4 @@ public class EvokerFangsController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ExperienceOrbController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ExperienceOrbController.java index b4fcca221..2262b5442 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ExperienceOrbController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ExperienceOrbController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; @@ -79,8 +80,8 @@ public class ExperienceOrbController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new ExperienceOrbNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new ExperienceOrbNPC(this)); } return super.getBukkitEntity(); } @@ -113,4 +114,4 @@ public class ExperienceOrbController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/FallingBlockController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/FallingBlockController.java index 1c0e1e75a..48cd291ce 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/FallingBlockController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/FallingBlockController.java @@ -113,8 +113,8 @@ public class FallingBlockController extends AbstractEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new FallingBlockNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new FallingBlockNPC(this)); } return super.getBukkitEntity(); } @@ -174,4 +174,4 @@ public class FallingBlockController extends AbstractEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/FireworkController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/FireworkController.java index 97f833a0e..007301b1a 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/FireworkController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/FireworkController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; @@ -79,8 +80,8 @@ public class FireworkController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new FireworkNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new FireworkNPC(this)); } return super.getBukkitEntity(); } @@ -113,4 +114,4 @@ public class FireworkController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/FishingHookController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/FishingHookController.java index aad5bf7f5..3829e9bef 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/FishingHookController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/FishingHookController.java @@ -2,6 +2,7 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; import java.util.UUID; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; @@ -93,8 +94,8 @@ public class FishingHookController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new FishingHookNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new FishingHookNPC(this)); } return super.getBukkitEntity(); } @@ -147,4 +148,4 @@ public class FishingHookController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ItemController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ItemController.java index 2311fc5bd..ecaebbb06 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ItemController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ItemController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -103,8 +104,8 @@ public class ItemController extends AbstractEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new ItemNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new ItemNPC(this)); } return super.getBukkitEntity(); } @@ -153,4 +154,4 @@ public class ItemController extends AbstractEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ItemFrameController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ItemFrameController.java index bb75371f6..7d9746d79 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ItemFrameController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ItemFrameController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; @@ -95,8 +96,8 @@ public class ItemFrameController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new ItemFrameNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new ItemFrameNPC(this)); } return super.getBukkitEntity(); } @@ -150,4 +151,4 @@ public class ItemFrameController extends MobEntityController { } } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/LargeFireballController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/LargeFireballController.java index 6169943c0..27d1e834a 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/LargeFireballController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/LargeFireballController.java @@ -80,8 +80,8 @@ public class LargeFireballController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new LargeFireballNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new LargeFireballNPC(this)); } return super.getBukkitEntity(); } @@ -126,4 +126,4 @@ public class LargeFireballController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/LeashController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/LeashController.java index 434e5ca0c..415a5ed04 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/LeashController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/LeashController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; @@ -79,8 +80,8 @@ public class LeashController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new LeashNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new LeashNPC(this)); } return super.getBukkitEntity(); } @@ -118,4 +119,4 @@ public class LeashController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/LlamaSpitController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/LlamaSpitController.java index 4560d483a..6f5daf288 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/LlamaSpitController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/LlamaSpitController.java @@ -99,8 +99,8 @@ public class LlamaSpitController extends AbstractEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new LlamaSpitNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new LlamaSpitNPC(this)); } return super.getBukkitEntity(); } @@ -136,4 +136,4 @@ public class LlamaSpitController extends AbstractEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartChestController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartChestController.java index b8dba9045..1137f5e0f 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartChestController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartChestController.java @@ -88,8 +88,8 @@ public class MinecartChestController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new MinecartChestNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new MinecartChestNPC(this)); } return super.getBukkitEntity(); } @@ -123,4 +123,4 @@ public class MinecartChestController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartCommandController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartCommandController.java index 681d765e8..7fa7fc631 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartCommandController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartCommandController.java @@ -88,8 +88,8 @@ public class MinecartCommandController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new MinecartCommandNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new MinecartCommandNPC(this)); } return super.getBukkitEntity(); } @@ -122,4 +122,4 @@ public class MinecartCommandController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartFurnaceController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartFurnaceController.java index e444353c1..9f5b6c899 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartFurnaceController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartFurnaceController.java @@ -88,8 +88,8 @@ public class MinecartFurnaceController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new MinecartFurnaceNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new MinecartFurnaceNPC(this)); } return super.getBukkitEntity(); } @@ -122,4 +122,4 @@ public class MinecartFurnaceController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartRideableController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartRideableController.java index fe5601359..512411303 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartRideableController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/MinecartRideableController.java @@ -88,8 +88,8 @@ public class MinecartRideableController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new MinecartRideableNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new MinecartRideableNPC(this)); } return super.getBukkitEntity(); } @@ -122,4 +122,4 @@ public class MinecartRideableController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/PaintingController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/PaintingController.java index 9b8327450..b321500c6 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/PaintingController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/PaintingController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; @@ -79,8 +80,8 @@ public class PaintingController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new PaintingNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new PaintingNPC(this)); } return super.getBukkitEntity(); } @@ -118,4 +119,4 @@ public class PaintingController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ShulkerBulletController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ShulkerBulletController.java index 5bb480913..35cbd4344 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ShulkerBulletController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ShulkerBulletController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; @@ -79,8 +80,8 @@ public class ShulkerBulletController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new ShulkerBulletNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new ShulkerBulletNPC(this)); } return super.getBukkitEntity(); } @@ -113,4 +114,4 @@ public class ShulkerBulletController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/SmallFireballController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/SmallFireballController.java index fb8c158f2..1f8f8ffc5 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/SmallFireballController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/SmallFireballController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; @@ -79,8 +80,8 @@ public class SmallFireballController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new SmallFireballNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new SmallFireballNPC(this)); } return super.getBukkitEntity(); } @@ -116,4 +117,4 @@ public class SmallFireballController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/SnowballController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/SnowballController.java index b811c861b..d5782f78c 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/SnowballController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/SnowballController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; @@ -79,8 +80,8 @@ public class SnowballController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new SnowballNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new SnowballNPC(this)); } return super.getBukkitEntity(); } @@ -113,4 +114,4 @@ public class SnowballController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/SpectralArrowController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/SpectralArrowController.java index 16132725c..2684e4773 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/SpectralArrowController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/SpectralArrowController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftArrow; @@ -79,8 +80,8 @@ public class SpectralArrowController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new SpectralArrowNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new SpectralArrowNPC(this)); } return super.getBukkitEntity(); } @@ -113,4 +114,4 @@ public class SpectralArrowController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/TNTPrimedController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/TNTPrimedController.java index 10c67402a..f87e21098 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/TNTPrimedController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/TNTPrimedController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; @@ -79,8 +80,8 @@ public class TNTPrimedController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new TNTPrimedNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new TNTPrimedNPC(this)); } return super.getBukkitEntity(); } @@ -113,4 +114,4 @@ public class TNTPrimedController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ThrownExpBottleController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ThrownExpBottleController.java index f6b9ae71b..58fb21a69 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ThrownExpBottleController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ThrownExpBottleController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; @@ -79,8 +80,8 @@ public class ThrownExpBottleController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new ThrownExpBottleNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new ThrownExpBottleNPC(this)); } return super.getBukkitEntity(); } @@ -116,4 +117,4 @@ public class ThrownExpBottleController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ThrownPotionController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ThrownPotionController.java index f9d8da531..cf43fc3ec 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ThrownPotionController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ThrownPotionController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; @@ -80,11 +81,11 @@ public class ThrownPotionController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { if (getItem() != null && getItem().getItem().equals(Items.LINGERING_POTION)) { - bukkitEntity = new LingeringThrownPotionNPC(this); + NMSImpl.setBukkitEntity(this, new LingeringThrownPotionNPC(this)); } else { - bukkitEntity = new SplashThrownPotionNPC(this); + NMSImpl.setBukkitEntity(this, new SplashThrownPotionNPC(this)); } } return super.getBukkitEntity(); @@ -132,4 +133,4 @@ public class ThrownPotionController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ThrownTridentController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ThrownTridentController.java index b3f5e6a98..a313bd3b3 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ThrownTridentController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/ThrownTridentController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; @@ -79,8 +80,8 @@ public class ThrownTridentController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new ThrownTridentNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new ThrownTridentNPC(this)); } return super.getBukkitEntity(); } @@ -113,4 +114,4 @@ public class ThrownTridentController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/TippedArrowController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/TippedArrowController.java index f123bdcfa..6858188fd 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/TippedArrowController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/TippedArrowController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftArrow; @@ -79,8 +80,8 @@ public class TippedArrowController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new TippedArrowNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new TippedArrowNPC(this)); } return super.getBukkitEntity(); } @@ -113,4 +114,4 @@ public class TippedArrowController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/WitherSkullController.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/WitherSkullController.java index 49dfa426c..ef345b0dc 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/WitherSkullController.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/entity/nonliving/WitherSkullController.java @@ -1,5 +1,6 @@ package net.citizensnpcs.nms.v1_14_R1.entity.nonliving; +import net.citizensnpcs.nms.v1_14_R1.util.NMSImpl; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.v1_14_R1.CraftServer; import org.bukkit.craftbukkit.v1_14_R1.entity.CraftEntity; @@ -79,8 +80,8 @@ public class WitherSkullController extends MobEntityController { @Override public CraftEntity getBukkitEntity() { - if (npc != null && !(bukkitEntity instanceof NPCHolder)) { - bukkitEntity = new WitherSkullNPC(this); + if (npc != null && !(super.getBukkitEntity() instanceof NPCHolder)) { + NMSImpl.setBukkitEntity(this, new WitherSkullNPC(this)); } return super.getBukkitEntity(); } @@ -113,4 +114,4 @@ public class WitherSkullController extends MobEntityController { return npc; } } -} \ No newline at end of file +} diff --git a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/util/NMSImpl.java b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/util/NMSImpl.java index c37fee225..255bbf939 100644 --- a/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/util/NMSImpl.java +++ b/v1_14_R1/src/main/java/net/citizensnpcs/nms/v1_14_R1/util/NMSImpl.java @@ -1654,6 +1654,14 @@ public class NMSImpl implements NMSBridge { navigation.c(); } + public static void setBukkitEntity(Entity entity, CraftEntity bukkitEntity) { + try { + BUKKITENTITY_FIELD_SETTER.invoke(entity, bukkitEntity); + } catch (Throwable e) { + e.printStackTrace(); + } + } + private static final MethodHandle ADVANCEMENT_PLAYER_FIELD = NMS.getFinalSetter(EntityPlayer.class, "advancementDataPlayer"); private static final Set BAD_CONTROLLER_LOOK = EnumSet.of(EntityType.POLAR_BEAR, EntityType.SILVERFISH, @@ -1688,6 +1696,7 @@ public class NMSImpl implements NMSBridge { private static final Random RANDOM = Util.getFastRandom(); private static final MethodHandle SIZE_FIELD_GETTER = NMS.getGetter(Entity.class, "size"); private static final MethodHandle SIZE_FIELD_SETTER = NMS.getSetter(Entity.class, "size"); + private static final MethodHandle BUKKITENTITY_FIELD_SETTER = NMS.getSetter(Entity.class, "bukkitEntity"); private static Field SKULL_PROFILE_FIELD; static { try {