From a160fe1b00b564ef6bd1df1cef1a9f99f433612c Mon Sep 17 00:00:00 2001 From: MagicBot Date: Mon, 8 Apr 2024 15:58:48 -0400 Subject: [PATCH] Time recycle update --- src/engine/gameManager/ForgeManager.java | 7 +++---- src/engine/objects/Warehouse.java | 5 ----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index d30e0a99..755d3a19 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -48,18 +48,17 @@ public enum ForgeManager implements Runnable { if (workOrder.total_produced >= workOrder.total_to_produce) { + Logger.info("Workorder has completed: " + workOrder.workOrderID); + workOrder.runCompleted = true; workOrder.vendor.workOrders.remove(workOrder); - - Logger.info("Workorder has completed: " + workOrder.workOrderID); workOrder.vendor.workOrders.remove(workOrder); - continue; } // Resubmit workOrder - workOrder.rollingDuration = System.currentTimeMillis() + 10000; + workOrder.completionTime = System.currentTimeMillis() + workOrder.rollingDuration; workOrder.total_to_produce = workOrder.total_to_produce - 1; workOrders.add(workOrder); diff --git a/src/engine/objects/Warehouse.java b/src/engine/objects/Warehouse.java index bbb1900f..02ea37a1 100644 --- a/src/engine/objects/Warehouse.java +++ b/src/engine/objects/Warehouse.java @@ -616,13 +616,8 @@ public class Warehouse { return true; } - public static void loadAllTransactions(Warehouse warehouse) { - warehouse.transactions = DbManager.WarehouseQueries.GET_TRANSACTIONS_FOR_WAREHOUSE(warehouse.building.getObjectUUID()); - } - public static void AddTransactionToWarehouse(Warehouse warehouse, mbEnums.GameObjectType targetType, int targetUUID, mbEnums.TransactionType transactionType, mbEnums.ResourceType resource, int amount) { - if (!DbManager.WarehouseQueries.CREATE_TRANSACTION(warehouse.building.getObjectUUID(), targetType, targetUUID, transactionType, resource, amount, DateTime.now())) return;