Make tracker replacement more durable at the cost of adding a custom filter to all entity classes. Also fixes early player tracker replacement in 1.20.6 and above

This commit is contained in:
fullwall 2024-08-26 01:02:07 +08:00
parent 92628df235
commit efb590c45b
1336 changed files with 8365 additions and 190 deletions

View File

@ -55,7 +55,6 @@ import net.citizensnpcs.trait.SitTrait;
import net.citizensnpcs.trait.SkinLayers;
import net.citizensnpcs.trait.SneakTrait;
import net.citizensnpcs.util.ChunkCoord;
import net.citizensnpcs.util.EntityPacketTracker;
import net.citizensnpcs.util.Messages;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.PlayerAnimation;
@ -337,14 +336,8 @@ public class CitizensNPC extends AbstractNPC {
Bukkit.getPluginManager().callEvent(new NPCNeedsRespawnEvent(this, at));
return false;
}
// Spawning the entity will create an entity tracker that is not controlled by Citizens. This is fixed later in
// spawning; to avoid sending packets twice, try to hide the entity initially
EntityPacketTracker tracker = NMS.getPacketTrackerDirectly(getEntity());
if (tracker != null) {
for (Player player : Bukkit.getServer().getOnlinePlayers()) {
tracker.unlink(player);
}
}
// Spawning the entity will initially create an entity tracker that is not controlled by Citizens
data().set(NPC.Metadata.NPC_SPAWNING_IN_PROGRESS, true);
NMS.setLocationDirectly(getEntity(), at);
NMS.setHeadAndBodyYaw(getEntity(), at.getYaw());
@ -391,6 +384,7 @@ public class CitizensNPC extends AbstractNPC {
}
}
NMS.replaceTracker(getEntity());
data().remove(NPC.Metadata.NPC_SPAWNING_IN_PROGRESS);
EntityType type = getEntity().getType();
if (type.isAlive()) {
LivingEntity entity = (LivingEntity) getEntity();

View File

@ -161,15 +161,14 @@ public class NMS {
return createPacketTracker(entity, new PacketAggregator());
}
/*
* Yggdrasil's default implementation of this method silently fails instead of throwing
* an Exception like it should.
*/
public static EntityPacketTracker createPacketTracker(Entity entity, PacketAggregator agg) {
return BRIDGE.createPacketTracker(entity, agg);
}
/*
* Yggdrasil's default implementation of this method silently fails instead of throwing
* an Exception like it should.
*/
public static GameProfile fillProfileProperties(GameProfile profile, boolean requireSecure) throws Throwable {
return BRIDGE.fillProfileProperties(profile, requireSecure);
}
@ -962,6 +961,10 @@ public class NMS {
BRIDGE.setWitherInvulnerableTicks(wither, ticks);
}
public static boolean shouldBroadcastToPlayer(NPC npc, Supplier<Boolean> defaultResponse) {
return npc != null && npc.data().has(NPC.Metadata.NPC_SPAWNING_IN_PROGRESS) ? false : defaultResponse.get();
}
public static boolean shouldJump(org.bukkit.entity.Entity entity) {
return BRIDGE.shouldJump(entity);
}

View File

@ -14,10 +14,12 @@ import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityArmorStand;
import net.minecraft.server.v1_10_R1.EntityHuman;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EnumHand;
import net.minecraft.server.v1_10_R1.EnumInteractionResult;
import net.minecraft.server.v1_10_R1.ItemStack;
@ -50,6 +52,11 @@ public class ArmorStandController extends MobEntityController {
}
public static class EntityArmorStandNPC extends EntityArmorStand implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityArmorStandNPC(World world) {

View File

@ -17,6 +17,7 @@ import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityBat;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
import net.minecraft.server.v1_10_R1.World;
@ -46,6 +47,11 @@ public class BatController extends MobEntityController {
}
public static class EntityBatNPC extends EntityBat implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityBatNPC(World world) {

View File

@ -17,6 +17,7 @@ import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityBlaze;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
import net.minecraft.server.v1_10_R1.World;
@ -46,6 +47,11 @@ public class BlazeController extends MobEntityController {
}
public static class EntityBlazeNPC extends EntityBlaze implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityBlazeNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityCaveSpider;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
@ -48,6 +49,11 @@ public class CaveSpiderController extends MobEntityController {
}
public static class EntityCaveSpiderNPC extends EntityCaveSpider implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityCaveSpiderNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityChicken;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
@ -48,6 +49,11 @@ public class ChickenController extends MobEntityController {
}
public static class EntityChickenNPC extends EntityChicken implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityChickenNPC(World world) {

View File

@ -19,6 +19,7 @@ import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityCow;
import net.minecraft.server.v1_10_R1.EntityHuman;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EnumHand;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.ItemStack;
@ -52,6 +53,11 @@ public class CowController extends MobEntityController {
}
public static class EntityCowNPC extends EntityCow implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityCowNPC(World world) {

View File

@ -20,6 +20,7 @@ import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityCreeper;
import net.minecraft.server.v1_10_R1.EntityHuman;
import net.minecraft.server.v1_10_R1.EntityLightning;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EnumHand;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.ItemStack;
@ -52,6 +53,11 @@ public class CreeperController extends MobEntityController {
}
public static class EntityCreeperNPC extends EntityCreeper implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private boolean allowPowered;
private final CitizensNPC npc;

View File

@ -22,6 +22,7 @@ import net.minecraft.server.v1_10_R1.DamageSource;
import net.minecraft.server.v1_10_R1.DragonControllerPhase;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityEnderDragon;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
import net.minecraft.server.v1_10_R1.Vec3D;
@ -52,6 +53,11 @@ public class EnderDragonController extends MobEntityController {
}
public static class EntityEnderDragonNPC extends EntityEnderDragon implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityEnderDragonNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityEnderman;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
@ -48,6 +49,11 @@ public class EndermanController extends MobEntityController {
}
public static class EntityEndermanNPC extends EntityEnderman implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityEndermanNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityEndermite;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
@ -48,6 +49,11 @@ public class EndermiteController extends MobEntityController {
}
public static class EntityEndermiteNPC extends EntityEndermite implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityEndermiteNPC(World world) {

View File

@ -65,7 +65,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
private PlayerControllerJump controllerJump;
private PlayerControllerMove controllerMove;
private final Map<EnumItemSlot, ItemStack> equipmentCache = Maps.newEnumMap(EnumItemSlot.class);
private boolean isTracked = false;
private int jumpTicks = 0;
private PlayerNavigation navigation;
private final CitizensNPC npc;
@ -94,10 +93,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
}
@Override
public boolean a(EntityPlayer entityplayer) {
if (npc != null && !isTracked)
return false;
return super.a(entityplayer);
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
public float a(PathType pathtype) {
@ -382,10 +379,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
npc.getOrAddTrait(SkinTrait.class).setSkinPersistent(skinName, signature, data);
}
public void setTracked() {
isTracked = true;
}
public void updateAI() {
controllerMove.c();
controllerJump.b();

View File

@ -17,6 +17,7 @@ import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityGhast;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
import net.minecraft.server.v1_10_R1.World;
@ -32,6 +33,11 @@ public class GhastController extends MobEntityController {
}
public static class EntityGhastNPC extends EntityGhast implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityGhastNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityGiantZombie;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
@ -34,6 +35,11 @@ public class GiantController extends MobEntityController {
}
public static class EntityGiantNPC extends EntityGiantZombie implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityGiantNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityGuardian;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
@ -34,6 +35,11 @@ public class GuardianController extends MobEntityController {
}
public static class EntityGuardianNPC extends EntityGuardian implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityGuardianNPC(World world) {

View File

@ -23,6 +23,7 @@ import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityHorse;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.GenericAttributes;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -46,11 +47,17 @@ public class HorseController extends MobEntityController {
}
public static class EntityHorseNPC extends EntityHorse implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private double baseMovementSpeed;
private final CitizensNPC npc;
private boolean riding;
public EntityHorseNPC(World world) {
this(world, null);
}

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityIronGolem;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
@ -34,6 +35,11 @@ public class IronGolemController extends MobEntityController {
}
public static class EntityIronGolemNPC extends EntityIronGolem implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityIronGolemNPC(World world) {

View File

@ -20,6 +20,7 @@ import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityHuman;
import net.minecraft.server.v1_10_R1.EntityMagmaCube;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
@ -36,6 +37,11 @@ public class MagmaCubeController extends MobEntityController {
}
public static class EntityMagmaCubeNPC extends EntityMagmaCube implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityMagmaCubeNPC(World world) {

View File

@ -19,6 +19,7 @@ import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityHuman;
import net.minecraft.server.v1_10_R1.EntityMushroomCow;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EnumHand;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.ItemStack;
@ -37,6 +38,11 @@ public class MushroomCowController extends MobEntityController {
}
public static class EntityMushroomCowNPC extends EntityMushroomCow implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityMushroomCowNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityOcelot;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
@ -34,6 +35,11 @@ public class OcelotController extends MobEntityController {
}
public static class EntityOcelotNPC extends EntityOcelot implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityOcelotNPC(World world) {

View File

@ -19,6 +19,7 @@ import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityLightning;
import net.minecraft.server.v1_10_R1.EntityPig;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
@ -35,6 +36,11 @@ public class PigController extends MobEntityController {
}
public static class EntityPigNPC extends EntityPig implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityPigNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityPigZombie;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
@ -34,6 +35,11 @@ public class PigZombieController extends MobEntityController {
}
public static class EntityPigZombieNPC extends EntityPigZombie implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityPigZombieNPC(World world) {

View File

@ -16,6 +16,7 @@ import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntityPolarBear;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
@ -32,6 +33,11 @@ public class PolarBearController extends MobEntityController {
}
public static class EntityPolarBearNPC extends EntityPolarBear implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityPolarBearNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityLiving;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntityRabbit;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -35,6 +36,11 @@ public class RabbitController extends MobEntityController {
}
public static class EntityRabbitNPC extends EntityRabbit implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityRabbitNPC(World world) {

View File

@ -17,6 +17,7 @@ import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntitySheep;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -34,6 +35,11 @@ public class SheepController extends MobEntityController {
}
public static class EntitySheepNPC extends EntitySheep implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntitySheepNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityAIBodyControl;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntityShulker;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -35,6 +36,11 @@ public class ShulkerController extends MobEntityController {
}
public static class EntityShulkerNPC extends EntityShulker implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityShulkerNPC(World world) {

View File

@ -17,6 +17,7 @@ import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntitySilverfish;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -34,6 +35,11 @@ public class SilverfishController extends MobEntityController {
}
public static class EntitySilverfishNPC extends EntitySilverfish implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntitySilverfishNPC(World world) {

View File

@ -17,6 +17,7 @@ import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntitySkeleton;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -34,6 +35,11 @@ public class SkeletonController extends MobEntityController {
}
public static class EntitySkeletonNPC extends EntitySkeleton implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntitySkeletonNPC(World world) {

View File

@ -19,6 +19,7 @@ import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityHuman;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntitySlime;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -36,6 +37,11 @@ public class SlimeController extends MobEntityController {
}
public static class EntitySlimeNPC extends EntitySlime implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntitySlimeNPC(World world) {

View File

@ -17,6 +17,7 @@ import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntitySnowman;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -34,6 +35,11 @@ public class SnowmanController extends MobEntityController {
}
public static class EntitySnowmanNPC extends EntitySnowman implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntitySnowmanNPC(World world) {

View File

@ -17,6 +17,7 @@ import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntitySpider;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -34,6 +35,11 @@ public class SpiderController extends MobEntityController {
}
public static class EntitySpiderNPC extends EntitySpider implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntitySpiderNPC(World world) {

View File

@ -17,6 +17,7 @@ import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntitySquid;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -34,6 +35,11 @@ public class SquidController extends MobEntityController {
}
public static class EntitySquidNPC extends EntitySquid implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntitySquidNPC(World world) {

View File

@ -19,6 +19,7 @@ import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityHuman;
import net.minecraft.server.v1_10_R1.EntityLightning;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntityVillager;
import net.minecraft.server.v1_10_R1.EnumHand;
import net.minecraft.server.v1_10_R1.IBlockData;
@ -38,6 +39,11 @@ public class VillagerController extends MobEntityController {
}
public static class EntityVillagerNPC extends EntityVillager implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private boolean blockingATrade;
private final CitizensNPC npc;

View File

@ -17,6 +17,7 @@ import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntityWitch;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -34,6 +35,11 @@ public class WitchController extends MobEntityController {
}
public static class EntityWitchNPC extends EntityWitch implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityWitchNPC(World world) {

View File

@ -16,6 +16,7 @@ import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntityWither;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.SoundEffect;
@ -32,6 +33,11 @@ public class WitherController extends MobEntityController {
}
public static class EntityWitherNPC extends EntityWither implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityWitherNPC(World world) {

View File

@ -19,6 +19,7 @@ import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityLiving;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntityWolf;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -36,6 +37,11 @@ public class WolfController extends MobEntityController {
}
public static class EntityWolfNPC extends EntityWolf implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityWolfNPC(World world) {

View File

@ -17,6 +17,7 @@ import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.Entity;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntityZombie;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -34,6 +35,11 @@ public class ZombieController extends MobEntityController {
}
public static class EntityZombieNPC extends EntityZombie implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityZombieNPC(World world) {

View File

@ -12,9 +12,11 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityAreaEffectCloud;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -43,6 +45,11 @@ public class AreaEffectCloudController extends MobEntityController {
}
public static class EntityAreaEffectCloudNPC extends EntityAreaEffectCloud implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityAreaEffectCloudNPC(World world) {

View File

@ -13,9 +13,11 @@ import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityBoat;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -44,6 +46,11 @@ public class BoatController extends MobEntityController {
}
public static class EntityBoatNPC extends EntityBoat implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityBoatNPC(World world) {

View File

@ -13,9 +13,11 @@ import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityDragonFireball;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -44,6 +46,11 @@ public class DragonFireballController extends MobEntityController {
}
public static class EntityDragonFireballNPC extends EntityDragonFireball implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityDragonFireballNPC(World world) {

View File

@ -15,9 +15,11 @@ import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.AbstractEntityController;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityEgg;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
import net.minecraft.server.v1_10_R1.WorldServer;
@ -54,6 +56,11 @@ public class EggController extends AbstractEntityController {
}
public static class EntityEggNPC extends EntityEgg implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityEggNPC(World world) {

View File

@ -12,9 +12,11 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityEnderCrystal;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -43,6 +45,11 @@ public class EnderCrystalController extends MobEntityController {
}
public static class EntityEnderCrystalNPC extends EntityEnderCrystal implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityEnderCrystalNPC(World world) {

View File

@ -12,9 +12,11 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityEnderPearl;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -43,6 +45,11 @@ public class EnderPearlController extends MobEntityController {
}
public static class EntityEnderPearlNPC extends EntityEnderPearl implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityEnderPearlNPC(World world) {

View File

@ -12,9 +12,11 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityEnderSignal;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -43,6 +45,11 @@ public class EnderSignalController extends MobEntityController {
}
public static class EntityEnderSignalNPC extends EntityEnderSignal implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityEnderSignalNPC(World world) {

View File

@ -12,9 +12,11 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityExperienceOrb;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -29,6 +31,11 @@ public class ExperienceOrbController extends MobEntityController {
}
public static class EntityExperienceOrbNPC extends EntityExperienceOrb implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityExperienceOrbNPC(World world) {

View File

@ -17,10 +17,12 @@ import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.AbstractEntityController;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.Block;
import net.minecraft.server.v1_10_R1.EntityFallingBlock;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.IBlockData;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -46,6 +48,11 @@ public class FallingBlockController extends AbstractEntityController {
}
public static class EntityFallingBlockNPC extends EntityFallingBlock implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityFallingBlockNPC(World world) {

View File

@ -12,9 +12,11 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityFireworks;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -29,6 +31,11 @@ public class FireworkController extends MobEntityController {
}
public static class EntityFireworkNPC extends EntityFireworks implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityFireworkNPC(World world) {

View File

@ -12,9 +12,11 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityFishingHook;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -29,6 +31,11 @@ public class FishingHookController extends MobEntityController {
}
public static class EntityFishingHookNPC extends EntityFishingHook implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityFishingHookNPC(World world) {

View File

@ -15,10 +15,12 @@ import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.AbstractEntityController;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityHuman;
import net.minecraft.server.v1_10_R1.EntityItem;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.ItemStack;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -41,6 +43,11 @@ public class ItemController extends AbstractEntityController {
}
public static class EntityItemNPC extends EntityItem implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityItemNPC(World world) {

View File

@ -14,10 +14,12 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.BlockPosition;
import net.minecraft.server.v1_10_R1.EntityItemFrame;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EnumDirection;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -42,6 +44,11 @@ public class ItemFrameController extends MobEntityController {
}
public static class EntityItemFrameNPC extends EntityItemFrame implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityItemFrameNPC(World world) {

View File

@ -13,9 +13,11 @@ import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityLargeFireball;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -30,6 +32,11 @@ public class LargeFireballController extends MobEntityController {
}
public static class EntityLargeFireballNPC extends EntityLargeFireball implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityLargeFireballNPC(World world) {

View File

@ -12,9 +12,11 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityLeash;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -29,6 +31,11 @@ public class LeashController extends MobEntityController {
}
public static class EntityLeashNPC extends EntityLeash implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityLeashNPC(World world) {

View File

@ -13,9 +13,11 @@ import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityMinecartChest;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -30,6 +32,11 @@ public class MinecartChestController extends MobEntityController {
}
public static class EntityMinecartChestNPC extends EntityMinecartChest implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityMinecartChestNPC(World world) {

View File

@ -13,9 +13,11 @@ import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityMinecartCommandBlock;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -30,6 +32,11 @@ public class MinecartCommandController extends MobEntityController {
}
public static class EntityMinecartCommandNPC extends EntityMinecartCommandBlock implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityMinecartCommandNPC(World world) {

View File

@ -13,9 +13,11 @@ import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityMinecartFurnace;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -30,6 +32,11 @@ public class MinecartFurnaceController extends MobEntityController {
}
public static class EntityMinecartFurnaceNPC extends EntityMinecartFurnace implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityMinecartFurnaceNPC(World world) {

View File

@ -9,9 +9,11 @@ import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityMinecartHopper;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -26,6 +28,11 @@ public class MinecartHopperController extends MobEntityController {
}
public static class EntityMinecartHopperNPC extends EntityMinecartHopper implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityMinecartHopperNPC(World world) {

View File

@ -13,9 +13,11 @@ import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityMinecartRideable;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -30,6 +32,11 @@ public class MinecartRideableController extends MobEntityController {
}
public static class EntityMinecartRideableNPC extends EntityMinecartRideable implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityMinecartRideableNPC(World world) {

View File

@ -9,9 +9,11 @@ import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityMinecartMobSpawner;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -26,6 +28,11 @@ public class MinecartSpawnerController extends MobEntityController {
}
public static class EntityMinecartSpawnerNPC extends EntityMinecartMobSpawner implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityMinecartSpawnerNPC(World world) {

View File

@ -9,9 +9,11 @@ import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.nms.v1_10_R1.util.NMSImpl;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityMinecartTNT;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -26,6 +28,11 @@ public class MinecartTNTController extends MobEntityController {
}
public static class EntityMinecartTNTNPC extends EntityMinecartTNT implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityMinecartTNTNPC(World world) {

View File

@ -12,9 +12,11 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityPainting;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -29,6 +31,11 @@ public class PaintingController extends MobEntityController {
}
public static class EntityPaintingNPC extends EntityPainting implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityPaintingNPC(World world) {

View File

@ -12,8 +12,10 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntityShulkerBullet;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -29,6 +31,11 @@ public class ShulkerBulletController extends MobEntityController {
}
public static class EntityShulkerBulletNPC extends EntityShulkerBullet implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityShulkerBulletNPC(World world) {

View File

@ -12,8 +12,10 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntitySmallFireball;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -29,6 +31,11 @@ public class SmallFireballController extends MobEntityController {
}
public static class EntitySmallFireballNPC extends EntitySmallFireball implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntitySmallFireballNPC(World world) {

View File

@ -12,8 +12,10 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntitySnowball;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -29,6 +31,11 @@ public class SnowballController extends MobEntityController {
}
public static class EntitySnowballNPC extends EntitySnowball implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntitySnowballNPC(World world) {

View File

@ -12,8 +12,10 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntitySpectralArrow;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -29,6 +31,11 @@ public class SpectralArrowController extends MobEntityController {
}
public static class EntitySpectralArrowNPC extends EntitySpectralArrow implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntitySpectralArrowNPC(World world) {

View File

@ -12,8 +12,10 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntityTNTPrimed;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -29,6 +31,11 @@ public class TNTPrimedController extends MobEntityController {
}
public static class EntityTNTPrimedNPC extends EntityTNTPrimed implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityTNTPrimedNPC(World world) {

View File

@ -12,8 +12,10 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntityThrownExpBottle;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -29,6 +31,11 @@ public class ThrownExpBottleController extends MobEntityController {
}
public static class EntityThrownExpBottleNPC extends EntityThrownExpBottle implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityThrownExpBottleNPC(World world) {

View File

@ -12,8 +12,10 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntityPotion;
import net.minecraft.server.v1_10_R1.Items;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
@ -30,6 +32,11 @@ public class ThrownPotionController extends MobEntityController {
}
public static class EntityThrownPotionNPC extends EntityPotion implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityThrownPotionNPC(World world) {

View File

@ -12,8 +12,10 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntityTippedArrow;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -29,6 +31,11 @@ public class TippedArrowController extends MobEntityController {
}
public static class EntityTippedArrowNPC extends EntityTippedArrow implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityTippedArrowNPC(World world) {

View File

@ -12,8 +12,10 @@ import net.citizensnpcs.nms.v1_10_R1.entity.MobEntityController;
import net.citizensnpcs.nms.v1_10_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_10_R1.AxisAlignedBB;
import net.minecraft.server.v1_10_R1.EntityPlayer;
import net.minecraft.server.v1_10_R1.EntityWitherSkull;
import net.minecraft.server.v1_10_R1.NBTTagCompound;
import net.minecraft.server.v1_10_R1.World;
@ -29,6 +31,11 @@ public class WitherSkullController extends MobEntityController {
}
public static class EntityWitherSkullNPC extends EntityWitherSkull implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityWitherSkullNPC(World world) {

View File

@ -1062,9 +1062,6 @@ public class NMSImpl implements NMSBridge {
e.printStackTrace();
}
}
if (getHandle(entity) instanceof EntityHumanNPC) {
((EntityHumanNPC) getHandle(entity)).setTracked();
}
}
@Override

View File

@ -101,7 +101,9 @@ public class PlayerlistTrackerEntry extends EntityTrackerEntry {
}
public static Set<org.bukkit.entity.Player> getSeenBy(EntityTrackerEntry tracker) {
return tracker.trackedPlayers.stream().map((Function<? super EntityPlayer, ? extends CraftPlayer>) EntityPlayer::getBukkitEntity).collect(Collectors.toSet());
return tracker.trackedPlayers.stream()
.map((Function<? super EntityPlayer, ? extends CraftPlayer>) EntityPlayer::getBukkitEntity)
.collect(Collectors.toSet());
}
private static Entity getTracker(EntityTrackerEntry entry) {

View File

@ -13,10 +13,12 @@ import net.citizensnpcs.api.npc.NPC;
import net.citizensnpcs.nms.v1_11_R1.util.NMSBoundingBox;
import net.citizensnpcs.npc.CitizensNPC;
import net.citizensnpcs.npc.ai.NPCHolder;
import net.citizensnpcs.util.NMS;
import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.EntityArmorStand;
import net.minecraft.server.v1_11_R1.EntityHuman;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.EnumHand;
import net.minecraft.server.v1_11_R1.EnumInteractionResult;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
@ -48,6 +50,11 @@ public class ArmorStandController extends MobEntityController {
}
public static class EntityArmorStandNPC extends EntityArmorStand implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityArmorStandNPC(World world) {

View File

@ -17,6 +17,7 @@ import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityBat;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
import net.minecraft.server.v1_11_R1.World;
@ -46,6 +47,11 @@ public class BatController extends MobEntityController {
}
public static class EntityBatNPC extends EntityBat implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityBatNPC(World world) {

View File

@ -17,6 +17,7 @@ import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityBlaze;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
import net.minecraft.server.v1_11_R1.World;
@ -46,6 +47,11 @@ public class BlazeController extends MobEntityController {
}
public static class EntityBlazeNPC extends EntityBlaze implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityBlazeNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityCaveSpider;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -48,6 +49,11 @@ public class CaveSpiderController extends MobEntityController {
}
public static class EntityCaveSpiderNPC extends EntityCaveSpider implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityCaveSpiderNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityChicken;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -48,6 +49,11 @@ public class ChickenController extends MobEntityController {
}
public static class EntityChickenNPC extends EntityChicken implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityChickenNPC(World world) {

View File

@ -19,6 +19,7 @@ import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityCow;
import net.minecraft.server.v1_11_R1.EntityHuman;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.EnumHand;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.ItemStack;
@ -52,6 +53,11 @@ public class CowController extends MobEntityController {
}
public static class EntityCowNPC extends EntityCow implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityCowNPC(World world) {

View File

@ -19,6 +19,7 @@ import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityCreeper;
import net.minecraft.server.v1_11_R1.EntityLightning;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -49,6 +50,11 @@ public class CreeperController extends MobEntityController {
}
public static class EntityCreeperNPC extends EntityCreeper implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private boolean allowPowered;
private final CitizensNPC npc;

View File

@ -22,6 +22,7 @@ import net.minecraft.server.v1_11_R1.DamageSource;
import net.minecraft.server.v1_11_R1.DragonControllerPhase;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityEnderDragon;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IEntitySelector;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -53,6 +54,11 @@ public class EnderDragonController extends MobEntityController {
}
public static class EntityEnderDragonNPC extends EntityEnderDragon implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityEnderDragonNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityEnderman;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -48,6 +49,11 @@ public class EndermanController extends MobEntityController {
}
public static class EntityEndermanNPC extends EntityEnderman implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityEndermanNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityEndermite;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -48,6 +49,11 @@ public class EndermiteController extends MobEntityController {
}
public static class EntityEndermiteNPC extends EntityEndermite implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityEndermiteNPC(World world) {

View File

@ -67,7 +67,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
private PlayerControllerJump controllerJump;
private PlayerControllerMove controllerMove;
private final Map<EnumItemSlot, ItemStack> equipmentCache = Maps.newEnumMap(EnumItemSlot.class);
private boolean isTracked = false;
private int jumpTicks = 0;
private PlayerNavigation navigation;
private final CitizensNPC npc;
@ -97,10 +96,8 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
}
@Override
public boolean a(EntityPlayer entityplayer) {
if (npc != null && !isTracked)
return false;
return super.a(entityplayer);
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
public float a(PathType pathtype) {
@ -400,10 +397,6 @@ public class EntityHumanNPC extends EntityPlayer implements NPCHolder, Skinnable
npc.getOrAddTrait(SkinTrait.class).setSkinPersistent(skinName, signature, data);
}
public void setTracked() {
isTracked = true;
}
public void updateAI() {
controllerMove.c();
controllerJump.b();

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityEvoker;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -34,6 +35,11 @@ public class EvokerController extends MobEntityController {
}
public static class EntityEvokerNPC extends EntityEvoker implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityEvokerNPC(World world) {

View File

@ -17,6 +17,7 @@ import net.citizensnpcs.util.Util;
import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityGhast;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
import net.minecraft.server.v1_11_R1.World;
@ -32,6 +33,11 @@ public class GhastController extends MobEntityController {
}
public static class EntityGhastNPC extends EntityGhast implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityGhastNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityGiantZombie;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -34,6 +35,11 @@ public class GiantController extends MobEntityController {
}
public static class EntityGiantNPC extends EntityGiantZombie implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityGiantNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityGuardian;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -34,6 +35,11 @@ public class GuardianController extends MobEntityController {
}
public static class EntityGuardianNPC extends EntityGuardian implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityGuardianNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityGuardianElder;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -34,6 +35,11 @@ public class GuardianElderController extends MobEntityController {
}
public static class EntityGuardianElderNPC extends EntityGuardianElder implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityGuardianElderNPC(World world) {

View File

@ -21,6 +21,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityHorse;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.GenericAttributes;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
@ -44,11 +45,17 @@ public class HorseController extends MobEntityController {
}
public static class EntityHorseNPC extends EntityHorse implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private double baseMovementSpeed;
private final CitizensNPC npc;
private boolean riding;
public EntityHorseNPC(World world) {
this(world, null);
}

View File

@ -22,6 +22,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityHorseDonkey;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.GenericAttributes;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
@ -45,11 +46,17 @@ public class HorseDonkeyController extends MobEntityController {
}
public static class EntityHorseDonkeyNPC extends EntityHorseDonkey implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private double baseMovementSpeed;
private final CitizensNPC npc;
private boolean riding;
public EntityHorseDonkeyNPC(World world) {
this(world, null);
}

View File

@ -22,6 +22,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityHorseMule;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.GenericAttributes;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
@ -45,11 +46,17 @@ public class HorseMuleController extends MobEntityController {
}
public static class EntityHorseMuleNPC extends EntityHorseMule implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private double baseMovementSpeed;
private final CitizensNPC npc;
private boolean riding;
public EntityHorseMuleNPC(World world) {
this(world, null);
}

View File

@ -22,6 +22,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityHorseSkeleton;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.GenericAttributes;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
@ -45,11 +46,17 @@ public class HorseSkeletonController extends MobEntityController {
}
public static class EntityHorseSkeletonNPC extends EntityHorseSkeleton implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private double baseMovementSpeed;
private final CitizensNPC npc;
private boolean riding;
public EntityHorseSkeletonNPC(World world) {
this(world, null);
}

View File

@ -22,6 +22,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityHorseZombie;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.GenericAttributes;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
@ -45,11 +46,17 @@ public class HorseZombieController extends MobEntityController {
}
public static class EntityHorseZombieNPC extends EntityHorseZombie implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private double baseMovementSpeed;
private final CitizensNPC npc;
private boolean riding;
public EntityHorseZombieNPC(World world) {
this(world, null);
}

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityIronGolem;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -34,6 +35,11 @@ public class IronGolemController extends MobEntityController {
}
public static class EntityIronGolemNPC extends EntityIronGolem implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityIronGolemNPC(World world) {

View File

@ -20,6 +20,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityLlama;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -42,6 +43,11 @@ public class LlamaController extends MobEntityController {
}
public static class EntityLlamaNPC extends EntityLlama implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityLlamaNPC(World world) {

View File

@ -20,6 +20,7 @@ import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityHuman;
import net.minecraft.server.v1_11_R1.EntityMagmaCube;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -36,6 +37,11 @@ public class MagmaCubeController extends MobEntityController {
}
public static class EntityMagmaCubeNPC extends EntityMagmaCube implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityMagmaCubeNPC(World world) {

View File

@ -19,6 +19,7 @@ import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityHuman;
import net.minecraft.server.v1_11_R1.EntityMushroomCow;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.EnumHand;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
@ -36,6 +37,11 @@ public class MushroomCowController extends MobEntityController {
}
public static class EntityMushroomCowNPC extends EntityMushroomCow implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityMushroomCowNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityOcelot;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -34,6 +35,11 @@ public class OcelotController extends MobEntityController {
}
public static class EntityOcelotNPC extends EntityOcelot implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityOcelotNPC(World world) {

View File

@ -19,6 +19,7 @@ import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityLightning;
import net.minecraft.server.v1_11_R1.EntityPig;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -35,6 +36,11 @@ public class PigController extends MobEntityController {
}
public static class EntityPigNPC extends EntityPig implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityPigNPC(World world) {

View File

@ -18,6 +18,7 @@ import net.minecraft.server.v1_11_R1.AxisAlignedBB;
import net.minecraft.server.v1_11_R1.BlockPosition;
import net.minecraft.server.v1_11_R1.Entity;
import net.minecraft.server.v1_11_R1.EntityPigZombie;
import net.minecraft.server.v1_11_R1.EntityPlayer;
import net.minecraft.server.v1_11_R1.IBlockData;
import net.minecraft.server.v1_11_R1.NBTTagCompound;
import net.minecraft.server.v1_11_R1.SoundEffect;
@ -34,6 +35,11 @@ public class PigZombieController extends MobEntityController {
}
public static class EntityPigZombieNPC extends EntityPigZombie implements NPCHolder {
@Override
public boolean a(EntityPlayer player) {
return NMS.shouldBroadcastToPlayer(npc, () -> super.a(player));
}
private final CitizensNPC npc;
public EntityPigZombieNPC(World world) {

Some files were not shown because too many files have changed in this diff Show More