mirror of
https://github.com/Minestom/Minestom.git
synced 2025-03-02 11:21:15 +01:00
Remove unnecessary toNodes wrapper
This commit is contained in:
parent
de5e8e3e67
commit
7854602a04
@ -450,7 +450,7 @@ public final class CommandManager {
|
||||
}
|
||||
|
||||
|
||||
final DeclareCommandsPacket.Node[] argumentNodes = toNodes(argument, isLast);
|
||||
final DeclareCommandsPacket.Node[] argumentNodes = argument.toNodes(isLast);
|
||||
storedArgumentsNodes.put(argument, argumentNodes);
|
||||
for (DeclareCommandsPacket.Node node : argumentNodes) {
|
||||
final int childId = nodes.size();
|
||||
@ -517,28 +517,6 @@ public final class CommandManager {
|
||||
return literalNode;
|
||||
}
|
||||
|
||||
// TODO should we even have this function?
|
||||
/**
|
||||
* Converts an argument to a node with the correct brigadier parser.
|
||||
*
|
||||
* @param argument the argument to convert
|
||||
* @param executable true if this is the last argument, false otherwise
|
||||
* @return the list of nodes that the argument require
|
||||
*/
|
||||
@NotNull
|
||||
private DeclareCommandsPacket.Node[] toNodes(@NotNull Argument<?> argument, boolean executable) {
|
||||
|
||||
// You can uncomment this to test any brigadier parser on the client
|
||||
|
||||
/*
|
||||
DeclareCommandsPacket.Node testNode = simpleArgumentNode(nodes, argument, executable, false);
|
||||
testNode.parser = "minecraft:block_state";
|
||||
return nodes;
|
||||
*/
|
||||
|
||||
return argument.toNodes(executable);
|
||||
}
|
||||
|
||||
public byte getFlag(@NotNull NodeType type, boolean executable, boolean redirect, boolean suggestionType) {
|
||||
byte result = (byte) type.mask;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user