mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 07:35:11 +00:00
Implemented a better synchronisation system for left hand item and projectile item, similar to main hand and armor items system for vanilla
This commit is contained in:
1 parent
8aa9d16d8e
commit
21c16e5341
5 files changed
+30
-2
No files matched your search
@@ -358,5 +358,14 @@ public class PacketHandlerClient extends PacketHandlerServer{
|
||||
else if(type == EnumPacketClient.STOP_SOUNDS) {
|
||||
ScriptSoundController.Instance.stopAllSounds();
|
||||
}
|
||||
else if(type == EnumPacketClient.SYNC_WEAPON) {
|
||||
Entity entity = Minecraft.getMinecraft().theWorld.getEntityByID(buffer.readInt());
|
||||
if(!(entity instanceof EntityNPCInterface))
|
||||
return;
|
||||
EntityNPCInterface npc = (EntityNPCInterface) entity;
|
||||
int weaponSlotIndex = buffer.readInt();
|
||||
ItemStack stack = ItemStack.loadItemStackFromNBT(Server.readNBT(buffer));
|
||||
npc.inventory.weapons.put(weaponSlotIndex,stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user