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
* API addition - adds reset deaths on new island
BentoBox currently tracks deaths in the worlds but the current API only
allows them to be reset when a player joins a team. This setting enables
deaths to be reset when a player starts a new island or resets an
island.
WARN: This should be the only additional WorldSetting we need for deaths.
* Update src/main/java/world/bentobox/bentobox/api/configuration/WorldSettings.java
* Update src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java
* Update src/main/java/world/bentobox/bentobox/managers/island/NewIsland.java
* Update src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java
Database closing was occuring too early. In priort releases it was
hidden because the connection would be automatically made again. When
this was removed, it exposed this error.
Now the single database connection will not be closed until all
registered database objects have finished with their async queues.
Further, the database connecter was being made once for each database
type. This was a waste of resources and it also meant that static fields
were being used. Now, only one database connecter object is made and
there are no static fields.
https://github.com/BentoBoxWorld/BentoBox/issues/813
* Add asynchronous task
* First commit
* Add asynchronous tasks for Blueprint.
* Add BlueprintSchematicConverter class to convert schematic in blueprint and inversely
* BlueprintClipboardReader, BlueprintClipboardWriter and BlueprintClipboardFormat have been added !
* BlueprintClipboardReader, BlueprintClipboardWriter and BlueprintClipboardFormat have been added !
* javadoc in BlueprintClipboardFormat
* Rename src/main/java/world/bentobox/bentobox/blueprints/BlueprintClipboardFormat.java to src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintClipboardFormat.java
* Update and rename src/main/java/world/bentobox/bentobox/blueprints/converter/BlueprintClipboardReader.java to src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintClipboardReader.java
* Update and rename src/main/java/world/bentobox/bentobox/blueprints/converter/BlueprintClipboardWriter.java to src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintClipboardWriter.java
* Update and rename src/main/java/world/bentobox/bentobox/blueprints/converter/BlueprintSchematicConverter.java to src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintSchematicConverter.java
https://github.com/BentoBoxWorld/BentoBox/issues/805
Database connectors were creating a new connection every time they were
called. Also the top-level database object was being recreated every
time getDatabase was requested.
Fixes#793
Add missing database transitions from YAML to MongoDB and SQLite.
Add missing database transitions from JSON to MongoDB and SQLite.
Add database transitions from SQLite to JSON.
Add database transitions from MongoDB to JSON.
Add database transitions from MariaDB to JSON.
* Added SQLite database
#570
* Makes SQLite work. Added config.yml option.
Tested on SQLite 3.24.0 2018-06-04 14:10:15
95fbac39baaab1c3a84fdfc82ccb7f42398b2e92f18a2a57bce1d4a713cbaapl
* Fix mariaDB test for close.
* Added test to MySQLDatabaseConnector and Handler