Light-Cleaner
Light-Cleaner copied to clipboard
Default to max permissible radius when no radius is specified in command arguments
The radius to clean currently defaults to Bukkit.getServer().getViewDistance();
when no radius is specified (e.g. by running the command /cleanlight
with no arguments).
If a user has a limitation on their maximum clean radius (i.e. they have been given the lightcleaner.clean.radius.[radius]
permission less than the server view distance), they get the following message when using /cleanlight
with no arguments:
Given the user didn't specify a radius, this error message may be unclear. By defaulting to the user's maximum clean radius (if defined by permissions), the interaction with the plugin is simplified.
It may be useful to fall back to the server view distance as the maximum radius if:
- A maximum clean radius is not defined in permissions for the user
- The user's maximum clean radius as defined by permissions is greater than the server view distance