mirror of
				https://github.com/GayPizzaSpecifications/foundation.git
				synced 2025-11-04 11:39:39 +00:00 
			
		
		
		
	Add missing alias and try to improve tab completion.
This commit is contained in:
		@ -1,6 +1,5 @@
 | 
				
			|||||||
package cloud.kubelet.foundation.core.features.player
 | 
					package cloud.kubelet.foundation.core.features.player
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import org.bukkit.GameMode
 | 
					 | 
				
			||||||
import org.bukkit.WeatherType
 | 
					import org.bukkit.WeatherType
 | 
				
			||||||
import org.bukkit.command.Command
 | 
					import org.bukkit.command.Command
 | 
				
			||||||
import org.bukkit.command.CommandExecutor
 | 
					import org.bukkit.command.CommandExecutor
 | 
				
			||||||
@ -45,6 +44,7 @@ class LocalWeatherCommand : CommandExecutor, TabCompleter {
 | 
				
			|||||||
    args: Array<out String>
 | 
					    args: Array<out String>
 | 
				
			||||||
  ): List<String> = when {
 | 
					  ): List<String> = when {
 | 
				
			||||||
    args.isEmpty() -> weatherTypes.keys.toList()
 | 
					    args.isEmpty() -> weatherTypes.keys.toList()
 | 
				
			||||||
 | 
					    args.size == 1 -> weatherTypes.filterKeys { it.startsWith(args[0]) }.keys.toList()
 | 
				
			||||||
    else -> listOf()
 | 
					    else -> listOf()
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -60,3 +60,5 @@ commands:
 | 
				
			|||||||
  localweather:
 | 
					  localweather:
 | 
				
			||||||
    description: Set the player's local weather in the client.
 | 
					    description: Set the player's local weather in the client.
 | 
				
			||||||
    usage: /localweather <type>
 | 
					    usage: /localweather <type>
 | 
				
			||||||
 | 
					    aliases:
 | 
				
			||||||
 | 
					      - lw
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user