mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-29 23:17:59 +02: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);
|
storedArgumentsNodes.put(argument, argumentNodes);
|
||||||
for (DeclareCommandsPacket.Node node : argumentNodes) {
|
for (DeclareCommandsPacket.Node node : argumentNodes) {
|
||||||
final int childId = nodes.size();
|
final int childId = nodes.size();
|
||||||
@ -517,28 +517,6 @@ public final class CommandManager {
|
|||||||
return literalNode;
|
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) {
|
public byte getFlag(@NotNull NodeType type, boolean executable, boolean redirect, boolean suggestionType) {
|
||||||
byte result = (byte) type.mask;
|
byte result = (byte) type.mask;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user