mirror of
				https://github.com/GeyserMC/Geyser.git
				synced 2024-08-14 23:57:35 +00: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
This commit is contained in:
		
							parent
							
								
									ca0f3775a2
								
							
						
					
					
						commit
						13dfc7c173
					
				
					 2 changed files with 3 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -169,8 +169,8 @@ public class JavaCommandsTranslator extends PacketTranslator<ClientboundCommands
 | 
			
		|||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // The command flags, not sure what these do apart from break things
 | 
			
		||||
        Set<CommandData.Flag> flags = Set.of();
 | 
			
		||||
        // The command flags, set to NOT_CHEAT so known commands can be used while achievements are enabled.
 | 
			
		||||
        Set<CommandData.Flag> flags = Set.of(CommandData.Flag.NOT_CHEAT);
 | 
			
		||||
 | 
			
		||||
        // Loop through all the found commands
 | 
			
		||||
        for (Map.Entry<BedrockCommandInfo, Set<String>> entry : commands.entrySet()) {
 | 
			
		||||
| 
						 | 
				
			
			@ -449,7 +449,7 @@ public class JavaCommandsTranslator extends PacketTranslator<ClientboundCommands
 | 
			
		|||
                        type = (CommandParam) mappedType;
 | 
			
		||||
                        // Bedrock throws a fit if an optional message comes after a string or target
 | 
			
		||||
                        // 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;
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -168,7 +168,6 @@ above-bedrock-nether-building: false
 | 
			
		|||
force-resource-packs: true
 | 
			
		||||
 | 
			
		||||
# 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
 | 
			
		||||
 | 
			
		||||
# Whether player IP addresses will be logged by the server.
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue