Added updateClient() function to ScriptNpc.

This commit is contained in:
luisc committed 2022-01-03 21:30:38 -06:00
1 parent 73db2da124
commit 32792e7d6f
4 files changed
+14 -5

No files matched your search

@@ -313,10 +313,7 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
LinkedNpcController.Instance.loadNpcData(this);
}
if(updateClient){
NBTTagCompound compound = writeSpawnData();
compound.setInteger("EntityId", getEntityId());
Server.sendAssociatedData(this, EnumPacketClient.UPDATE_NPC, compound);
updateClient = false;
this.updateClient();
}
if(updateAI){
updateTasks();
@@ -365,6 +362,14 @@ public abstract class EntityNPCInterface extends EntityCreature implements IEnti
((JobBard)jobInterface).onLivingUpdate();
}
}
public void updateClient() {
NBTTagCompound compound = writeSpawnData();
compound.setInteger("EntityId", getEntityId());
Server.sendAssociatedData(this, EnumPacketClient.UPDATE_NPC, compound);
updateClient = false;
}
@Override
public boolean interact(EntityPlayer player) {
@@ -77,7 +77,7 @@ public class ScriptBlock implements IBlock {
}
public boolean isContainer() {
return this.tile != null && this.tile instanceof IInventory?((IInventory)this.tile).getSizeInventory() > 0:false;
return this.tile != null && this.tile instanceof IInventory && ((IInventory) this.tile).getSizeInventory() > 0;
}
public IContainer getContainer() {
@@ -1087,4 +1087,6 @@ public class ScriptNpc<T extends EntityNPCInterface> extends ScriptLiving<T> imp
public String getOverlayTexture() {
return npc.display.glowTexture;
}
public void updateClient() { this.npc.updateClient(); };
}
@@ -728,4 +728,6 @@ public interface ICustomNpc<T extends EntityCreature> extends IEntityLiving<T> {
public void setOverlayTexture(String overlayTexture);
public String getOverlayTexture();
public void updateClient();
}