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();
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);

View File

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