Browse Source

forged items are persisted

combat-2
MagicBot 8 months ago
parent
commit
692ee51608
  1. 9
      src/engine/gameManager/ForgeManager.java

9
src/engine/gameManager/ForgeManager.java

@ -21,6 +21,7 @@ import org.pmw.tinylog.Logger;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Objects;
import java.util.concurrent.BlockingQueue; import java.util.concurrent.BlockingQueue;
import java.util.concurrent.DelayQueue; import java.util.concurrent.DelayQueue;
import java.util.concurrent.ThreadLocalRandom; import java.util.concurrent.ThreadLocalRandom;
@ -51,15 +52,9 @@ public enum ForgeManager implements Runnable {
Logger.error(e); Logger.error(e);
} }
// Null workOrders should not exist.
// Perhaps log?
if (workOrder == null)
continue;
// Completed or canceled work orders are not re-enqueued // Completed or canceled work orders are not re-enqueued
if (workOrder.runCanceled || workOrder.runCompleted) if (Objects.requireNonNull(workOrder).runCanceled || workOrder.runCompleted)
continue; continue;
// Persist current items that are currently cooking for this // Persist current items that are currently cooking for this

Loading…
Cancel
Save