Compare commits
2 Commits
c3bbf9af4b
...
18d594c02c
| Author | SHA1 | Date | |
|---|---|---|---|
| 18d594c02c | |||
| c534cc67a8 |
@@ -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() {
|
public void clear() {
|
||||||
pending.clear();
|
pending.clear();
|
||||||
current = null;
|
current = null;
|
||||||
|
currentStarted = false;
|
||||||
delayUntil = 0;
|
delayUntil = 0;
|
||||||
rolledDelay = 0;
|
rolledDelay = 0;
|
||||||
|
taskStartTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private long sampleLogNormalDistribution() {
|
private long sampleLogNormalDistribution() {
|
||||||
|
|||||||
Reference in New Issue
Block a user