mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 11:05:12 +00:00
Fix Dimension ID handling
This commit is contained in:
1 parent
75dc7ed95c
commit
2cc5e31dc7
2 files changed
+8
-1
No files matched your search
@@ -55,7 +55,7 @@ public class AnimationData implements IAnimationData {
|
||||
float range = parent instanceof PlayerData ? 160 : 60;
|
||||
if (sendingEntity != null) {
|
||||
if(sendingEntity instanceof EntityNPCInterface && sendingEntity.dimension != sendingEntity.worldObj.provider.dimensionId)
|
||||
sendingEntity.dimension = sendingEntity.worldObj.provider.dimensionId;
|
||||
((EntityNPCInterface) sendingEntity).fixDimensionID();
|
||||
|
||||
List<EntityPlayer> entities = sendingEntity.worldObj.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(
|
||||
sendingEntity.posX - range, sendingEntity.posY - range, sendingEntity.posZ - range,
|
||||
|
||||
@@ -390,10 +390,17 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
|
||||
public void updateClient() {
|
||||
NBTTagCompound compound = writeSpawnData();
|
||||
compound.setInteger("EntityId", getEntityId());
|
||||
fixDimensionID();
|
||||
Server.sendAssociatedData(this, EnumPacketClient.UPDATE_NPC, compound);
|
||||
updateClient = false;
|
||||
}
|
||||
|
||||
public void fixDimensionID(){
|
||||
if(worldObj == null || worldObj.provider == null || this.dimension == worldObj.provider.dimensionId)
|
||||
return;
|
||||
this.dimension = worldObj.provider.dimensionId;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean interact(EntityPlayer player) {
|
||||
|
||||
Reference in new issue
Block a user