From 6312636fd9a4d0f56dc7c9ff474a99d879bcb4e9 Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Mon, 23 Mar 2015 14:51:06 +0000 Subject: Reworked the whole repo. --- .../jewelrycraft/network/PacketSendPlayerInfo.java | 58 ++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/main/java/darkknight/jewelrycraft/network/PacketSendPlayerInfo.java (limited to 'src/main/java/darkknight/jewelrycraft/network/PacketSendPlayerInfo.java') diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketSendPlayerInfo.java b/src/main/java/darkknight/jewelrycraft/network/PacketSendPlayerInfo.java new file mode 100644 index 0000000..e2f66a0 --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/network/PacketSendPlayerInfo.java @@ -0,0 +1,58 @@ +package darkknight.jewelrycraft.network; + +import io.netty.buffer.ByteBuf; +import net.minecraft.nbt.NBTTagCompound; +import cpw.mods.fml.common.network.ByteBufUtils; +import cpw.mods.fml.common.network.simpleimpl.IMessage; +import cpw.mods.fml.common.network.simpleimpl.IMessageHandler; +import cpw.mods.fml.common.network.simpleimpl.MessageContext; +import darkknight.jewelrycraft.events.ScreenHandler; + +public class PacketSendPlayerInfo implements IMessage, IMessageHandler +{ + public NBTTagCompound tagCompound; + + /** + * @param tagCompound + */ + public PacketSendPlayerInfo(NBTTagCompound tagCompound) + { + this.tagCompound = tagCompound; + } + + /** + * + */ + public PacketSendPlayerInfo() + {} + + /** + * @param message + * @param ctx + * @return + */ + @Override + public IMessage onMessage(PacketSendPlayerInfo message, MessageContext ctx) + { + ScreenHandler.tagCache = message.tagCompound; + return null; + } + + /** + * @param buf + */ + @Override + public void fromBytes(ByteBuf buf) + { + tagCompound = ByteBufUtils.readTag(buf); + } + + /** + * @param buf + */ + @Override + public void toBytes(ByteBuf buf) + { + ByteBufUtils.writeTag(buf, tagCompound); + } +} -- cgit v1.2.3