From 250afe3bbacabf337da07ffa817320ba9ad46208 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 15 Apr 2024 12:41:05 -0400 Subject: [PATCH] Serialization update --- src/engine/net/client/msg/ItemProductionMsg.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/engine/net/client/msg/ItemProductionMsg.java b/src/engine/net/client/msg/ItemProductionMsg.java index 8e7a4d8e..df25ccca 100644 --- a/src/engine/net/client/msg/ItemProductionMsg.java +++ b/src/engine/net/client/msg/ItemProductionMsg.java @@ -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,9 +124,14 @@ public class ItemProductionMsg extends ClientNetMsg { if (!add) { writer.put((byte) 1); - Item item = Item.getFromCache(this.itemUUID); - if (item != null) - Item.serializeForClientMsgWithoutSlot(item, writer); + + 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); writer.putInt(0); @@ -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);