Commands can be parsed, in a very limited way.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package net.minecraft.commands.tree;
|
||||
|
||||
import net.minecraft.commands.exceptions.IllegalCommandArgumentException;
|
||||
|
||||
public class LiteralCommandNode extends CommandNode {
|
||||
private final String literal;
|
||||
private final Runnable executor;
|
||||
@@ -16,4 +18,11 @@ public class LiteralCommandNode extends CommandNode {
|
||||
public Runnable getExecutor() {
|
||||
return executor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void parse(String command) throws IllegalCommandArgumentException {
|
||||
if (!command.equals(literal)) {
|
||||
throw new IllegalCommandArgumentException();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user