From 16f03e76e82cfbde8f3c355fa1224a3b88472f06 Mon Sep 17 00:00:00 2001 From: Blood-Asp Date: Wed, 26 Oct 2016 20:34:04 +0200 Subject: Allow max 1 crafting sound every 10 ticks to prevent rare crashes. --- src/main/java/gregtech/common/GT_Proxy.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (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 00bc5ab0c1..00ee739ef1 100644 --- a/src/main/java/gregtech/common/GT_Proxy.java +++ b/src/main/java/gregtech/common/GT_Proxy.java @@ -173,6 +173,7 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { public int mPollutionPoisonLimit = 750000; public int mPollutionVegetationLimit = 1000000; public int mPollutionSourRainLimit = 2000000; + public int mTicksUntilNextCraftSound = 0; public double mMagneticraftBonusOutputPercent = 100.0d; private World mUniverse = null; private final String aTextThermalExpansion = "ThermalExpansion"; @@ -1186,10 +1187,12 @@ public abstract class GT_Proxy implements IGT_Mod, IGuiHandler, IFuelHandler { @SubscribeEvent public void onWorldTickEvent(TickEvent.WorldTickEvent aEvent) { + if(aEvent.world.provider.dimensionId == 0) + mTicksUntilNextCraftSound--; if (aEvent.side.isServer()) { if (this.mUniverse == null) { this.mUniverse = aEvent.world; - } + } if (this.isFirstServerWorldTick) { File tSaveDiretory = getSaveDirectory(); if (tSaveDiretory != null) { -- cgit