mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-03-25 00:07:31 +01:00
Fix command redirection detection
This commit is contained in:
parent
b664bb961e
commit
b695dc075d
2 changed files with 5 additions and 4 deletions
|
@ -199,9 +199,10 @@ public class JavaCommandsTranslator extends PacketTranslator<ClientboundCommands
|
||||||
*/
|
*/
|
||||||
private static CommandParamData[][] getParams(GeyserSession session, CommandNode commandNode, CommandNode[] allNodes) {
|
private static CommandParamData[][] getParams(GeyserSession session, CommandNode commandNode, CommandNode[] allNodes) {
|
||||||
// Check if the command is an alias and redirect it
|
// Check if the command is an alias and redirect it
|
||||||
if (commandNode.getRedirectIndex() != -1) {
|
if (commandNode.getRedirectIndex().isPresent()) {
|
||||||
GeyserImpl.getInstance().getLogger().debug("Redirecting command " + commandNode.getName() + " to " + allNodes[commandNode.getRedirectIndex()].getName());
|
int redirectIndex = commandNode.getRedirectIndex().getAsInt();
|
||||||
commandNode = allNodes[commandNode.getRedirectIndex()];
|
GeyserImpl.getInstance().getLogger().debug("Redirecting command " + commandNode.getName() + " to " + allNodes[redirectIndex].getName());
|
||||||
|
commandNode = allNodes[redirectIndex];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (commandNode.getChildIndices().length >= 1) {
|
if (commandNode.getChildIndices().length >= 1) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ websocket = "1.5.1"
|
||||||
protocol = "2.9.17-20230217.002312-1"
|
protocol = "2.9.17-20230217.002312-1"
|
||||||
raknet = "1.6.28-20220125.214016-6"
|
raknet = "1.6.28-20220125.214016-6"
|
||||||
mcauthlib = "d9d773e"
|
mcauthlib = "d9d773e"
|
||||||
mcprotocollib = "1.19.4-20230319.152208-5"
|
mcprotocollib = "1.19.4-20230319.175814-6"
|
||||||
adventure = "4.12.0-20220629.025215-9"
|
adventure = "4.12.0-20220629.025215-9"
|
||||||
adventure-platform = "4.1.2"
|
adventure-platform = "4.1.2"
|
||||||
junit = "5.9.2"
|
junit = "5.9.2"
|
||||||
|
|
Loading…
Add table
Reference in a new issue