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.
This commit is contained in:
JozsefA 2021-04-03 15:08:06 -07:00
parent 62b1fe82b7
commit 9d99a5f968
2 changed files with 3 additions and 3 deletions

View file

@ -89,8 +89,10 @@ public abstract class KineticTileEntity extends SmartTileEntity
super.tick(); super.tick();
effects.tick(); effects.tick();
if (world.isRemote) if (world.isRemote) {
cachedBoundingBox = null; // cache the bounding box for every frame between ticks
return; return;
}
if (validationCountdown-- <= 0) { if (validationCountdown-- <= 0) {
validationCountdown = AllConfigs.SERVER.kinetics.kineticValidationFrequency.get(); validationCountdown = AllConfigs.SERVER.kinetics.kineticValidationFrequency.get();
@ -220,7 +222,6 @@ public abstract class KineticTileEntity extends SmartTileEntity
boolean overStressedBefore = overStressed; boolean overStressedBefore = overStressed;
clearKineticInformation(); clearKineticInformation();
cachedBoundingBox = null;
// DO NOT READ kinetic information when placed after movement // DO NOT READ kinetic information when placed after movement
if (wasMoved) { if (wasMoved) {
super.read(compound, clientPacket); super.read(compound, clientPacket);

View file

@ -285,7 +285,6 @@ public class BeltTileEntity extends KineticTileEntity implements LightUpdateList
public void setController(BlockPos controller) { public void setController(BlockPos controller) {
this.controller = controller; this.controller = controller;
cachedBoundingBox = null;
} }
public BlockPos getController() { public BlockPos getController() {