diff --git a/src/main/java/com/mojang/brigadier/tree/CommandNode.java b/src/main/java/com/mojang/brigadier/tree/CommandNode.java index 15b584a..47f8e3d 100644 --- a/src/main/java/com/mojang/brigadier/tree/CommandNode.java +++ b/src/main/java/com/mojang/brigadier/tree/CommandNode.java @@ -22,12 +22,11 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.CompletableFuture; import java.util.function.Predicate; -import java.util.stream.Collectors; public abstract class CommandNode implements Comparable> { - private Map> children = new LinkedHashMap<>(); - private Map> literals = new LinkedHashMap<>(); - private Map> arguments = new LinkedHashMap<>(); + private final Map> children = new LinkedHashMap<>(); + private final Map> literals = new LinkedHashMap<>(); + private final Map> arguments = new LinkedHashMap<>(); private final Predicate requirement; private final CommandNode redirect; private final RedirectModifier modifier; @@ -88,8 +87,6 @@ public abstract class CommandNode implements Comparable> { arguments.put(node.getName(), (ArgumentCommandNode) node); } } - - children = children.entrySet().stream().sorted(Map.Entry.comparingByValue()).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new)); } public void findAmbiguities(final AmbiguityConsumer consumer) {