From d060269d882fa450ce8d58b463577a8a8b8eace2 Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Thu, 21 Jan 2021 21:20:21 -0800 Subject: Make sure the onServerTick event is actually called. --- src/main/java/gregtech/common/GT_Proxy.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/GT_Proxy.java b/src/main/java/gregtech/common/GT_Proxy.java index c94ad9a33d..181dc9fe2b 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -116,6 +116,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; import java.util.stream.Collectors; +import java.util.concurrent.locks.ReentrantLock; import static gregtech.api.enums.GT_Values.debugEntityCramming; @@ -256,6 +257,10 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public static Map oreDictBurnTimes = new HashMap<>(); + // Locking + public static ReentrantLock TICK_LOCK = new ReentrantLock(); + + static { oreDictBurnTimes.put("dustTinyWood", 11); oreDictBurnTimes.put("dustTinySodium", 44); @@ -1324,6 +1329,14 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { @SubscribeEvent public void onServerTickEvent(TickEvent.ServerTickEvent aEvent) { + if (aEvent.side.isServer()) { + if (aEvent.phase == TickEvent.Phase.START) { + TICK_LOCK.lock(); + } else { + TICK_LOCK.unlock(); + } + } + } @SubscribeEvent -- cgit