diff --git a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhLodPos.java b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhLodPos.java index 21273d79a..d6d038b74 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/pos/DhLodPos.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/pos/DhLodPos.java @@ -55,8 +55,10 @@ public class DhLodPos implements Comparable // getters // //=========// - public DhLodUnit getX() { return new DhLodUnit(this.detailLevel, this.x); } - public DhLodUnit getZ() { return new DhLodUnit(this.detailLevel, this.z); } + /** gets the X position closest to negative infinity */ + public DhLodUnit getMinX() { return new DhLodUnit(this.detailLevel, this.x); } + /** gets the Z position closest to negative infinity */ + public DhLodUnit getMinZ() { return new DhLodUnit(this.detailLevel, this.z); } // Get the width of this pos, measured in the mc block unit. (i.e. detail 0) public int getBlockWidth() { return this.getWidthAtDetail((byte) 0); } @@ -71,10 +73,10 @@ public class DhLodPos implements Comparable public DhBlockPos2D getCenterBlockPos() { return new DhBlockPos2D( - this.getX().toBlockWidth() + BitShiftUtil.half(this.getBlockWidth()), - this.getZ().toBlockWidth() + BitShiftUtil.half(this.getBlockWidth())); + this.getMinX().toBlockWidth() + BitShiftUtil.half(this.getBlockWidth()), + this.getMinZ().toBlockWidth() + BitShiftUtil.half(this.getBlockWidth())); } - public DhBlockPos2D getCornerBlockPos() { return new DhBlockPos2D(this.getX().toBlockWidth(), this.getZ().toBlockWidth()); } + public DhBlockPos2D getCornerBlockPos() { return new DhBlockPos2D(this.getMinX().toBlockWidth(), this.getMinZ().toBlockWidth()); } /** converts this position to a lower detail level, angled towards the corner position. */ public DhLodPos getCornerLodPos(byte newDetail) diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/RenderBufferHandler.java b/core/src/main/java/com/seibel/distanthorizons/core/render/RenderBufferHandler.java index 6b29df28d..ac06920ff 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/RenderBufferHandler.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/RenderBufferHandler.java @@ -281,8 +281,8 @@ public class RenderBufferHandler implements AutoCloseable if (enableFrustumCulling) { DhLodPos lodBounds = renderSection.pos.getSectionBBoxPos(); - int blockMinX = lodBounds.getX().toBlockWidth(); - int blockMinZ = lodBounds.getZ().toBlockWidth(); + int blockMinX = lodBounds.getMinX().toBlockWidth(); + int blockMinZ = lodBounds.getMinZ().toBlockWidth(); int lodBlockWidth = lodBounds.getBlockWidth(); if (!frustum.intersects(blockMinX, blockMinZ, lodBlockWidth, lodBounds.detailLevel)) {