diff options
author | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-09-25 13:28:22 +0200 |
---|---|---|
committer | hannibal2 <24389977+hannibal00212@users.noreply.github.com> | 2022-09-25 13:28:22 +0200 |
commit | b9058537d2590bddb82824dd60a90aeedf717fa3 (patch) | |
tree | fc6612e388e4d0abeda4659e44d2a422b925cbde /src/main/java | |
parent | 292fb024c4cb3ad55b3ae872d17049739343e500 (diff) | |
download | skyhanni-b9058537d2590bddb82824dd60a90aeedf717fa3.tar.gz skyhanni-b9058537d2590bddb82824dd60a90aeedf717fa3.tar.bz2 skyhanni-b9058537d2590bddb82824dd60a90aeedf717fa3.zip |
see thunder in lava
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/features/ThunderSparksHighlight.kt | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/ThunderSparksHighlight.kt b/src/main/java/at/hannibal2/skyhanni/features/ThunderSparksHighlight.kt index 9c8b9fd11..b714f2c5a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/ThunderSparksHighlight.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/ThunderSparksHighlight.kt @@ -2,6 +2,7 @@ package at.hannibal2.skyhanni.features import at.hannibal2.skyhanni.SkyHanniMod import at.hannibal2.skyhanni.test.GriffinUtils.drawWaypointFilled +import at.hannibal2.skyhanni.utils.BlockUtils.getBlockAt import at.hannibal2.skyhanni.utils.ItemUtils.getSkullTexture import at.hannibal2.skyhanni.utils.LocationUtils import at.hannibal2.skyhanni.utils.LorenzUtils @@ -10,6 +11,7 @@ import at.hannibal2.skyhanni.utils.SpecialColour import at.hannibal2.skyhanni.utils.getLorenzVec import net.minecraft.client.Minecraft import net.minecraft.entity.item.EntityArmorStand +import net.minecraft.init.Blocks import net.minecraftforge.client.event.RenderWorldLastEvent import net.minecraftforge.event.world.WorldEvent import net.minecraftforge.fml.common.eventhandler.SubscribeEvent @@ -26,10 +28,8 @@ class ThunderSparksHighlight { fun onTick(event: TickEvent.ClientTickEvent) { if (!isEnabled()) return - Minecraft.getMinecraft().theWorld.loadedEntityList - .filter { it -> - it is EntityArmorStand && it !in sparks && it.inventory - .any { it != null && it.getSkullTexture() == texture } + Minecraft.getMinecraft().theWorld.loadedEntityList.filter { it -> + it is EntityArmorStand && it !in sparks && it.inventory.any { it != null && it.getSkullTexture() == texture } }.forEach { sparks.add(it as EntityArmorStand) } } @@ -44,9 +44,14 @@ class ThunderSparksHighlight { for (spark in sparks) { if (spark.isDead) continue val sparkLocation = spark.getLorenzVec() - event.drawWaypointFilled(sparkLocation.add(-0.5, 0.0, -0.5), color, extraSize = -0.25) + val block = sparkLocation.getBlockAt() + val seeThroughBlocks = + sparkLocation.distance(LocationUtils.playerLocation()) < 6 && (block == Blocks.flowing_lava || block == Blocks.lava) + event.drawWaypointFilled( + sparkLocation.add(-0.5, 0.0, -0.5), color, extraSize = -0.25, seeThroughBlocks = seeThroughBlocks + ) if (sparkLocation.distance(playerLocation) < 10) { - event.drawString(sparkLocation.add(0.0, 1.5, 0.0), "Thunder Spark") + event.drawString(sparkLocation.add(0.0, 1.5, 0.0), "Thunder Spark", seeThroughBlocks = seeThroughBlocks) } } } |