aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaya <10861407+serenibyss@users.noreply.github.com>2024-12-01 19:12:24 -0600
committerGitHub <noreply@github.com>2024-12-02 01:12:24 +0000
commit8380ef61ad9e688a2d05a9db70aa55b54288fae6 (patch)
treedfa21cb87c22265fdd1597c71605031ba5d0460d
parented2492f3050d3b9a6226b484127c0db6b0923fd9 (diff)
downloadGT5-Unofficial-8380ef61ad9e688a2d05a9db70aa55b54288fae6.tar.gz
GT5-Unofficial-8380ef61ad9e688a2d05a9db70aa55b54288fae6.tar.bz2
GT5-Unofficial-8380ef61ad9e688a2d05a9db70aa55b54288fae6.zip
Add proper render bounding box for Godforge (#3593)
-rw-r--r--src/main/java/tectech/thing/block/TileEntityForgeOfGods.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/main/java/tectech/thing/block/TileEntityForgeOfGods.java b/src/main/java/tectech/thing/block/TileEntityForgeOfGods.java
index 8bb274a878..aac0c245e0 100644
--- a/src/main/java/tectech/thing/block/TileEntityForgeOfGods.java
+++ b/src/main/java/tectech/thing/block/TileEntityForgeOfGods.java
@@ -25,6 +25,7 @@ public class TileEntityForgeOfGods extends TileEntity {
private float rotationSpeed = 10;
private int ringCount = 1;
private float rotAngle = 0, rotAxisX = 1, rotAxisY = 0, rotAxisZ = 0;
+ private AxisAlignedBB renderBoundingBox;
private ForgeOfGodsStarColor starColor = ForgeOfGodsStarColor.DEFAULT;
@@ -51,10 +52,28 @@ public class TileEntityForgeOfGods extends TileEntity {
private static final String STAR_COLOR_TAG = NBT_TAG + "STAR_COLOR";
public static final float BACK_PLATE_DISTANCE = -121.5f, BACK_PLATE_RADIUS = 13f;
+ private static final double RING_RADIUS = 63;
+ private static final double BEAM_LENGTH = 59;
@Override
public AxisAlignedBB getRenderBoundingBox() {
- return INFINITE_EXTENT_AABB;
+ if (renderBoundingBox == null) {
+ double x = this.xCoord;
+ double y = this.yCoord;
+ double z = this.zCoord;
+
+ // This could possibly be made smaller by figuring out the beam direction,
+ // but since this is not always known (set dynamically by the MTE), this
+ // currently just bounds as if the beam is in all 4 directions.
+ renderBoundingBox = AxisAlignedBB.getBoundingBox(
+ x - RING_RADIUS - BEAM_LENGTH,
+ y - RING_RADIUS - BEAM_LENGTH,
+ z - RING_RADIUS - BEAM_LENGTH,
+ x + RING_RADIUS + BEAM_LENGTH + 1,
+ y + RING_RADIUS + BEAM_LENGTH + 1,
+ z + RING_RADIUS + BEAM_LENGTH + 1);
+ }
+ return renderBoundingBox;
}
@Override