From 692ee51608c94ebd8ecfc7b0815d6a9111601054 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sun, 14 Apr 2024 16:31:05 -0400 Subject: [PATCH] forged items are persisted --- src/engine/gameManager/ForgeManager.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index 5b699ef4..3f73fe54 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -21,6 +21,7 @@ import org.pmw.tinylog.Logger; import java.util.ArrayList; import java.util.HashMap; +import java.util.Objects; import java.util.concurrent.BlockingQueue; import java.util.concurrent.DelayQueue; import java.util.concurrent.ThreadLocalRandom; @@ -51,15 +52,9 @@ public enum ForgeManager implements Runnable { Logger.error(e); } - // Null workOrders should not exist. - // Perhaps log? - - if (workOrder == null) - continue; - // Completed or canceled work orders are not re-enqueued - if (workOrder.runCanceled || workOrder.runCompleted) + if (Objects.requireNonNull(workOrder).runCanceled || workOrder.runCompleted) continue; // Persist current items that are currently cooking for this