aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod
diff options
context:
space:
mode:
authoringlettronald <inglettronald@gmail.com>2023-06-05 11:23:18 -0500
committeringlettronald <inglettronald@gmail.com>2023-06-05 11:24:47 -0500
commit27916b0a2cd045c61c156cb0439cb8ed9cf656f7 (patch)
treece790767b43bd526b2d1735a63c5cab07eae1a35 /src/main/kotlin/dulkirmod
parent860045f63761c91247f80f17ddbad8bfa365aa0f (diff)
downloadDulkirMod-27916b0a2cd045c61c156cb0439cb8ed9cf656f7.tar.gz
DulkirMod-27916b0a2cd045c61c156cb0439cb8ed9cf656f7.tar.bz2
DulkirMod-27916b0a2cd045c61c156cb0439cb8ed9cf656f7.zip
updated some rendering code
Diffstat (limited to 'src/main/kotlin/dulkirmod')
-rw-r--r--src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt10
-rw-r--r--src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt24
-rw-r--r--src/main/kotlin/dulkirmod/features/rift/IchorHighlight.kt5
-rw-r--r--src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt5
-rw-r--r--src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt10
5 files changed, 9 insertions, 45 deletions
diff --git a/src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt b/src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt
index 21630e7..edf3114 100644
--- a/src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt
+++ b/src/main/kotlin/dulkirmod/features/BlazeSlayerFeatures.kt
@@ -21,10 +21,7 @@ object BlazeSlayerFeatures {
if (DulkirConfig.attunementDisplay) {
if (event.entity is EntityArmorStand && event.entity.hasCustomName()) {
val name = Utils.stripColorCodes(event.entity.customNameTag)
- val newPos = WorldRenderUtils.fixRenderPos(event.x, event.y, event.z)
- val x = newPos[0]
- val y = newPos[1]
- val z = newPos[2]
+ val (x, y, z) = WorldRenderUtils.fixRenderPos(event.x, event.y, event.z)
when {
name.contains("CRYSTAL ♨") -> {
WorldRenderUtils.drawCustomBox(
@@ -89,10 +86,7 @@ object BlazeSlayerFeatures {
if (event.entity is EntityArmorStand && event.entity.hasCustomName()) {
val name = Utils.stripColorCodes(event.entity.customNameTag)
- val newPos = WorldRenderUtils.fixRenderPos(event.x, event.y, event.z)
- val x = newPos[0]
- val y = newPos[1]
- val z = newPos[2]
+ val (x, y, z) = WorldRenderUtils.fixRenderPos(event.x, event.y, event.z)
if (name.contains(minibosses)) {
WorldRenderUtils.drawCustomBox(
diff --git a/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt b/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt
index 5edde33..8c891ba 100644
--- a/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt
+++ b/src/main/kotlin/dulkirmod/features/MemoryLeakFix.kt
@@ -48,28 +48,4 @@ object MemoryLeakFix {
world.removeEntityFromWorld(it.entityId)
}
}
-
- @SubscribeEvent
- fun displayBlankStands(event: RenderLivingEvent.Post<*>) {
- if (!DulkirConfig.debugStandRemoval) return
- if (event.entity !is EntityArmorStand) return
- if (event.entity.hasCustomName()) return
- if (event.entity.inventory.any{slot -> slot != null}) return
- val pos = WorldRenderUtils.fixRenderPos(event.x, event.y, event.z)
- val x = pos[0]
- val y = pos[1]
- val z = pos[2]
-
- WorldRenderUtils.drawCustomBox(
- x - .5,
- 1.0,
- y - .5,
- 1.0,
- z - .5,
- 1.0,
- Color(15, 247, 236, 255),
- 3f,
- phase = true
- )
- }
} \ No newline at end of file
diff --git a/src/main/kotlin/dulkirmod/features/rift/IchorHighlight.kt b/src/main/kotlin/dulkirmod/features/rift/IchorHighlight.kt
index d18413d..580a8b9 100644
--- a/src/main/kotlin/dulkirmod/features/rift/IchorHighlight.kt
+++ b/src/main/kotlin/dulkirmod/features/rift/IchorHighlight.kt
@@ -19,10 +19,7 @@ object IchorHighlight {
if (TabListUtils.area != "The Rift") return
val entity = event.entity
- val newPos = WorldRenderUtils.fixRenderPos(event.x, event.y, event.z)
- val x = newPos[0]
- val y = newPos[1] + 3
- val z = newPos[2]
+ val (x, y, z) = WorldRenderUtils.fixRenderPos(event.x, event.y + 3, event.z)
if (entity is EntityArmorStand) {
if (entity.getEquipmentInSlot(4) != null && entity.getEquipmentInSlot(4).item === Items.skull) {
diff --git a/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt b/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt
index 877474c..171dc7a 100644
--- a/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt
+++ b/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt
@@ -19,10 +19,7 @@ object SteakDisplay {
if (event.entity is EntityArmorStand && event.entity.hasCustomName()) {
val name = Utils.stripColorCodes(event.entity.customNameTag)
- val newPos = WorldRenderUtils.fixRenderPos(event.x, event.y, event.z)
- val x = newPos[0]
- val y = newPos[1]
- val z = newPos[2]
+ val (x, y, z) = WorldRenderUtils.fixRenderPos(event.x, event.y, event.z)
if (name.contains(char) && name.contains("Vampire Boss")) {
WorldRenderUtils.drawCustomBox(
x - .5,
diff --git a/src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt b/src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt
index 7cb00f7..0728f38 100644
--- a/src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt
+++ b/src/main/kotlin/dulkirmod/utils/WorldRenderUtils.kt
@@ -174,20 +174,20 @@ class WorldRenderUtils {
GlStateManager.popMatrix()
}
- fun getRenderX() : Double {
+ private fun getRenderX() : Double {
return (mc.renderManager as AccessorRenderManager).renderX
}
- fun getRenderY() : Double {
+ private fun getRenderY() : Double {
return (mc.renderManager as AccessorRenderManager).renderY
}
- fun getRenderZ() : Double {
+ private fun getRenderZ() : Double {
return (mc.renderManager as AccessorRenderManager).renderZ
}
- fun fixRenderPos(x: Double, y: Double, z: Double) : Array<Double> {
- return arrayOf(x + getRenderX(), y + getRenderY(), z + getRenderZ())
+ fun fixRenderPos(x: Double, y: Double, z: Double) : Triple<Double, Double, Double> {
+ return Triple(x + getRenderX(), y + getRenderY(), z + getRenderZ())
}
}
} \ No newline at end of file