Browse Source

File reformat

combat-2
MagicBot 7 months ago
parent
commit
93aec63f78
  1. 13
      src/engine/gameManager/ForgeManager.java

13
src/engine/gameManager/ForgeManager.java

@ -65,13 +65,13 @@ public enum ForgeManager implements Runnable {
for (Item workOrderItem : workOrder.cooking) { for (Item workOrderItem : workOrder.cooking) {
ItemProductionMsg outMsg = new ItemProductionMsg(workOrder.vendor.building, workOrder.vendor, workOrderItem, mbEnums.ProductionActionType.CONFIRM_PRODUCE, true); 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); DispatchMessage.dispatchMsgToInterestArea(workOrder.vendor, outMsg, mbEnums.DispatchChannel.SECONDARY, 700, false, false);
} }
ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor).remove(workOrder); ForgeManager.vendorWorkOrderLookup.get(workOrder.vendor).remove(workOrder);
workOrder.runCompleted = true; workOrder.runCompleted = true;
} }
if (workOrder.runCompleted == true) if (workOrder.runCompleted)
continue; continue;
// Persist virtual items that were currently cooking // Persist virtual items that were currently cooking
@ -95,7 +95,6 @@ public enum ForgeManager implements Runnable {
Thread forgeManager; Thread forgeManager;
forgeManager = new Thread(FORGE_MANAGER); forgeManager = new Thread(FORGE_MANAGER);
forgeManager.setName("Forge Manager"); forgeManager.setName("Forge Manager");
forgeManager.start(); forgeManager.start();
} }
@ -189,7 +188,7 @@ public enum ForgeManager implements Runnable {
// Single item rolls are msg_size of 0; // 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; availableSlots = 1;
return availableSlots; return availableSlots;
@ -321,7 +320,8 @@ public enum ForgeManager implements Runnable {
completed_item = DbManager.ItemQueries.PERSIST(workOrderItem); completed_item = DbManager.ItemQueries.PERSIST(workOrderItem);
workOrder.vendor.charItemManager.addItemToInventory(completed_item); 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) { for (Item memoryItem : toRemove) {
workOrder.cooking.remove(memoryItem); workOrder.cooking.remove(memoryItem);
@ -329,8 +329,8 @@ public enum ForgeManager implements Runnable {
vendorItemLookup.get(workOrder.vendor).remove(memoryItem); vendorItemLookup.get(workOrder.vendor).remove(memoryItem);
itemWorkOrderLookup.remove(memoryItem); itemWorkOrderLookup.remove(memoryItem);
} }
} }
public static void forgeItems(WorkOrder workOrder) { public static void forgeItems(WorkOrder workOrder) {
for (int i = 0; i < workOrder.slots_used; ++i) { 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 // Add virtual item to in-memory caches
workOrder.cooking.add(forged_item); workOrder.cooking.add(forged_item);
inMemoryItemLookup.put(forged_item.objectUUID, forged_item); inMemoryItemLookup.put(forged_item.objectUUID, forged_item);
vendorItemLookup.computeIfAbsent(workOrder.vendor, k -> new ArrayList<>()); vendorItemLookup.computeIfAbsent(workOrder.vendor, k -> new ArrayList<>());
vendorItemLookup.get(workOrder.vendor).add(forged_item); vendorItemLookup.get(workOrder.vendor).add(forged_item);

Loading…
Cancel
Save