Build stuff into nodes! They may not do anything, but it's node-tastic!

This commit is contained in:
Nathan Adams
2014-09-17 15:30:49 +02:00
parent 934ba3336f
commit 4f20d02a97
11 changed files with 161 additions and 1 deletions
@@ -0,0 +1,21 @@
package net.minecraft.commands.tree;
import net.minecraft.commands.arguments.CommandArgumentType;
public class ArgumentCommandNode extends CommandNode {
private final String name;
private final CommandArgumentType type;
public ArgumentCommandNode(String name, CommandArgumentType type) {
this.name = name;
this.type = type;
}
public String getName() {
return name;
}
public CommandArgumentType getType() {
return type;
}
}
@@ -0,0 +1,17 @@
package net.minecraft.commands.tree;
import com.google.common.collect.Lists;
import java.util.List;
public abstract class CommandNode {
private final List<CommandNode> children = Lists.newArrayList();
public List<CommandNode> getChildren() {
return children;
}
public void addChild(CommandNode node) {
children.add(node);
}
}
@@ -0,0 +1,13 @@
package net.minecraft.commands.tree;
public class LiteralCommandNode extends CommandNode {
private final String literal;
public LiteralCommandNode(String literal) {
this.literal = literal;
}
public String getLiteral() {
return literal;
}
}
@@ -0,0 +1,4 @@
@ParametersAreNonnullByDefault
package net.minecraft.commands.tree;
import javax.annotation.ParametersAreNonnullByDefault;