From 2c445635df8574893bfb3509f15fcada063742b1 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Tue, 3 Dec 2024 14:54:47 -0500 Subject: Check world seed great idea Kevin :D --- src/main/java/de/hysky/skyblocker/debug/SnapshotDebug.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/debug/SnapshotDebug.java b/src/main/java/de/hysky/skyblocker/debug/SnapshotDebug.java index 4759707f..0f70d651 100644 --- a/src/main/java/de/hysky/skyblocker/debug/SnapshotDebug.java +++ b/src/main/java/de/hysky/skyblocker/debug/SnapshotDebug.java @@ -4,15 +4,17 @@ 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.client.MinecraftClient; import net.minecraft.text.Text; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; public class SnapshotDebug { + private static final MinecraftClient CLIENT = MinecraftClient.getInstance(); 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 final boolean AARON_WORLD = true; //Maybe come up with a better system for this.... I had a whole world setup :( + private static final long AARON_WORLD_SEED = 5629719634239627355L; private static boolean isInSnapshot() { return !SharedConstants.getGameVersion().isStable(); @@ -25,7 +27,7 @@ public class SnapshotDebug { } private static void renderTest(WorldRenderContext wrc) { - if (AARON_WORLD) { + if (getSeed() == AARON_WORLD_SEED) { 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); @@ -39,4 +41,8 @@ public class SnapshotDebug { RenderHelper.renderText(wrc, Text.of("Skyblocker on " + SharedConstants.getGameVersion().getName() + "!"), new Vec3d(0.5, 66.5, 6.5), false); } } + + private static long getSeed() { + return CLIENT.isIntegratedServerRunning() ? CLIENT.getServer().getOverworld().getSeed() : 0L; + } } -- cgit