From a0066bce20ae39ab1cafaedeb03c7f49107207e3 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Wed, 13 Sep 2023 13:09:31 -0400 Subject: [PATCH] Added id to workOrder --- src/engine/gameManager/ForgeManager.java | 4 +++- src/engine/loot/WorkOrder.java | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/engine/gameManager/ForgeManager.java b/src/engine/gameManager/ForgeManager.java index d9b0732b..6c536134 100644 --- a/src/engine/gameManager/ForgeManager.java +++ b/src/engine/gameManager/ForgeManager.java @@ -12,12 +12,14 @@ import engine.loot.WorkOrder; import java.util.concurrent.BlockingQueue; import java.util.concurrent.DelayQueue; +import java.util.concurrent.atomic.AtomicInteger; public enum ForgeManager implements Runnable { FORGE_MANAGER; - private BlockingQueue workQueue = new DelayQueue(); + private final BlockingQueue workQueue = new DelayQueue(); + public static final AtomicInteger workOrder = new AtomicInteger(0); @Override public void run() { diff --git a/src/engine/loot/WorkOrder.java b/src/engine/loot/WorkOrder.java index c699df2e..1c54ad7d 100644 --- a/src/engine/loot/WorkOrder.java +++ b/src/engine/loot/WorkOrder.java @@ -8,6 +8,7 @@ package engine.loot; +import engine.gameManager.ForgeManager; import org.jetbrains.annotations.NotNull; import java.util.concurrent.Delayed; @@ -17,6 +18,7 @@ import static java.lang.Math.toIntExact; public class WorkOrder implements Delayed { + public int workOrder; public int npcUUID; public int slotCount; public int itemCount; @@ -27,6 +29,7 @@ public class WorkOrder implements Delayed { public WorkOrder() { + this.workOrder = ForgeManager.workOrder.incrementAndGet(); this.completionTime = System.currentTimeMillis() + 10000; }