aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/GT_Proxy.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/gregtech/common/GT_Proxy.java')
-rw-r--r--src/main/java/gregtech/common/GT_Proxy.java13
1 files changed, 13 insertions, 0 deletions
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<String, Integer> 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