Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to max permissible radius when no radius is specified in command arguments #51

Open
MCAlagaesia opened this issue Feb 5, 2022 · 2 comments

Comments

@MCAlagaesia
Copy link

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:
image

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
@bergerkiller
Copy link
Member

That should do it https://ci.mg-dev.eu/job/Light-Cleaner/133/

Now when you do /cleanlight it will take the highest lightcleaner.clean.radius.[radius] perm you got, or the bukkit view distance if that one is lower than the highest permission.

@MCAlagaesia
Copy link
Author

Wow, you made quick work of that! I can confirm it works. Thanks!! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants