3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-16 04:50:07 +01:00

Allow commands with xbox achievements enabled (#4894)

* Allow commands with xbox achievements enabled

* Don't enable by default

* Add null check to paramData

* Update comment
Dieser Commit ist enthalten in:
rtm516 2024-07-31 01:06:26 +01:00 committet von GitHub
Ursprung ca0f3775a2
Commit 13dfc7c173
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194
2 geänderte Dateien mit 3 neuen und 4 gelöschten Zeilen

Datei anzeigen

@ -169,8 +169,8 @@ public class JavaCommandsTranslator extends PacketTranslator<ClientboundCommands
return; return;
} }
// The command flags, not sure what these do apart from break things // The command flags, set to NOT_CHEAT so known commands can be used while achievements are enabled.
Set<CommandData.Flag> flags = Set.of(); Set<CommandData.Flag> flags = Set.of(CommandData.Flag.NOT_CHEAT);
// Loop through all the found commands // Loop through all the found commands
for (Map.Entry<BedrockCommandInfo, Set<String>> entry : commands.entrySet()) { for (Map.Entry<BedrockCommandInfo, Set<String>> entry : commands.entrySet()) {
@ -449,7 +449,7 @@ public class JavaCommandsTranslator extends PacketTranslator<ClientboundCommands
type = (CommandParam) mappedType; type = (CommandParam) mappedType;
// Bedrock throws a fit if an optional message comes after a string or target // Bedrock throws a fit if an optional message comes after a string or target
// Example vanilla commands: ban-ip, ban, and kick // Example vanilla commands: ban-ip, ban, and kick
if (optional && type == CommandParam.MESSAGE && (paramData.getType() == CommandParam.STRING || paramData.getType() == CommandParam.TARGET)) { if (optional && type == CommandParam.MESSAGE && paramData != null && (paramData.getType() == CommandParam.STRING || paramData.getType() == CommandParam.TARGET)) {
optional = false; optional = false;
} }
} }

Datei anzeigen

@ -168,7 +168,6 @@ above-bedrock-nether-building: false
force-resource-packs: true force-resource-packs: true
# Allows Xbox achievements to be unlocked. # Allows Xbox achievements to be unlocked.
# THIS DISABLES ALL COMMANDS FROM SUCCESSFULLY RUNNING FOR BEDROCK IN-GAME, as otherwise Bedrock thinks you are cheating.
xbox-achievements-enabled: false xbox-achievements-enabled: false
# Whether player IP addresses will be logged by the server. # Whether player IP addresses will be logged by the server.