From 93aec63f7819e7ad469f82a617c4df264286fda3 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Tue, 16 Apr 2024 15:40:10 -0400 Subject: [PATCH] File reformat --- src/engine/gameManager/ForgeManager.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 839d1ccb..67a5af98 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -65,13 +65,13 @@ public enum ForgeManager implements Runnable { for (Item workOrderItem : workOrder.cooking) { ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, workOrderItem, mbEnums.ProductionActionType.CONFIRM_PRODUCE, true); DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false); - } + } ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor).remove(workOrder); workOrder.runCompleted = true; } - if (workOrder.runCompleted == true) + if (workOrder.runCompleted) continue; // Persist virtual items that were currently cooking @@ -95,7 +95,6 @@ public enum ForgeManager implements Runnable { Thread forgeManager; forgeManager = new Thread(FORGE_MANAGER); - forgeManager.setName("Forge Manager"); forgeManager.start(); } @@ -189,7 +188,7 @@ public enum ForgeManager implements Runnable { // Single item rolls are msg_size of 0; - if (availableSlots > 0 && workOrder.multiple_slot_request == false) + if (availableSlots > 0 && !workOrder.multiple_slot_request) availableSlots = 1; return availableSlots; @@ -321,7 +320,8 @@ public enum ForgeManager implements Runnable { completed_item = DbManager.ItemQueries.PERSIST(workOrderItem); workOrder.vendor.charItemManager.addItemToInventory(completed_item); } - // Remove the fake negativeID virtual item from all collections. + + // Remove the negativeID virtual item from all collections. for (Item memoryItem : toRemove) { workOrder.cooking.remove(memoryItem); @@ -329,8 +329,8 @@ public enum ForgeManager implements Runnable { vendorItemLookup.get(workOrder.vendor).remove(memoryItem); itemWorkOrderLookup.remove(memoryItem); } - } + public static void forgeItems(WorkOrder workOrder) { for (int i = 0; i < workOrder.slots_used; ++i) { @@ -340,7 +340,6 @@ public enum ForgeManager implements Runnable { // Add virtual item to in-memory caches workOrder.cooking.add(forged_item); - inMemoryItemLookup.put(forged_item.objectUUID, forged_item); vendorItemLookup.computeIfAbsent(workOrder.vendor, k -> new ArrayList<>()); vendorItemLookup.get(workOrder.vendor).add(forged_item);