diff options
-rw-r--r-- | src/main/java/tectech/thing/block/TileEntityForgeOfGods.java | 21 |
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 |