public class NetworkedItemStackCache extends NetworkedObjectCache<ItemStackKey>
NetworkedObjectCache.ClientView, NetworkedObjectCache.Link, NetworkedObjectCache.ServerView
defaultObject
Constructor and Description |
---|
NetworkedItemStackCache() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getCacheName() |
protected ItemStackKey |
getCanonical(ItemStackKey obj)
Takes a specific object and turns it into its most basic form.
|
protected ItemStackKey |
readObject(PacketBufferBC buffer)
Reads the specified object from the buffer.
|
protected void |
writeObject(ItemStackKey obj,
PacketBufferBC buffer)
Writes the specified object out to the buffer.
|
client, server
protected ItemStackKey getCanonical(ItemStackKey obj)
NetworkedObjectCache
ItemStack
's this will
should set the stack size to 1, and remove all non-rendered NBT tag components.getCanonical
in class NetworkedObjectCache<ItemStackKey>
obj
- The object to canonicalized.protected void writeObject(ItemStackKey obj, PacketBufferBC buffer)
NetworkedObjectCache
writeObject
in class NetworkedObjectCache<ItemStackKey>
obj
- The object to write. It will have already been passed through NetworkedObjectCache.getCanonical(Object)
buffer
- The buffer to write into.protected ItemStackKey readObject(PacketBufferBC buffer) throws java.io.IOException
NetworkedObjectCache
NetworkedObjectCache.getCanonical(Object)
(so value.equals(getCanonical(value))
should return true.)readObject
in class NetworkedObjectCache<ItemStackKey>
buffer
- The buffer to read fromjava.io.IOException
protected java.lang.String getCacheName()
getCacheName
in class NetworkedObjectCache<ItemStackKey>