The NPE could only occur if a non-op player was trying to open the Settings Panel or change tab or change mode, leading to the call of a null PanelItem.
I added some nullability annotations to make it 100% clear that Flag#toPanelItem(...) returns null if the player is not op and the flag is invisible.
* Implements Basic/Advanced/Expert settings panels
Better alternative to https://github.com/BentoBoxWorld/BentoBox/pull/887
* Remove StatusIcon class - not used.
* Fixes glow of active tab.
* Moved FlagMode to Flag.Mode
* Display the LOCK flag no matter what the tab is
* Made the "mode" being saved for the player instead of per-tab
This means that a player will have its "mode" saved when he comes back later in the Settings Panel while also making the navigation more fluent - he won't need to set PROTECTION and SETTING to the same mode everytime.
Also renamed Flag.Mode#getNextFlag() to #getNext()
Added PlayersManager#setFlagsDisplayMode(UUID, Flag.Mode), #getFlagsDisplayMode(UUID)
* Play a sound when click on the mode button
* Added a description to the "mode" item
* Modified the mode for some flags
TabbedPanel extends Panel so that when an icon is
clicked, the context can be gathered by the click listener via the
getActiveTab method. In this case, the CycleClick and IslandToggleClick
classes cast the tab to the SettingsTab so they can retrieve the island
that the panel is referring too. This is required in the case where an
admin is setting a user's island settings. Previously the context of a
panel was only every about the user who opened the panel.
* Adds a tabbed panel API
* Added permission for tab
* Adds default world protection settings GUI
This switches the settings panel to use the new TabbedPanel API.
https://github.com/BentoBoxWorld/BentoBox/issues/384
* Adds admin command to change a player's settings.
Requires addon to add the admin settings command.
https://github.com/BentoBoxWorld/BentoBox/issues/59
* Locale for AdminSettingsCommand
This actually makes them always lowercase in the code.
The previous approach of using a case insensitive TreeMap was not
possible because it could not handle null values, which could occur if
the bundle had no blueprint set for a specific world environment. This
approach was the easiest and most straightforward.
The assumption here is that the admin was changing the unique name of
the blueprint bundle in the JSON file.
https://github.com/BentoBoxWorld/BentoBox/issues/865
If an addon doesn't have any default bundles a default one is made, but
the previous code was making multiple attempts to do that instead of
doing it once.
* Implements #get and #has - PlayersOnIsland method
Implements methods for #860
* Optimises #hasVisitors and #hasPlayersOnIsland
These methods will now check if there is at least one user that meets the conditions
* Implements an island reservation system using the admin register command
Admin flies to an empty spot and registers the player there. This
creates a bedrock block to mark the spot but it sets the island as
reserved for the target player. The next time a player issues the island
command (or island create) they get the selection of islands and it is
pasted at that location.
https://github.com/BentoBoxWorld/BentoBox/issues/749
* Update src/main/java/world/bentobox/bentobox/database/objects/Island.java
Co-Authored-By: Florian CUNY <poslovitch@bentobox.world>
* Update src/main/java/world/bentobox/bentobox/database/objects/Island.java
Co-Authored-By: Florian CUNY <poslovitch@bentobox.world>
* Update src/main/java/world/bentobox/bentobox/database/objects/Island.java
Co-Authored-By: Florian CUNY <poslovitch@bentobox.world>
* Update src/main/java/world/bentobox/bentobox/database/objects/Island.java
Co-Authored-By: Florian CUNY <poslovitch@bentobox.world>
https://github.com/BentoBoxWorld/BentoBox/issues/840
This adds (or fixes) the ability for admins to set the default setting
of a protection flag. The flags go in the world flags section of a game
mode's config.yml.
* Fixes owner demoting himself to subowner
This occurred whilst owner demoted himself to a subowner that led to non existence of the true owner
* Adds error on demote-yourself message
* Database abstraction WIP
* Removes code duplication in the databases
Fixes a regression bug on database connections - more than 1 were being
made again.
* Added ignores to tests because they run async now
* Adds a cooldown API for flags.
https://github.com/BentoBoxWorld/BentoBox/issues/754
Added 60 second cooldown to PVP flags
* Added cooldowns to database.
This way, if a cooldown is a long one it will be remembered even if the
server restarts.
* Update src/main/java/world/bentobox/bentobox/database/objects/adapters/FlagSerializer3.java