mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-24 00:51:34 +01:00
Fix redirection when the player doesn't have access to a command
This commit is contained in:
parent
3c7a96dc4a
commit
78e12879b4
@ -340,8 +340,8 @@ public final class CommandManager {
|
|||||||
final ArgumentQueryResult queryResult = CommandParser.findEligibleArgument(commandQueryResult.command,
|
final ArgumentQueryResult queryResult = CommandParser.findEligibleArgument(commandQueryResult.command,
|
||||||
commandQueryResult.args, input, false, argument -> true);
|
commandQueryResult.args, input, false, argument -> true);
|
||||||
if (queryResult == null) {
|
if (queryResult == null) {
|
||||||
// Invalid argument, return command node
|
// Invalid argument, return command node (default to root)
|
||||||
int commandNode = commandIdentityMap.get(commandQueryResult.command);
|
int commandNode = commandIdentityMap.getOrDefault(commandQueryResult.command, 0);
|
||||||
request.retrieve(commandNode);
|
request.retrieve(commandNode);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -354,6 +354,9 @@ public final class CommandManager {
|
|||||||
request.retrieve(node);
|
request.retrieve(node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Unexpected issue, redirect to root
|
||||||
|
request.retrieve(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pair<CommandName,EnabledTracking>
|
// Pair<CommandName,EnabledTracking>
|
||||||
|
Loading…
Reference in New Issue
Block a user