diff options
| author | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-05-24 15:50:07 -0400 |
|---|---|---|
| committer | bculkin2442 <bjculkin@mix.wvu.edu> | 2018-05-24 15:50:07 -0400 |
| commit | 4f7ad220df0438b6f3382110577b53f29da46453 (patch) | |
| tree | 07d5e7c812721753cdbe3df7226dad5dc3802c29 /src/main/java/darkknight/jewelrycraft/network/PacketSendServerPlayerInfo.java | |
| parent | 01c8701b68986ccfa83e902515716838d6829311 (diff) | |
Update of all changes
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/network/PacketSendServerPlayerInfo.java')
| -rwxr-xr-x[-rw-r--r--] | src/main/java/darkknight/jewelrycraft/network/PacketSendServerPlayerInfo.java | 119 |
1 files changed, 61 insertions, 58 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/network/PacketSendServerPlayerInfo.java b/src/main/java/darkknight/jewelrycraft/network/PacketSendServerPlayerInfo.java index afefb65..da18c17 100644..100755 --- a/src/main/java/darkknight/jewelrycraft/network/PacketSendServerPlayerInfo.java +++ b/src/main/java/darkknight/jewelrycraft/network/PacketSendServerPlayerInfo.java @@ -10,62 +10,65 @@ import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
-public class PacketSendServerPlayerInfo implements IMessage, IMessageHandler<PacketSendServerPlayerInfo, IMessage>
-{
- public NBTTagCompound tagCompound;
- public String curse, action;
-
- /**
- * @param tagCompound
- */
- public PacketSendServerPlayerInfo(String action, String curse, NBTTagCompound tagCompound)
- {
- this.tagCompound = tagCompound;
- this.curse = curse;
- this.action = action;
- }
-
- /**
- *
- */
- public PacketSendServerPlayerInfo()
- {}
-
- /**
- * @param message
- * @param ctx
- * @return
- */
- @Override
- public IMessage onMessage(PacketSendServerPlayerInfo message, MessageContext ctx)
- {
- EntityPlayerMP serverPlayer = ctx.getServerHandler().playerEntity;
- NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(serverPlayer, Variables.MODID);
- playerInfo.setInteger(message.curse, message.action.equals("remove") ? 0 : 1);
- playerInfo.setInteger("activeCurses", message.tagCompound.getInteger("activeCurses"));
- System.out.println(message.action + " " + message.curse + " " + message.tagCompound.getInteger(curse) + " " + message.tagCompound.getInteger("activeCurses"));
- return null;
- }
-
- /**
- * @param buf
- */
- @Override
- public void fromBytes(ByteBuf buf)
- {
- tagCompound = ByteBufUtils.readTag(buf);
- curse = ByteBufUtils.readUTF8String(buf);
- action = ByteBufUtils.readUTF8String(buf);
- }
-
- /**
- * @param buf
- */
- @Override
- public void toBytes(ByteBuf buf)
- {
- ByteBufUtils.writeTag(buf, tagCompound);
- ByteBufUtils.writeUTF8String(buf, curse);
- ByteBufUtils.writeUTF8String(buf, action);
- }
+public class PacketSendServerPlayerInfo implements IMessage,
+ IMessageHandler<PacketSendServerPlayerInfo, IMessage> {
+ public NBTTagCompound tagCompound;
+ public String curse, action;
+
+ /**
+ * @param tagCompound
+ */
+ public PacketSendServerPlayerInfo(String action, String curse,
+ NBTTagCompound tagCompound) {
+ this.tagCompound = tagCompound;
+ this.curse = curse;
+ this.action = action;
+ }
+
+ /**
+ *
+ */
+ public PacketSendServerPlayerInfo() {
+ }
+
+ /**
+ * @param message
+ * @param ctx
+ * @return
+ */
+ @Override
+ public IMessage onMessage(PacketSendServerPlayerInfo message,
+ MessageContext ctx) {
+ EntityPlayerMP serverPlayer = ctx.getServerHandler().playerEntity;
+ NBTTagCompound playerInfo = PlayerUtils
+ .getModPlayerPersistTag(serverPlayer, Variables.MODID);
+ playerInfo.setInteger(message.curse,
+ message.action.equals("remove") ? 0 : 1);
+ playerInfo.setInteger("activeCurses",
+ message.tagCompound.getInteger("activeCurses"));
+ System.out.println(message.action + " " + message.curse + " "
+ + message.tagCompound.getInteger(curse) + " "
+ + message.tagCompound.getInteger("activeCurses"));
+ return null;
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void fromBytes(ByteBuf buf) {
+ tagCompound = ByteBufUtils.readTag(buf);
+ curse = ByteBufUtils.readUTF8String(buf);
+ action = ByteBufUtils.readUTF8String(buf);
+ }
+
+ /**
+ * @param buf
+ */
+ @Override
+ public void toBytes(ByteBuf buf) {
+ ByteBufUtils.writeTag(buf, tagCompound);
+ ByteBufUtils.writeUTF8String(buf, curse);
+ ByteBufUtils.writeUTF8String(buf, action);
+ }
}
|
