aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/test
diff options
context:
space:
mode:
authorLorenz <lo.scherf@gmail.com>2022-08-18 13:21:41 +0200
committerLorenz <lo.scherf@gmail.com>2022-08-18 13:21:41 +0200
commit3e40f471b162a006ef40a8102bb7f496e9514518 (patch)
treea4b00873823a082473ef5f3086ee65fd12c73df4 /src/main/java/at/hannibal2/skyhanni/test
parent2f78bd32d9bebd216581d61dcdc53bd6adcea13a (diff)
downloadskyhanni-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.kt26
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,