mirror of
https://code.chipmunk.land/ChomeNS/chipmunkmod.git
synced 2025-11-13 21:06:16 +00:00
refactor: don't request more ChomeNS Bot command suggestions when we already got one (it can still be forced through eval)
This commit is contained in:
parent
c0d010acf1
commit
af509b8455
1 changed files with 7 additions and 1 deletions
|
|
@ -22,6 +22,8 @@ public class ChomeNSBotCommandSuggestions implements Listener {
|
|||
|
||||
private final MinecraftClient client;
|
||||
|
||||
public boolean receivedSuggestions = false; // can be set through eval
|
||||
|
||||
public List<ChomeNSBotCommand> 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) {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue