Fix 32-bit crapness in TankLayerScan.

This commit is contained in:
Sunstrike committed 2013-10-17 20:54:27 +01:00
1 parent a3a8ba0158
commit 1b2dda8316
1 file changed
+3 -1
@@ -10,6 +10,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagIntArray;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.TileEntity;
import scala.compat.Platform$;
import tconstruct.TConstruct;
import tconstruct.library.util.CoordTuple;
import tconstruct.library.util.CoordTupleSort;
@@ -37,7 +38,7 @@ public class TankLayerScan extends LogicComponent
protected CoordTuple returnStone;
private static boolean debug = false;
private static final int MAX_LAYER_RECURSION_DEPTH = 3500;
private static int MAX_LAYER_RECURSION_DEPTH = System.getProperty("os.arch").equals("amd64") ? 4000 : 2000; // Recursion causes overflows on 32-bit, so reduce if not 64-bit
public TankLayerScan(TileEntity te, Block... ids)
{
@@ -50,6 +51,7 @@ public class TankLayerScan extends LogicComponent
validAirCoords.add(new int[] { -1, 0 });
validAirCoords.add(new int[] { 0, 1 });
validAirCoords.add(new int[] { 0, -1 });
//TConstruct.logger.info("Using recursion size " + MAX_LAYER_RECURSION_DEPTH + " on JVM arch " + System.getProperty("os.arch"));
}
public void checkValidStructure ()