diff options
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, |