diff options
author | BucketBrigade <138534411+CookieBrigade@users.noreply.github.com> | 2024-11-02 20:02:37 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-03 02:02:37 +0100 |
commit | 8d84f1d1a01802b1d092ef9063578dd7e908ca67 (patch) | |
tree | 5732cc8dc67083213408779ad95677c5d57c6ffe /src/main/java/gregtech/common | |
parent | 43ec017ec01272b613bb59cda0e3846c03d9b8b1 (diff) | |
download | GT5-Unofficial-8d84f1d1a01802b1d092ef9063578dd7e908ca67.tar.gz GT5-Unofficial-8d84f1d1a01802b1d092ef9063578dd7e908ca67.tar.bz2 GT5-Unofficial-8d84f1d1a01802b1d092ef9063578dd7e908ca67.zip |
Reduce Bounding Box allocations (#3447)
Diffstat (limited to 'src/main/java/gregtech/common')
-rw-r--r-- | src/main/java/gregtech/common/tileentities/render/TileEntityBlackhole.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/gregtech/common/tileentities/render/TileEntityBlackhole.java b/src/main/java/gregtech/common/tileentities/render/TileEntityBlackhole.java index d40f425a03..9206e6b1b2 100644 --- a/src/main/java/gregtech/common/tileentities/render/TileEntityBlackhole.java +++ b/src/main/java/gregtech/common/tileentities/render/TileEntityBlackhole.java @@ -9,6 +9,8 @@ import net.minecraft.util.AxisAlignedBB; public class TileEntityBlackhole extends TileEntity { + private AxisAlignedBB boundingBox; + // Should run from 0 to 1, >.5 starts showing changes private float stability = 1; // true = growing, false = shrinking @@ -69,8 +71,11 @@ public class TileEntityBlackhole extends TileEntity { @Override public AxisAlignedBB getRenderBoundingBox() { - return AxisAlignedBB - .getBoundingBox(xCoord - 10, yCoord - 10, zCoord - 10, xCoord + 10, yCoord + 10, zCoord + 10); + if (boundingBox == null) { + boundingBox = AxisAlignedBB + .getBoundingBox(xCoord - 10, yCoord - 10, zCoord - 10, xCoord + 10, yCoord + 10, zCoord + 10); + } + return boundingBox; } public long getStartTime() { |