Last active
December 13, 2015 23:39
-
-
Save mDiyo/4993441 to your computer and use it in GitHub Desktop.
Description Packet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void readFromNBT (NBTTagCompound tags) | |
{ | |
super.readFromNBT(tags); | |
readCustomNBT(tags); | |
} | |
public void readNetworkNBT(NBTTagCompound tags) | |
{ | |
//Anything that needs synced in here | |
} | |
public void writeToNBT (NBTTagCompound tags) | |
{ | |
super.writeToNBT(tags); | |
writeCustomNBT(tags); | |
} | |
public void writeNetworkNBT (NBTTagCompound tags) | |
{ | |
//Anything worth sending in here | |
} | |
@Override | |
public Packet getDescriptionPacket () | |
{ | |
NBTTagCompound tag = new NBTTagCompound(); | |
writeNetworkNBT(tag); | |
return new Packet132TileEntityData(xCoord, yCoord, zCoord, 1, tag); | |
} | |
@Override | |
public void onDataPacket (INetworkManager net, Packet132TileEntityData packet) | |
{ | |
readNetworkNBT(packet.data); | |
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks.