forked from MagicBane/Server
Init forge support only for valid contracts
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user