Added id to workOrder

This commit is contained in:
2023-09-13 13:09:31 -04:00
parent 8c2adb760c
commit a0066bce20
2 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -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<WorkOrder> workQueue = new DelayQueue();
private final BlockingQueue<WorkOrder> workQueue = new DelayQueue();
public static final AtomicInteger workOrder = new AtomicInteger(0);
@Override
public void run() {
+3
View File
@@ -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;
}