Skip to content

Conversation

moxvallix
Copy link
Contributor

Type of change

  • Bug fix
  • New feature

Description

This PR adds functionality to waypoints to allow them to toggle off their visibility once a player is within a particular range of the waypoint. This is useful for creating "temporary" waypoints, that only stay visible whilst the player is travelling to that point, and can automatically turn themselves off once the player has reached the destination.

As well, this PR makes death waypoints automatically hide themselves once the player is within 4 blocks of the waypoint.

How Has This Been Tested?

image

@Wide-Cat
Copy link
Collaborator

apply this patch and ill merge it

Index: src/main/java/meteordevelopment/meteorclient/systems/waypoints/Waypoint.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/main/java/meteordevelopment/meteorclient/systems/waypoints/Waypoint.java b/src/main/java/meteordevelopment/meteorclient/systems/waypoints/Waypoint.java
--- a/src/main/java/meteordevelopment/meteorclient/systems/waypoints/Waypoint.java	(revision 3f5c9461589fa2df1f73c140cac2459aed550c11)
+++ b/src/main/java/meteordevelopment/meteorclient/systems/waypoints/Waypoint.java	(date 1756569902171)
@@ -106,6 +106,7 @@
         .description("Hides the waypoint if the player is closer than this distance, and hide when near is enabled.")
         .defaultValue(8)
         .sliderRange(0, 32)
+        .visible(hideWhenNear::get)
         .build()
     );
 
@@ -118,8 +119,7 @@
     public Waypoint(NbtElement tag) {
         NbtCompound nbt = (NbtCompound) tag;
 
-        if (nbt.contains("uuid")) uuid = nbt.get("uuid", Uuids.INT_STREAM_CODEC).get();
-        else uuid = UUID.randomUUID();
+        uuid = nbt.get("uuid", Uuids.INT_STREAM_CODEC).orElse(UUID.randomUUID());
 
         fromTag(nbt);
     }
@@ -129,7 +129,7 @@
         if (texture == null) return;
 
         int preA = color.get().a;
-        color.get().a *= a;
+        color.get().a *= (int) a;
 
         Renderer2D.TEXTURE.begin();
         Renderer2D.TEXTURE.texQuad(x, y, size, size, color.get());
@@ -153,8 +153,8 @@
     }
 
     public void hideWhenNearCheck(int distance) {
-        if (!hideWhenNear.get()) { return; }
-        if (distance > hideWhenNearDistance.get()) { return; }
+        if (!hideWhenNear.get()) return;
+        if (distance > hideWhenNearDistance.get()) return;
 
         visible.set(false);
     }

@moxvallix
Copy link
Contributor Author

@Wide-Cat I have applied the patch.

@moxvallix
Copy link
Contributor Author

Actually, hold off on merging this for a bit. There's currently a bug where the death waypoint is getting hidden before the player actually dies and respawns.

I'll push a fix for it later.

@moxvallix
Copy link
Contributor Author

Ok, it should be good to be merged now, unless there are any more changes for me to make.

@Wide-Cat
Copy link
Collaborator

Wide-Cat commented Sep 7, 2025

Looks mostly good but a couple of things. Firstly, apply this patch for some small stuff. Secondly, why decide to change the death detection from opening the death screen to death message packets? In both singleplayer and the server I tested it on (latest-test.ccbluex.net) it would often duplicate the death waypoint. Is there a tangiable reliability issue it fixes? If not just revert it, I'm pretty sure the previous system was good enough.

java_ap7ITqCWxv java_gCZ4RhSerK java_3v51Tpq87Q

@moxvallix
Copy link
Contributor Author

@Wide-Cat I have applied the patch, and reverted the death detection changes.

@Wide-Cat Wide-Cat merged commit b9cbdb0 into MeteorDevelopment:master Sep 9, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants