Browse Source

Serialization work

combat-2
MagicBot 8 months ago
parent
commit
c5dfb3ad81
  1. 9
      src/engine/net/client/msg/ItemProductionMsg.java

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

@ -17,7 +17,6 @@ import engine.net.*;
import engine.objects.Building; import engine.objects.Building;
import engine.objects.Item; import engine.objects.Item;
import engine.objects.NPC; import engine.objects.NPC;
import org.pmw.tinylog.Logger;
import java.util.HashMap; import java.util.HashMap;
@ -129,9 +128,7 @@ public class ItemProductionMsg extends ClientNetMsg {
Item item; Item item;
item = Item.getFromCache(this.itemUUID); // If sent to rolling window adds a new slot. item = Item.getFromCache(this.itemUUID); // If sent to rolling window adds a new slot.
if (item == null) if (item != null)
Logger.error("Null item serialized");
else
Item.serializeForClientMsgWithoutSlot(item, writer); Item.serializeForClientMsgWithoutSlot(item, writer);
writer.putInt(building.getStrongboxValue()); writer.putInt(building.getStrongboxValue());
@ -151,9 +148,7 @@ public class ItemProductionMsg extends ClientNetMsg {
else else
item = ForgeManager.inMemoryItemLookup.get(this.itemUUID); item = ForgeManager.inMemoryItemLookup.get(this.itemUUID);
if (item == null) if (item != null)
Logger.error("Null item serialized");
else
Item.serializeForClientMsgWithoutSlot(item, writer); Item.serializeForClientMsgWithoutSlot(item, writer);
writer.putInt(building.getStrongboxValue()); writer.putInt(building.getStrongboxValue());

Loading…
Cancel
Save