diff --git a/src/engine/net/client/msg/ManageNPCMsg.java b/src/engine/net/client/msg/ManageNPCMsg.java index b0c9f5e8..2b54b69d 100644 --- a/src/engine/net/client/msg/ManageNPCMsg.java +++ b/src/engine/net/client/msg/ManageNPCMsg.java @@ -434,10 +434,6 @@ public class ManageNPCMsg extends ClientNetMsg { writer.put((byte) template.modTable);//EffectItemType } - // Sanity check. - - ForgeManager.vendorItemLookup.computeIfAbsent(npc, k -> new ArrayList<>()); // Forge lookup - writer.putInt(ForgeManager.vendorItemLookup.get(npc).size()); for (Item item : ForgeManager.vendorItemLookup.get(npc)) { diff --git a/src/engine/objects/NPC.java b/src/engine/objects/NPC.java index 6fd40f84..7bca7160 100644 --- a/src/engine/objects/NPC.java +++ b/src/engine/objects/NPC.java @@ -869,6 +869,11 @@ public class NPC extends AbstractCharacter { if (this.building != null) NPCManager.slotCharacterInBuilding(this); + // If NPC is a vendor create arraylist for forge + + if (this.contract.isTrainer() == false) + ForgeManager.vendorItemLookup.computeIfAbsent(this, k -> new ArrayList<>()); // Forge lookup + this.symbol = this.contract.getIconID(); this.modTypeTable = this.contract.getNPCModTypeTable(); this.modSuffixTable = this.contract.getNpcModSuffixTable();