From ad2cde9d8553ba48c4fca2974ef7eb20c966fc96 Mon Sep 17 00:00:00 2001 From: MagicBot Date: Sat, 11 May 2024 09:16:48 -0400 Subject: [PATCH] Atomic instead of volatile to match counter --- src/engine/net/client/handlers/ItemProductionMsgHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/engine/net/client/handlers/ItemProductionMsgHandler.java b/src/engine/net/client/handlers/ItemProductionMsgHandler.java index 3629105c..febb1df0 100644 --- a/src/engine/net/client/handlers/ItemProductionMsgHandler.java +++ b/src/engine/net/client/handlers/ItemProductionMsgHandler.java @@ -150,7 +150,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { ForgeManager.itemWorkOrderLookup.remove(virtualItem); DbManager.removeFromCache(virtualItem); - workOrder.slots_used.set(workOrder.slots_used.get() - 1); + workOrder.slots_used.decrementAndGet(); // Update workOrder on disk @@ -429,7 +429,7 @@ public class ItemProductionMsgHandler extends AbstractClientMsgHandler { // Slot is no longer allocated to this workOrder. - workOrder.slots_used.set(workOrder.slots_used.get() - 1); + workOrder.slots_used.decrementAndGet(); // Update workOrder on disk