diff options
author | inglettronald <inglettronald@gmail.com> | 2023-06-06 10:15:26 -0500 |
---|---|---|
committer | inglettronald <inglettronald@gmail.com> | 2023-06-06 10:15:26 -0500 |
commit | 2c2d7b7277e8e99412dea3bfceee9627ec9ab80e (patch) | |
tree | c916f178d33f635eabc7ce0a245a87c554f6db2d /src | |
parent | e209c2c0e3148bfec9cae51b5561c0918c88f479 (diff) | |
download | DulkirMod-2c2d7b7277e8e99412dea3bfceee9627ec9ab80e.tar.gz DulkirMod-2c2d7b7277e8e99412dea3bfceee9627ec9ab80e.tar.bz2 DulkirMod-2c2d7b7277e8e99412dea3bfceee9627ec9ab80e.zip |
still broken
Diffstat (limited to 'src')
-rw-r--r-- | src/main/kotlin/dulkirmod/features/dungeons/ArcherHighlight.kt | 65 |
1 files changed, 47 insertions, 18 deletions
diff --git a/src/main/kotlin/dulkirmod/features/dungeons/ArcherHighlight.kt b/src/main/kotlin/dulkirmod/features/dungeons/ArcherHighlight.kt index 9da6d4a..395d363 100644 --- a/src/main/kotlin/dulkirmod/features/dungeons/ArcherHighlight.kt +++ b/src/main/kotlin/dulkirmod/features/dungeons/ArcherHighlight.kt @@ -9,32 +9,61 @@ import dulkirmod.utils.WorldRenderUtils import ibxm.Player import net.minecraft.entity.player.EntityPlayer import net.minecraftforge.client.event.RenderLivingEvent +import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import java.awt.Color object ArcherHighlight { +// @SubscribeEvent +// fun onRenderLiving(event: RenderLivingEvent.Pre<*>) { +// 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, +// 2.0, +// z - .5, +// 1.0, +// DulkirConfig.archBoxColor.toJavaColor(), +// 3f, +// phase = false +// ) +// } + @SubscribeEvent - fun onRenderLiving(event: RenderLivingEvent.Post<*>) { + fun onRenderWorldLast(event: RenderWorldLastEvent) { 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 - ) + val players = mc.theWorld.playerEntities.filterNotNull() + players.forEach { + val name = it.name ?: return@forEach + if (name != TabListUtils.archerName) return + if (mc.thePlayer.positionVector.yCoord > 45 && !DulkirConfig.archerBoxEverywhere) return + if (mc.thePlayer.name == name) return + val x = it.posX - ((it.lastTickPosX - it.posX) * event.partialTicks) + val y = it.posY - ((it.lastTickPosY - it.posY) * event.partialTicks) + val z = it.posZ - ((it.lastTickPosZ - it.posZ) * event.partialTicks) + WorldRenderUtils.drawCustomBox( + x - .5, + 1.0, + y, + 2.0, + z - .5, + 1.0, + DulkirConfig.archBoxColor.toJavaColor(), + 3f, + phase = false + ) + } } }
\ No newline at end of file |