aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt
diff options
context:
space:
mode:
authoringlettronald <inglettronald@gmail.com>2023-05-19 05:37:57 -0500
committeringlettronald <inglettronald@gmail.com>2023-05-19 05:37:57 -0500
commitd4be68fd8bf4e14ae7064f15215afabe09d191d5 (patch)
treeaf265b14c42456cbe6f961729b05ef0123410443 /src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt
parent170c6504bdb949c5dd133514b3db91823169cbad (diff)
downloadDulkirMod-d4be68fd8bf4e14ae7064f15215afabe09d191d5.tar.gz
DulkirMod-d4be68fd8bf4e14ae7064f15215afabe09d191d5.tar.bz2
DulkirMod-d4be68fd8bf4e14ae7064f15215afabe09d191d5.zip
initial commit
Diffstat (limited to 'src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt')
-rw-r--r--src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt b/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt
new file mode 100644
index 0000000..2489bba
--- /dev/null
+++ b/src/main/kotlin/dulkirmod/features/rift/SteakDisplay.kt
@@ -0,0 +1,43 @@
+package dulkirmod.features.rift
+
+import dulkirmod.config.DulkirConfig
+import dulkirmod.utils.TabListUtils
+import dulkirmod.utils.Utils
+import dulkirmod.utils.WorldRenderUtils
+import net.minecraft.entity.item.EntityArmorStand
+import net.minecraftforge.client.event.RenderLivingEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import java.awt.Color
+
+object SteakDisplay {
+ private const val char = "҉"
+
+ @SubscribeEvent
+ fun onRenderLiving(event: RenderLivingEvent.Post<*>) {
+ if (!DulkirConfig.steakDisplay) return
+ if (TabListUtils.area != "The Rift") return
+
+ if (event.entity is EntityArmorStand && event.entity.hasCustomName()) {
+ val name = Utils.stripColorCodes(event.entity.customNameTag)
+ val x =
+ event.entity.lastTickPosX + (event.entity.posX - event.entity.lastTickPosX) * WorldRenderUtils.partialTicks
+ val y =
+ event.entity.lastTickPosY + (event.entity.posY - event.entity.lastTickPosY) * WorldRenderUtils.partialTicks
+ val z =
+ event.entity.lastTickPosZ + (event.entity.posZ - event.entity.lastTickPosZ) * WorldRenderUtils.partialTicks
+ if (name.contains(char)) {
+ WorldRenderUtils.drawCustomBox(
+ x - .5,
+ 1.0,
+ y - 2,
+ 1.5,
+ z - .5,
+ 1.0,
+ Color(15, 247, 236, 255),
+ 3f,
+ phase = false
+ )
+ }
+ }
+ }
+} \ No newline at end of file