diff options
author | Lorenz <lo.scherf@gmail.com> | 2022-08-18 13:21:41 +0200 |
---|---|---|
committer | Lorenz <lo.scherf@gmail.com> | 2022-08-18 13:21:41 +0200 |
commit | 3e40f471b162a006ef40a8102bb7f496e9514518 (patch) | |
tree | a4b00873823a082473ef5f3086ee65fd12c73df4 /src/main/java/at/hannibal2/skyhanni/test | |
parent | 2f78bd32d9bebd216581d61dcdc53bd6adcea13a (diff) | |
download | skyhanni-3e40f471b162a006ef40a8102bb7f496e9514518.tar.gz skyhanni-3e40f471b162a006ef40a8102bb7f496e9514518.tar.bz2 skyhanni-3e40f471b162a006ef40a8102bb7f496e9514518.zip |
adding ashfang gravity orbs display
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/test')
-rw-r--r-- | src/main/java/at/hannibal2/skyhanni/test/GriffinUtils.kt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/test/GriffinUtils.kt b/src/main/java/at/hannibal2/skyhanni/test/GriffinUtils.kt index 8b77dc6e3..bfbb95302 100644 --- a/src/main/java/at/hannibal2/skyhanni/test/GriffinUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/test/GriffinUtils.kt @@ -2,7 +2,12 @@ package at.hannibal2.skyhanni.test import at.hannibal2.skyhanni.utils.LorenzColor import at.hannibal2.skyhanni.utils.LorenzVec +import at.hannibal2.skyhanni.utils.RenderUtils +import at.hannibal2.skyhanni.utils.RenderUtils.expandBlock +import net.minecraft.client.renderer.GlStateManager +import net.minecraft.util.AxisAlignedBB import net.minecraftforge.client.event.RenderWorldLastEvent +import java.awt.Color object GriffinUtils { @@ -11,6 +16,27 @@ object GriffinUtils { GriffinJavaUtils.drawWaypoint(location, partialTicks, color.toColor(), beacon) } + fun RenderWorldLastEvent.drawWaypointFilled(location: LorenzVec, color: Color, beacon: Boolean = false) { + val (viewerX, viewerY, viewerZ) = RenderUtils.getViewerPos(partialTicks) + val x = location.x - viewerX + val y = location.y - viewerY + val z = location.z - viewerZ + val distSq = x * x + y * y + z * z + GlStateManager.disableDepth() + GlStateManager.disableCull() + RenderUtils.drawFilledBoundingBox( + AxisAlignedBB(x, y, z, x + 1, y + 1, z + 1).expandBlock(), + color, + (0.1f + 0.005f * distSq.toFloat()).coerceAtLeast(0.2f) + ) + GlStateManager.disableTexture2D() + if (distSq > 5 * 5 && beacon) RenderUtils.renderBeaconBeam(x, y + 1, z, color.rgb, 1.0f, partialTicks) + GlStateManager.disableLighting() + GlStateManager.enableTexture2D() + GlStateManager.enableDepth() + GlStateManager.enableCull() + } + fun RenderWorldLastEvent.draw3DLine( p1: LorenzVec, p2: LorenzVec, |