aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/dulkirmod/features
diff options
context:
space:
mode:
authoringlettronald <inglettronald@gmail.com>2023-06-05 13:54:08 -0500
committeringlettronald <inglettronald@gmail.com>2023-06-05 13:54:08 -0500
commitb220e76e12724a91507e894ac018e1ad6b695c9a (patch)
treeeb1447e419094e71cd39bfd708869ffa091a6864 /src/main/kotlin/dulkirmod/features
parent44daa2779ae9e9462af9b0c19cd6838bf94d165d (diff)
downloadDulkirMod-b220e76e12724a91507e894ac018e1ad6b695c9a.tar.gz
DulkirMod-b220e76e12724a91507e894ac018e1ad6b695c9a.tar.bz2
DulkirMod-b220e76e12724a91507e894ac018e1ad6b695c9a.zip
archer highlight impl
Diffstat (limited to 'src/main/kotlin/dulkirmod/features')
-rw-r--r--src/main/kotlin/dulkirmod/features/dungeons/ArcherHighlight.kt40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/main/kotlin/dulkirmod/features/dungeons/ArcherHighlight.kt b/src/main/kotlin/dulkirmod/features/dungeons/ArcherHighlight.kt
new file mode 100644
index 0000000..9da6d4a
--- /dev/null
+++ b/src/main/kotlin/dulkirmod/features/dungeons/ArcherHighlight.kt
@@ -0,0 +1,40 @@
+package dulkirmod.features.dungeons
+
+import com.google.common.eventbus.Subscribe
+import dulkirmod.DulkirMod.Companion.mc
+import dulkirmod.config.DulkirConfig
+import dulkirmod.utils.ScoreBoardUtils
+import dulkirmod.utils.TabListUtils
+import dulkirmod.utils.WorldRenderUtils
+import ibxm.Player
+import net.minecraft.entity.player.EntityPlayer
+import net.minecraftforge.client.event.RenderLivingEvent
+import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
+import java.awt.Color
+
+object ArcherHighlight {
+
+ @SubscribeEvent
+ fun onRenderLiving(event: RenderLivingEvent.Post<*>) {
+ if (!DulkirConfig.archerBox) return
+ if (TabListUtils.area != "Dungeon") return
+ if (!ScoreBoardUtils.isInM7 && !DulkirConfig.archerBoxEverywhere) return
+ if (event.entity !is EntityPlayer) return
+ val name = event.entity.name ?: return
+ if (name != TabListUtils.archerName) return
+ if (mc.thePlayer.positionVector.yCoord > 45 && !DulkirConfig.archerBoxEverywhere) return
+ if (mc.thePlayer.name == name) return
+ val (x, y, z) = WorldRenderUtils.fixRenderPos(event.x, event.y, event.z)
+ WorldRenderUtils.drawCustomBox(
+ x - .5,
+ 1.0,
+ y,
+ event.entity.height.toDouble(),
+ z - .5,
+ 1.0,
+ DulkirConfig.archBoxColor.toJavaColor(),
+ 3f,
+ phase = false
+ )
+ }
+} \ No newline at end of file