Commands can be parsed, in a very limited way.
This commit is contained in:
@@ -1,12 +1,13 @@
|
||||
package net.minecraft.commands.tree;
|
||||
|
||||
import net.minecraft.commands.arguments.CommandArgumentType;
|
||||
import net.minecraft.commands.exceptions.IllegalCommandArgumentException;
|
||||
|
||||
public class ArgumentCommandNode extends CommandNode {
|
||||
public class ArgumentCommandNode<T> extends CommandNode {
|
||||
private final String name;
|
||||
private final CommandArgumentType type;
|
||||
private final CommandArgumentType<T> type;
|
||||
|
||||
public ArgumentCommandNode(String name, CommandArgumentType type) {
|
||||
public ArgumentCommandNode(String name, CommandArgumentType<T> type) {
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
}
|
||||
@@ -15,7 +16,12 @@ public class ArgumentCommandNode extends CommandNode {
|
||||
return name;
|
||||
}
|
||||
|
||||
public CommandArgumentType getType() {
|
||||
public CommandArgumentType<T> getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void parse(String command) throws IllegalCommandArgumentException {
|
||||
type.parse(command);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user