Browse Source

Serialization update

combat-2
MagicBot 8 months ago
parent
commit
250afe3bba
  1. 12
      src/engine/net/client/msg/ItemProductionMsg.java

12
src/engine/net/client/msg/ItemProductionMsg.java

@ -59,8 +59,6 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -59,8 +59,6 @@ public class ItemProductionMsg extends ClientNetMsg {
}
;
public ItemProductionMsg(Building building, NPC vendor, Item item, mbEnums.ProductionActionType actionType, boolean add) {
super(Protocol.ITEMPRODUCTION);
this.actionType = actionType;
@ -126,8 +124,13 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -126,8 +124,13 @@ public class ItemProductionMsg extends ClientNetMsg {
if (!add) {
writer.put((byte) 1);
Item item = Item.getFromCache(this.itemUUID);
if (item != null)
Item item;
if (this.itemUUID > 0)
item = Item.getFromCache(this.itemUUID);
else
item = ForgeManager.inMemoryItemLookup.get(this.itemUUID);
Item.serializeForClientMsgWithoutSlot(item, writer);
writer.putInt(building.getStrongboxValue());
writer.putInt(0);
@ -139,6 +142,7 @@ public class ItemProductionMsg extends ClientNetMsg { @@ -139,6 +142,7 @@ public class ItemProductionMsg extends ClientNetMsg {
writer.putInt(0);
writer.putInt(0);
writer.put((byte) 1);
Item item;
if (this.itemUUID > 0)
item = Item.getFromCache(this.itemUUID);

Loading…
Cancel
Save