From 9d99a5f96803cb1e2e5bdcd9f6d967d2ca1c994a Mon Sep 17 00:00:00 2001 From: JozsefA Date: Sat, 3 Apr 2021 15:08:06 -0700 Subject: [PATCH] Compromise for render bounding box caching - Recalculating it once per tick is better than doing it every frame. - Only ever doing it once has proven unreliable. --- .../create/content/contraptions/base/KineticTileEntity.java | 5 +++-- .../content/contraptions/relays/belt/BeltTileEntity.java | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java index bdab3e194..cd32c6e3d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java @@ -89,8 +89,10 @@ public abstract class KineticTileEntity extends SmartTileEntity super.tick(); effects.tick(); - if (world.isRemote) + if (world.isRemote) { + cachedBoundingBox = null; // cache the bounding box for every frame between ticks return; + } if (validationCountdown-- <= 0) { validationCountdown = AllConfigs.SERVER.kinetics.kineticValidationFrequency.get(); @@ -220,7 +222,6 @@ public abstract class KineticTileEntity extends SmartTileEntity boolean overStressedBefore = overStressed; clearKineticInformation(); - cachedBoundingBox = null; // DO NOT READ kinetic information when placed after movement if (wasMoved) { super.read(compound, clientPacket); 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 4fe5b0f48..2aa6807d6 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 @@ -285,7 +285,6 @@ public class BeltTileEntity extends KineticTileEntity implements LightUpdateList public void setController(BlockPos controller) { this.controller = controller; - cachedBoundingBox = null; } public BlockPos getController() {