diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java index acb2d0865..84a60d265 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java @@ -125,6 +125,9 @@ public class BeltTileEntity extends KineticTileEntity { BeltMovementHandler.transportEntity(this, entity, info); }); toRemove.forEach(passengers::remove); + + if (blockLight == -1) + updateLight(); } @Override @@ -216,7 +219,7 @@ public class BeltTileEntity extends KineticTileEntity { if (!clientPacket) return; - updateLight(); + if (casingBefore == casing) return; requestModelDataUpdate(); @@ -484,7 +487,12 @@ public class BeltTileEntity extends KineticTileEntity { } private void updateLight() { - skyLight = (byte) world.getLightLevel(LightType.SKY, pos); - blockLight = (byte) world.getLightLevel(LightType.BLOCK, pos); + if (world != null) { + skyLight = (byte) world.getLightLevel(LightType.SKY, pos); + blockLight = (byte) world.getLightLevel(LightType.BLOCK, pos); + } else { + skyLight = -1; + blockLight = -1; + } } } diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/InstancedModel.java b/src/main/java/com/simibubi/create/foundation/render/instancing/InstancedModel.java index b6b70e6e2..7253675dd 100644 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/InstancedModel.java +++ b/src/main/java/com/simibubi/create/foundation/render/instancing/InstancedModel.java @@ -92,8 +92,8 @@ public abstract class InstancedModel extends BufferedMod keys.get(i).index--; } - markIndexChanged(index - 1); maxIndexChanged = keys.size() - 1; + markIndexChanged(Math.min(maxIndexChanged, index)); key.invalidate(); }