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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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 { @@ -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);

Loading…
Cancel
Save