Init forge support only for valid contracts

This commit is contained in:
2024-04-14 15:17:32 -04:00
parent 48f88ec819
commit 85e5e2a7e3
2 changed files with 5 additions and 4 deletions
@@ -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)) {
+5
View File
@@ -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();