Build stuff into nodes! They may not do anything, but it's node-tastic!
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package net.minecraft.commands.builder;
|
||||
|
||||
import net.minecraft.commands.arguments.CommandArgumentType;
|
||||
import net.minecraft.commands.tree.ArgumentCommandNode;
|
||||
|
||||
public class RequiredArgumentBuilder extends ArgumentBuilder {
|
||||
private final String name;
|
||||
@@ -14,4 +15,22 @@ public class RequiredArgumentBuilder extends ArgumentBuilder {
|
||||
public static RequiredArgumentBuilder argument(String name, CommandArgumentType type) {
|
||||
return new RequiredArgumentBuilder(name, type);
|
||||
}
|
||||
|
||||
public CommandArgumentType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public ArgumentCommandNode build() {
|
||||
ArgumentCommandNode result = new ArgumentCommandNode(getName(), getType());
|
||||
|
||||
for (ArgumentBuilder argument : getArguments()) {
|
||||
result.addChild(argument.build());
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user