This commit is contained in:
pahimar 2015-02-05 16:52:29 -05:00
parent 1988ba49c1
commit 0695041e65
3 changed files with 54 additions and 9 deletions

View file

@ -48,7 +48,14 @@ public class MessageTileCalcinator implements IMessage, IMessageHandler<MessageT
this.state = buf.readByte();
int customNameLength = buf.readInt();
this.customName = new String(buf.readBytes(customNameLength).array());
this.ownerUUID = new UUID(buf.readLong(), buf.readLong());
if (buf.readBoolean())
{
this.ownerUUID = new UUID(buf.readLong(), buf.readLong());
}
else
{
this.ownerUUID = null;
}
this.leftStackSize = buf.readByte();
this.leftStackMeta = buf.readByte();
this.rightStackSize = buf.readByte();
@ -65,8 +72,16 @@ public class MessageTileCalcinator implements IMessage, IMessageHandler<MessageT
buf.writeByte(state);
buf.writeInt(customName.length());
buf.writeBytes(customName.getBytes());
buf.writeLong(ownerUUID.getMostSignificantBits());
buf.writeLong(ownerUUID.getLeastSignificantBits());
if (ownerUUID != null)
{
buf.writeBoolean(true);
buf.writeLong(ownerUUID.getMostSignificantBits());
buf.writeLong(ownerUUID.getLeastSignificantBits());
}
else
{
buf.writeBoolean(false);
}
buf.writeByte(leftStackSize);
buf.writeByte(leftStackMeta);
buf.writeByte(rightStackSize);

View file

@ -63,7 +63,14 @@ public class MessageTileEntityAludel implements IMessage, IMessageHandler<Messag
this.state = buf.readByte();
int customNameLength = buf.readInt();
this.customName = new String(buf.readBytes(customNameLength).array());
this.ownerUUID = new UUID(buf.readLong(), buf.readLong());
if (buf.readBoolean())
{
this.ownerUUID = new UUID(buf.readLong(), buf.readLong());
}
else
{
this.ownerUUID = null;
}
this.itemId = buf.readInt();
this.metaData = buf.readInt();
this.stackSize = buf.readInt();
@ -80,8 +87,16 @@ public class MessageTileEntityAludel implements IMessage, IMessageHandler<Messag
buf.writeByte(state);
buf.writeInt(customName.length());
buf.writeBytes(customName.getBytes());
buf.writeLong(ownerUUID.getMostSignificantBits());
buf.writeLong(ownerUUID.getLeastSignificantBits());
if (ownerUUID != null)
{
buf.writeBoolean(true);
buf.writeLong(ownerUUID.getMostSignificantBits());
buf.writeLong(ownerUUID.getLeastSignificantBits());
}
else
{
buf.writeBoolean(false);
}
buf.writeInt(itemId);
buf.writeInt(metaData);
buf.writeInt(stackSize);

View file

@ -47,7 +47,14 @@ public class MessageTileEntityGlassBell implements IMessage, IMessageHandler<Mes
this.state = buf.readByte();
int customNameLength = buf.readInt();
this.customName = new String(buf.readBytes(customNameLength).array());
this.ownerUUID = new UUID(buf.readLong(), buf.readLong());
if (buf.readBoolean())
{
this.ownerUUID = new UUID(buf.readLong(), buf.readLong());
}
else
{
this.ownerUUID = null;
}
outputItemStack = ByteBufUtils.readItemStack(buf);
}
@ -61,8 +68,16 @@ public class MessageTileEntityGlassBell implements IMessage, IMessageHandler<Mes
buf.writeByte(state);
buf.writeInt(customName.length());
buf.writeBytes(customName.getBytes());
buf.writeLong(ownerUUID.getMostSignificantBits());
buf.writeLong(ownerUUID.getLeastSignificantBits());
if (ownerUUID != null)
{
buf.writeBoolean(true);
buf.writeLong(ownerUUID.getMostSignificantBits());
buf.writeLong(ownerUUID.getLeastSignificantBits());
}
else
{
buf.writeBoolean(false);
}
ByteBufUtils.writeItemStack(buf, outputItemStack);
}