From e41cea0412e0886a0479151f83032071d756e7d2 Mon Sep 17 00:00:00 2001 From: MiranCZ Date: Mon, 15 Apr 2024 17:32:09 +0200 Subject: [PATCH] added @dummy command for testing purposes --- .../java/adris/altoclef/AltoClefCommands.java | 2 + .../commands/random/DummyTaskCommand.java | 48 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/main/java/adris/altoclef/commands/random/DummyTaskCommand.java diff --git a/src/main/java/adris/altoclef/AltoClefCommands.java b/src/main/java/adris/altoclef/AltoClefCommands.java index 270c2bcb..55bcc280 100644 --- a/src/main/java/adris/altoclef/AltoClefCommands.java +++ b/src/main/java/adris/altoclef/AltoClefCommands.java @@ -2,6 +2,7 @@ import adris.altoclef.commands.*; import adris.altoclef.commands.random.CycleTestCommand; +import adris.altoclef.commands.random.DummyTaskCommand; import adris.altoclef.commands.random.ScanCommand; import adris.altoclef.commandsystem.CommandException; @@ -20,6 +21,7 @@ public static void init() throws CommandException { new TestCommand(), new GamerCommand(), new MarvionCommand(), + new DummyTaskCommand(), new ReloadSettingsCommand(), //new CycleTestCommand(), new ScanCommand() diff --git a/src/main/java/adris/altoclef/commands/random/DummyTaskCommand.java b/src/main/java/adris/altoclef/commands/random/DummyTaskCommand.java new file mode 100644 index 00000000..0744e01c --- /dev/null +++ b/src/main/java/adris/altoclef/commands/random/DummyTaskCommand.java @@ -0,0 +1,48 @@ +package adris.altoclef.commands.random; + +import adris.altoclef.AltoClef; +import adris.altoclef.commandsystem.ArgBase; +import adris.altoclef.commandsystem.ArgParser; +import adris.altoclef.commandsystem.Command; +import adris.altoclef.commandsystem.CommandException; +import adris.altoclef.tasks.speedrun.OneCycleTask; +import adris.altoclef.tasksystem.Task; + +public class DummyTaskCommand extends Command { + public DummyTaskCommand() { + super("dummy", "Doesnt do anything"); + } + + @Override + protected void call(AltoClef mod, ArgParser parser) throws CommandException { + mod.runUserTask(new DummyTask(), this::finish); + } + + private class DummyTask extends Task { + + @Override + protected void onStart(AltoClef mod) { + + } + + @Override + protected Task onTick(AltoClef mod) { + return null; + } + + @Override + protected void onStop(AltoClef mod, Task interruptTask) { + + } + + @Override + protected boolean isEqual(Task other) { + return false; + } + + @Override + protected String toDebugString() { + return null; + } + } +}