Fix crash extending belts

This commit is contained in:
Jozufozu 2022-01-11 13:43:04 -08:00
parent a666f24ee0
commit 541e5bd6ae

View file

@ -234,7 +234,9 @@ public class BeltTileEntity extends KineticTileEntity {
beltLength = compound.getInt("Length"); beltLength = compound.getInt("Length");
if (prevBeltLength != beltLength) { if (prevBeltLength != beltLength) {
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> { DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> {
lighter = null; if (lighter != null) {
lighter.initializeLight();
}
}); });
} }
} }
@ -593,11 +595,6 @@ public class BeltTileEntity extends KineticTileEntity {
GridAlignedBB beltVolume = getVolume(); GridAlignedBB beltVolume = getVolume();
if (beltVolume.intersects(changed)) { if (beltVolume.intersects(changed)) {
if (light == null) {
initializeLight();
return;
}
if (type == LightLayer.BLOCK) if (type == LightLayer.BLOCK)
updateBlockLight(); updateBlockLight();