Last active
December 19, 2015 00:59
-
-
Save ft975/5872997 to your computer and use it in GitHub Desktop.
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
@override public Packet getDescriptionPacket() { | |
final NBTTagCompound tc = new NBTTagCompound(); // Make a new TagCompound to store the data in | |
super.writeToNBT(tc); // Tell the superclass TE to fill the tag compound with data | |
this.writeToNBT(tc); // Tell the current TE to fill the tag compound with data | |
return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 2, tc); // Make a new packet with the information Par1 = xPosition, par2 = yPosition, par3 = zPosition, par4 = ???, par5 = tag compound we just filled with information | |
} | |
@override public void onDataPacket(INetworkManager net, Packet132TileEntityData pkt) { | |
super.onDataPacket(net, pkt); // Do things like postion and anything else minecraft wants to do | |
readFromNBT(pkt.customParam1); // Read the packet ourselves and get inforation stored in the tag compound | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment