From 2c4c997e02343aceebd46ec351c87e162cf558af Mon Sep 17 00:00:00 2001 From: Xander Date: Sun, 17 Sep 2017 15:50:52 +0800 Subject: [PATCH] Prevent race condition causing #4487 & add sanity check for the only other place the fields are updated. --- .../java/mekanism/common/block/BlockTransmitter.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/mekanism/common/block/BlockTransmitter.java b/src/main/java/mekanism/common/block/BlockTransmitter.java index 8e9659c91..27446e95d 100644 --- a/src/main/java/mekanism/common/block/BlockTransmitter.java +++ b/src/main/java/mekanism/common/block/BlockTransmitter.java @@ -62,8 +62,8 @@ public class BlockTransmitter extends Block implements ITileEntityProvider public static AxisAlignedBB[] smallSides = new AxisAlignedBB[7]; public static AxisAlignedBB[] largeSides = new AxisAlignedBB[7]; - public static AxisAlignedBB smallDefault = smallSides[6]; - public static AxisAlignedBB largeDefault = largeSides[6]; + public static AxisAlignedBB smallDefault; + public static AxisAlignedBB largeDefault; static { @@ -82,6 +82,9 @@ public class BlockTransmitter extends Block implements ITileEntityProvider largeSides[4] = new AxisAlignedBB(0.0, 0.25, 0.25, 0.25, 0.75, 0.75); largeSides[5] = new AxisAlignedBB(0.75, 0.25, 0.25, 1.0, 0.75, 0.75); largeSides[6] = new AxisAlignedBB(0.25, 0.25, 0.25, 0.75, 0.75, 0.75); + + smallDefault = smallSides[6]; + largeDefault = largeSides[6]; } public BlockTransmitter() @@ -400,6 +403,10 @@ public class BlockTransmitter extends Block implements ITileEntityProvider { return; } + + if (box == null){ + throw new IllegalStateException("box should not be null"); + } if(tile.getTransmitterType().getSize() == Size.SMALL) {