diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index ba456e29..93fc2b19 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -287,10 +287,16 @@ public enum ForgeManager implements Runnable { for (int i = 0; i < workOrder.slots_used; ++i) { Item forged_item = forgeItem(workOrder); + + // Add item to in-memory caches + ForgeManager.inMemoryItemLookup.put(forged_item.objectUUID, forged_item); - workOrder.cooking.add(forged_item); + ForgeManager.vendorItemLookup.computeIfAbsent(workOrder.vendor, k -> new ArrayList<>()); + + ForgeManager.vendorItemLookup.get(workOrder.vendor).add(forged_item); vendorItemLookup.get(workOrder.vendor).add(forged_item); + ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor).add(workOrder); Logger.info("Forging item: " + forged_item.objectUUID + " (" + forged_item.templateID + ") " + forged_item.template.item_base_name); workOrder.total_produced = workOrder.total_produced + 1; diff --git a/src/engine/loot/WorkOrder.java b/src/engine/loot/WorkOrder.java index adb0de6c..0cae3497 100644 --- a/src/engine/loot/WorkOrder.java +++ b/src/engine/loot/WorkOrder.java @@ -9,14 +9,12 @@ package engine.loot; import engine.mbEnums; -import engine.objects.Item; import engine.objects.NPC; import java.time.Duration; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; -import java.util.ArrayList; import java.util.HashMap; import java.util.concurrent.Delayed; import java.util.concurrent.TimeUnit; @@ -40,8 +38,6 @@ public class WorkOrder implements Delayed { public boolean runCompleted = false; public boolean runCanceled = false; - public ArrayList cooking = new ArrayList<>(); - public WorkOrder() { }