aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/hysky/skyblocker/debug/SnapshotDebug.java
diff options
context:
space:
mode:
authorAaron <51387595+AzureAaron@users.noreply.github.com>2024-02-05 22:09:46 -0500
committerAaron <51387595+AzureAaron@users.noreply.github.com>2024-04-26 16:23:19 -0400
commita0588bc0fce38990f06e66b5be9c89417217408f (patch)
tree1657452eb0d0e80df463fe62965f6f67d67b3be2 /src/main/java/de/hysky/skyblocker/debug/SnapshotDebug.java
parent37ad3ca7aa844bf0db54e7ee21e35837fd3cbbc1 (diff)
downloadSkyblocker-a0588bc0fce38990f06e66b5be9c89417217408f.tar.gz
Skyblocker-a0588bc0fce38990f06e66b5be9c89417217408f.tar.bz2
Skyblocker-a0588bc0fce38990f06e66b5be9c89417217408f.zip
24w05a/b
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/debug/SnapshotDebug.java')
-rw-r--r--src/main/java/de/hysky/skyblocker/debug/SnapshotDebug.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main/java/de/hysky/skyblocker/debug/SnapshotDebug.java b/src/main/java/de/hysky/skyblocker/debug/SnapshotDebug.java
new file mode 100644
index 00000000..bd4abd2c
--- /dev/null
+++ b/src/main/java/de/hysky/skyblocker/debug/SnapshotDebug.java
@@ -0,0 +1,32 @@
+package de.hysky.skyblocker.debug;
+
+import de.hysky.skyblocker.utils.render.RenderHelper;
+import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext;
+import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents;
+import net.minecraft.SharedConstants;
+import net.minecraft.text.Text;
+import net.minecraft.util.math.BlockPos;
+import net.minecraft.util.math.Vec3d;
+
+public class SnapshotDebug {
+ private static final float[] RED = { 1.0f, 0.0f, 0.0f };
+ private static final float ALPHA = 0.5f;
+ private static final float LINE_WIDTH = 8f;
+
+ private static boolean isInSnapshot() {
+ return !SharedConstants.getGameVersion().isStable();
+ }
+
+ static void init() {
+ if (isInSnapshot()) {
+ WorldRenderEvents.AFTER_TRANSLUCENT.register(SnapshotDebug::renderTest);
+ }
+ }
+
+ private static void renderTest(WorldRenderContext wrc) {
+ RenderHelper.renderFilledWithBeaconBeam(wrc, new BlockPos(175, 63, -14), RED, ALPHA, true);
+ RenderHelper.renderLinesFromPoints(wrc, new Vec3d[] { new Vec3d(173, 66, -7.5), new Vec3d(178, 66, -7.5) }, RED, ALPHA, LINE_WIDTH, false);
+ RenderHelper.renderQuad(wrc, new Vec3d[] { new Vec3d(183, 66, -16), new Vec3d(183, 63, -16), new Vec3d(183, 63, -14), new Vec3d(183, 66, -14) }, RED, ALPHA, false);
+ RenderHelper.renderText(wrc, Text.of("Skyblocker on " + SharedConstants.getGameVersion().getName() + "!"), new Vec3d(175.5, 67.5, -7.5), false);
+ }
+}