Browse Source

Error logging added

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

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

@ -17,6 +17,7 @@ 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;
@ -126,12 +127,17 @@ public class ItemProductionMsg extends ClientNetMsg {
writer.put((byte) 1); writer.put((byte) 1);
Item item; Item item;
if (this.itemUUID > 0) if (this.itemUUID > 0)
item = Item.getFromCache(this.itemUUID); item = Item.getFromCache(this.itemUUID);
else else
item = ForgeManager.inMemoryItemLookup.get(this.itemUUID); item = ForgeManager.inMemoryItemLookup.get(this.itemUUID);
Item.serializeForClientMsgWithoutSlot(item, writer); if (item == null)
Logger.error("Null item serialized");
else
Item.serializeForClientMsgWithoutSlot(item, writer);
writer.putInt(building.getStrongboxValue()); writer.putInt(building.getStrongboxValue());
writer.putInt(0); writer.putInt(0);
writer.putInt(0); writer.putInt(0);
@ -149,7 +155,10 @@ public class ItemProductionMsg extends ClientNetMsg {
else else
item = ForgeManager.inMemoryItemLookup.get(this.itemUUID); item = ForgeManager.inMemoryItemLookup.get(this.itemUUID);
Item.serializeForClientMsgWithoutSlot(item, writer); if (item == null)
Logger.error("Null item serialized");
else
Item.serializeForClientMsgWithoutSlot(item, writer);
writer.putInt(building.getStrongboxValue()); writer.putInt(building.getStrongboxValue());
writer.putInt(0); writer.putInt(0);

Loading…
Cancel
Save