fix for new spigot mappings update, fixes #1806

This commit is contained in:
Alex "mcmonkey" Goodwin 2019-06-02 08:36:47 -07:00
parent 7b2f08b372
commit 3dad7670c7
No known key found for this signature in database
GPG Key ID: 2F0F11928478A6F5
99 changed files with 344 additions and 283 deletions

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -158,8 +158,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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -176,8 +176,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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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();
}

View File

@ -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<EntityType> 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 {