Compare commits

...

2 Commits

Author SHA1 Message Date
burkkyy 18d594c02c New Run Command Task
build / build (push) Failing after 2s
2026-07-04 05:34:38 -07:00
burkkyy c534cc67a8 TaskQueue fix 2026-07-04 05:34:29 -07:00
2 changed files with 33 additions and 0 deletions
@@ -0,0 +1,31 @@
package skybot.controller.task;
import net.minecraft.client.MinecraftClient;
/** Runs a Minecraft command (e.g. "/help"), the same as typing it in chat. */
public class RunCommandTask implements Task {
private final String command;
private boolean ran = false;
public RunCommandTask(String command) {
this.command = command.startsWith("/") ? command.substring(1) : command;
}
@Override
public void start() {
MinecraftClient client = MinecraftClient.getInstance();
if (client.player != null) {
client.player.networkHandler.sendChatCommand(command);
}
ran = true;
}
@Override
public void tick() {
}
@Override
public boolean isDone() {
return ran;
}
}
@@ -71,8 +71,10 @@ public class TaskQueue {
public void clear() {
pending.clear();
current = null;
currentStarted = false;
delayUntil = 0;
rolledDelay = 0;
taskStartTime = 0;
}
private long sampleLogNormalDistribution() {