refactor: also clear core queue on sendc (VM)

This commit is contained in:
Chayapak 2025-02-19 11:05:46 +07:00
parent 4bdf719515
commit f2aeeca81e
Signed by: ChomeNS
SSH key fingerprint: SHA256:0YoxhdyXsgbc0nfeB2N6FYE60mxMU7DS4uCUMaw2mvA
2 changed files with 8 additions and 0 deletions
src/main/java/me/chayapak1/testingbot

View file

@ -64,6 +64,10 @@ public class Core {
forceRun(command);
}
public void clearQueue () {
queue.clear();
}
private void packetReceived (ClientboundPlayerPositionPacket packet) {
if (!loggedIn) loggedIn = true;

View file

@ -150,6 +150,10 @@ public class Main {
final OutputStream output = process.getOutputStream();
if (content.trim().equalsIgnoreCase("sendc")) {
// ALSO clear the core queue
core.clearQueue();
output.write("\u0003".getBytes());
output.flush();