aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin')
-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