diff --git a/src/minecraft/assemblyline/common/machine/command/CommandRepeat.java b/src/minecraft/assemblyline/common/machine/command/CommandRepeat.java new file mode 100644 index 000000000..313b90101 --- /dev/null +++ b/src/minecraft/assemblyline/common/machine/command/CommandRepeat.java @@ -0,0 +1,27 @@ +package assemblyline.common.machine.command; + +/** + * This task resets all previous tasks and does them again in a loop. + * + * @author Calclavia + * + */ +public class CommandRepeat extends Command +{ + /** + * The amount of tasks above this task to repeat. + */ + private int tasksToRepeat; + + public void onTaskStart() + { + this.tasksToRepeat = this.getIntArg(0); + } + + @Override + protected boolean doTask() + { + this.commandManager.setCurrentTask(this.commandManager.getCurrentTask() - this.tasksToRepeat); + return false; + } +}