Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/19/17 in all areas

  1. i would first try using -nogui to disable the server GUI
    1 point
  2. Item#getNBTShareTag is called by PacketBuffer#writeItemStack, which is called by every packet that sends an ItemStack. The main one is SPacketSetSlot, which is sent by EntityPlayerMP#sendSlotContents (which implements IContainerListener#sendSlotContents); this is called by Container#detectAndSendChanges, which first checks if the current and previous ItemStack for the slot aren't equal using ItemStack.areItemStacksEqual. ItemStack.areItemStacksEqual checks the Item, metadata, NBT and capabilities of the two ItemStacks. Container#detectAndSendChanges is called on EntityPlayer#openContainer from various places, including EntityPlayerMP#onUpdate (called every tick). In general, you shouldn't need to manually send packets.
    1 point
  3. There are two main ways to sync item capability data: Override Item#getNBTShareTag, as suggested in this PR and various other issues. Register an IContainerListener for EntityPlayer#inventoryContainer on PlayerLoggedInEvent and PlayerEvent.Clone and for PlayerContainerEvent#getContainer on PlayerContainerEvent.Open. I use the latter in my mod. This class is responsible for registering the IContainerListener instances with each Container, this is the base class for the IContainerListener implementations. The implementations are here, here, here and here.
    1 point
  4. Oh thanks. I am happy too I finally helped someone.
    1 point
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.