From af509b8455cfe8167d22fc04f72de48c59422486 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+chomens@users.noreply.github.com> Date: Tue, 14 Jan 2025 19:42:48 +0700 Subject: [PATCH] refactor: don't request more ChomeNS Bot command suggestions when we already got one (it can still be forced through eval) --- .../chipmunkmod/modules/ChomeNSBotCommandSuggestions.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/land/chipmunk/chipmunkmod/modules/ChomeNSBotCommandSuggestions.java b/src/main/java/land/chipmunk/chipmunkmod/modules/ChomeNSBotCommandSuggestions.java index 0861917..49b187c 100644 --- a/src/main/java/land/chipmunk/chipmunkmod/modules/ChomeNSBotCommandSuggestions.java +++ b/src/main/java/land/chipmunk/chipmunkmod/modules/ChomeNSBotCommandSuggestions.java @@ -22,6 +22,8 @@ public class ChomeNSBotCommandSuggestions implements Listener { private final MinecraftClient client; + public boolean receivedSuggestions = false; // can be set through eval + public List commands = new ArrayList<>(); public ChomeNSBotCommandSuggestions (MinecraftClient client) { @@ -33,7 +35,9 @@ public class ChomeNSBotCommandSuggestions implements Listener { public void init () {} @Override - public void coreMoved () { forceRequest(); } + public void coreMoved () { + if (!receivedSuggestions) forceRequest(); + } public void forceRequest () { final ClientPlayerEntity player = client.player; @@ -85,6 +89,8 @@ public class ChomeNSBotCommandSuggestions implements Listener { } ) .toList(); + + receivedSuggestions = true; } catch (Exception ignored) {} } }