aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/common/GT_Proxy.java
diff options
context:
space:
mode:
authorrepo_alt <wvk17@yandex.ru>2021-01-24 17:45:15 +0300
committerrepo_alt <wvk17@yandex.ru>2021-01-24 17:45:15 +0300
commitf67809603608f9c339573aaa9851083efb5047ff (patch)
tree6911032b19397c831908af7356e7ff9868cd3424 /src/main/java/gregtech/common/GT_Proxy.java
parentdf1ccb70a7591e97591aae4b38c367f937d1b363 (diff)
parent260787e8fd025bbbceb68a468138694a8f6cb88c (diff)
downloadGT5-Unofficial-f67809603608f9c339573aaa9851083efb5047ff.tar.gz
GT5-Unofficial-f67809603608f9c339573aaa9851083efb5047ff.tar.bz2
GT5-Unofficial-f67809603608f9c339573aaa9851083efb5047ff.zip
Merge branch 'experimental' of https://github.com/GTNewHorizons/GT5-Unofficial into experimental
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