aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/features/mining
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-05-11 09:26:49 +0200
committerGitHub <noreply@github.com>2024-05-11 09:26:49 +0200
commit974cc48b355ff020cbb17dc036730616b159b855 (patch)
treea02e270a44c3089724a2a9b8680cb596f3e43814 /src/main/java/at/hannibal2/skyhanni/features/mining
parente24f16df0e8f856d6ec6f81d7707841d27cd9ee8 (diff)
downloadskyhanni-974cc48b355ff020cbb17dc036730616b159b855.tar.gz
skyhanni-974cc48b355ff020cbb17dc036730616b159b855.tar.bz2
skyhanni-974cc48b355ff020cbb17dc036730616b159b855.zip
Backend: code duplication in AxisAlignedBB.getCorners (#1756)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/features/mining')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsWalls.kt16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsWalls.kt b/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsWalls.kt
index 08af9199f..df276f468 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsWalls.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/mining/crystalhollows/CrystalHollowsWalls.kt
@@ -4,6 +4,7 @@ import at.hannibal2.skyhanni.SkyHanniMod
import at.hannibal2.skyhanni.data.IslandType
import at.hannibal2.skyhanni.events.LorenzRenderWorldEvent
import at.hannibal2.skyhanni.utils.LorenzColor
+import at.hannibal2.skyhanni.utils.LorenzUtils.getCorners
import at.hannibal2.skyhanni.utils.LorenzUtils.isInIsland
import at.hannibal2.skyhanni.utils.LorenzVec
import at.hannibal2.skyhanni.utils.RenderUtils
@@ -121,15 +122,10 @@ class CrystalHollowsWalls {
}
private fun drawNucleus(event: LorenzRenderWorldEvent) {
- val southEastCorner = LorenzVec(nucleusBBInflate.minX, nucleusBBInflate.minY, nucleusBBInflate.minZ)
- val southWestCorner = LorenzVec(nucleusBBInflate.minX, nucleusBBInflate.minY, nucleusBBInflate.maxZ)
- val northEastCorner = LorenzVec(nucleusBBInflate.maxX, nucleusBBInflate.minY, nucleusBBInflate.minZ)
- val northWestCorner = LorenzVec(nucleusBBInflate.maxX, nucleusBBInflate.minY, nucleusBBInflate.maxZ)
-
- val southWestTopCorner = LorenzVec(nucleusBBInflate.minX, nucleusBBInflate.maxY, nucleusBBInflate.maxZ)
- val southEastTopCorner = LorenzVec(nucleusBBInflate.minX, nucleusBBInflate.maxY, nucleusBBInflate.minZ)
- val northEastTopCorner = LorenzVec(nucleusBBInflate.maxX, nucleusBBInflate.maxY, nucleusBBInflate.minZ)
- val northWestTopCorner = LorenzVec(nucleusBBInflate.maxX, nucleusBBInflate.maxY, nucleusBBInflate.maxZ)
+ val (southEastCorner, southWestCorner, northEastCorner, northWestCorner) = nucleusBBInflate
+ .getCorners(nucleusBBInflate.minY)
+ val (southWestTopCorner, southEastTopCorner, northEastTopCorner, northWestTopCorner) = nucleusBBInflate
+ .getCorners(nucleusBBInflate.maxY)
RenderUtils.QuadDrawer.draw3D(event.partialTicks) {
draw(
@@ -193,7 +189,7 @@ class CrystalHollowsWalls {
isMinXEsleMaxX: Boolean,
isMinZElseMaxZ: Boolean,
color1: Color,
- color2: Color
+ color2: Color,
) {
val nucleusX = if (isMinXEsleMaxX) nucleusBBExpand.minX else nucleusBBExpand.maxX
val middleX = if (isMinXEsleMaxX) middleX.shiftNX() else middleX.shiftPX()