BentoBox icon indicating copy to clipboard operation
BentoBox copied to clipboard

Incorrect error message on setting home with an argument

Open BONNe opened this issue 5 years ago • 0 comments

Description

Describe the bug

If admin sets permission [gamemode].island.maxhomes.1, BentoBox returns error message about missing permission.

Steps to reproduce the behavior

  1. Set permission to user: [gamemode].island.maxhomes.1
  2. Try to set home with non-empty value... like: /[label] sethome MyHome

Expected behavior

If the user has just one home allowed, it should change it without an error message, if the provided argument is not a number, or the given number is 1 Check for max amount should include 1, not exclude it.

The error message that shows missing permission should be moved after parsing the current home number and should return correct permission instead of permission that contains [number] https://github.com/BentoBoxWorld/BentoBox/blob/develop/src/main/java/world/bentobox/bentobox/api/commands/island/IslandSethomeCommand.java#L62

Screenshots and videos (Optional)

Here is a code that should be improved: https://github.com/BentoBoxWorld/BentoBox/blob/develop/src/main/java/world/bentobox/bentobox/api/commands/island/IslandSethomeCommand.java#L46-L64

Additional context (Optional)

Comes from the discord support channel.

BONNe avatar Nov 05 '20 11:11 BONNe