Add support for delaying commands.
This commit is contained in:
@@ -9,6 +9,8 @@ public class Command {
|
||||
private String command;
|
||||
/** The executor of the command. */
|
||||
private Executor executor = Executor.PLAYER;
|
||||
/** Delay before executing the command (in ticks) */
|
||||
private long delay = 0;
|
||||
|
||||
/**
|
||||
* Default constructor (for bean mapping).
|
||||
@@ -27,6 +29,19 @@ public class Command {
|
||||
this.executor = executor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param command the command
|
||||
* @param executor the executor of the command
|
||||
* @param delay the delay (in ticks) before executing command
|
||||
*/
|
||||
public Command(String command, Executor executor, long delay) {
|
||||
this.command = command;
|
||||
this.executor = executor;
|
||||
this.delay = delay;
|
||||
}
|
||||
|
||||
public String getCommand() {
|
||||
return command;
|
||||
}
|
||||
@@ -43,6 +58,14 @@ public class Command {
|
||||
this.executor = executor;
|
||||
}
|
||||
|
||||
public long getDelay() {
|
||||
return delay;
|
||||
}
|
||||
|
||||
public void setDelay(int delay) {
|
||||
this.delay = delay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return command + " (" + executor + ")";
|
||||
|
||||
Reference in New Issue
Block a user