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.
* 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
Prevents blueprints from being saved unless they have a bedrock block in
them.
If a blueprint is loaded and does not have a bedrock block, one is added
and a warning given in the console.
Added test class for BlueprintClipboardManager
https://github.com/BentoBoxWorld/BentoBox/issues/777
* Fix NPE in PanelListenerTests
This will fix null-pointer.
One test will fail, as it is kinda bad as it conflicts with #761
* Re-ignored one of the test as it still fails
https://github.com/BentoBoxWorld/BentoBox/issues/731
Issue was that classes were not being fully removed from class loaders
and commands needed to be unregistered from Bukkit. For the latter,
reflection was required to obtain the knownCommand map and change it
because there is no Bukkit API to unregister commands.
Adds cooldown to island leave command.
Tries to mitigate cooldown bypassing by players who change island owner
or use subowner or members to issue invites instead of owner. Now the
cooldown is based on the island ID itself.
Original API's are kept for compatibility with addons that use
cooldowns.
Relates to https://github.com/BentoBoxWorld/BentoBox/issues/727
Related to https://github.com/BentoBoxWorld/BentoBox/issues/680
Redoes commit
095237cd5db3b7169df1275759c885b42d9d8d45#diff-fee448dd4d94f3c5faaab7655c47682c
Unknown flags in the database are now handled correctly. Added a test to
confirm correct operation.
* A prototype for Blueprint bundles and blueprints
This stores blueprints inside bundles. Each bundle can have up to 3
blueprints defines by the World.Environment.
This is not a finished manager. It just handles all the saving and
loading side of things. I thought this would help you so you can then
concentrate on the UI.
* WIP: Copy blocks to Blueprint done.
* WIP Pasting done.
* WIP: Added BlueprintsManager to ultimately replace SchemsManager.
* Moved blueprint suffix and changed to .blu
* Fixed unit test.
* Now tested and working.
Integrated with new island and resetting island.
If there are no blueprint bundles or blueprints then a default bedrock
set will be made and put in the game mode addon's blueprints folder.
Still to do: enable schems to be loaded and pasted for legacy support.
Add blueprints and a bundle to GameModeAddons like BSkyBlock.
* Renamed most of the classes
* Cleaned up clipboard and paster.
* Further cleanup on blueprint clipboard and paster.
* Merged blueprint classes into one package.
* Put Blueprint data objects in their own package.
Isolated schems classes for later removal.
* Renamed admin command classes and changed locale files.
* More clean up to remove schems
* Schem to blueprints converter done.
Converts schems to blueprint bundles and sets up a default set. Tested
the happy-path. Need to do more testing on edge cases.
* Added basic UI for development. Fixed bug with schem conversion.
* Adds permissions into the blueprints.
Fixes tests, cleans up some naming
* Added IslandCreationPanel and created BlueprintManagementPanel
* Fixed JSONDatabaseHandler's constructor being public
* Made the Blueprints button in ManagementPanel open the Blueprint management panel
* Fixed tests and ignored one (NPE)
Addons need to declare themseves when they register a flag so that the
flag listener can be reset. Note that this is not mandatory unless the
flag declares a listener
- JSON is now the default database type
- JSON database files are now pretty-printed
- It is now possible to migrate from a database type to another through the use of a command and specific transition database types
- It is recommended to move from YAML to JSON.
= Commits breakdown =
* Proposal to make JSON the default database and retire YAML.
* Make JSON file format easier to read.
* Fix tests.
* Adds a hybrid Yaml2Json database type.
This database always tries to use JSON if it is available. If a YAML
file is found, it will be loaded and replaced with a JSON file.
* Move to generic database transition code
* Better comments
* Adds transitional database options so admins can choose.
Adds Yaml2MySQL option and changes config.yml to add instructions.
* Enables full database migration between databases.
Adds /bbox migrate command.
Adds a number of transition databases. DB starts transition when the
server boots up and will migrate organically. The admin can force an
immediate update using the bbox migrate command.
This operation requires an API breaking change: Addons that use the
Config API must now implement ConfigObject in their config class instead
of DataObject. This is to differentiate YAML config classes from YAML
database classes. If a class is already implements WorldSettings
(GameModeAddons), then no change is required because WorldSettings
implements ConfigObject now. If an old addon is used that does not
implement ConfigObject, BentoBox will not load.
* Added null check to YAML deletion
* Removed the 2YAML transition dbs because YAML is deprecated.
YAML does not support some data structures so conversion could corrupt
data.
* Fixed some javadoc and added missing DatabaseType#JSON2MARIADB
* Renamed package database/transitiondb to database/transition
* Refactor of clipboard to separate out file saving/loading
There's now a clipboard manager to handle file system loading and saving
so that the clipboard works purely in blocks (YAML).
* Fixes a few bugs
* Renamed getClipBoard to getClipboard
* Version up 1.4.1-SNAPSHOT
* Sets pos1 and pos2 after pasting a loaded schem
Corrects version name in POM.
* Shifted schem name validation into SchemsManager
* Saves world settings to config.yml when they are changed mid-game.
* Fixes and adds to tests
* WIP: Added visibility settings for flags.
Tests still need to be fixed and requires saving to config.yml.
* Fixes tests
* Completed changes.
* Renames method to be hidden flags instead of visible settings
GameModeAddons will need to adjust WorldSettings API based classes.
https://github.com/BentoBoxWorld/BentoBox/issues/523
Uses safe-spot teleport to teleport players.
The spawn point of an island was not being set by the setspawn command.
The spawn point on the spawn island can now be reset using the setspawn
command.
If the spawn point does not exist, a safe spot will be found.
Added AdminSetspawnCommand test class.
The reason the test was failing was because the check on whether the
player had an island or not was not being done. I added the check back
in. So now, if a player has no island, the portal will just do nothing.
* WIP - adds admin commands to handle damaged island db
Trash, purge, etc.
DO NOT MERGE YET
https://github.com/BentoBoxWorld/BentoBox/issues/505
* Prefixes the island uniqueId with the game mode name.
This enables manual removal of old game mode island files from the
database by admins if required.
* Adds Admin trash and empty trash commands
* Adds various commands for trash management
* Remove unused imports
* Forgot the javadoc in IslandsManager
* WIP - See FlagListener.java for changes
Makes declaring the player mandatory for checkIsland method so it cannot
be forgotten and will be fresh every check.
See BlockInteractionListener for how it will look.
* Update src/main/java/world/bentobox/bentobox/api/flags/FlagListener.java
Co-Authored-By: tastybento <tastybento@users.noreply.github.com>
* Update src/main/java/world/bentobox/bentobox/api/flags/FlagListener.java
Co-Authored-By: tastybento <tastybento@users.noreply.github.com>
* Adjusted all the flags to new API
https://github.com/BentoBoxWorld/BentoBox/issues/535
due to race conditions with task timers and incorrectly shared field
variables, islands would not paste completely if pasted every tick.
Now pasting is handled in its own class with a new instance created with
each paste.
A lot of the commands were not firing events. These events are now
needed by addons.
Added new JOINED, REGISTERED, UNREGISTERED reasons for events.
Switched to using Bukkit.getServer() instead of plugin.getServer() in a
number of classes because the former can be mocked but the latter cannot
be because it's marked as a final method in JavaPlugin.
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/506
Also, admin unregister was blocking unregistration of team players, but
that is an artificial constraint, so I enabled it. Without it, it would
not be possible to correct weird team issues like this one after they
happen.
https://github.com/BentoBoxWorld/BentoBox/issues/486
Includes an autofixer for corrupted files and test for the adapter.
LogEntry was changed to just store strings instead of arbitrary types.
Unless the log serializer were to store hints as to what type of data
was being stored, it is impossible to deseralize. To make it all
simpler, we just store strings. If the UUIDs need to be converted back
to players are some point, that can be done based on the type of the log
stored.
Previous the Flags class was being used to grab all flags. This is wrong
because it may not contain all the flags that may exists, for example
ones registered by other addons. The correct way is to request flags
using the getFlag() method in the flags manager class.
This change was to prepare for the time when addons will register their
own flags with BentoBox.
Note: If using the User class in a test, you MUST set the mock plugin object using the User.setPlugin() method otherwise each test will use the wrong plugin object and verifications will not work.
Island deletion is done a few chunks at a time per tick. Current speed
is 5 chunks per tick per world (e.g., 15 chunks per tick if nether and
end islands are used).
Chunks are deleted based on the all-time maximum protection range of the
island. This is because the protection range can grow bigger or smaller
over the island's lifetime. To ensure all possible chunks are erased,
the largest every protection range is remembered and used.
Very large protection ranges will take a long time to fully delete.
Info on islands that are being deleted is stored in the database. If the
server shuts down mid-deletion, deletion will restart when the server
restarts.
While an island is being deleted, new islands cannot occupy that spot
and the spot cannot be reserved by the admin.
In addition, async approaches to island saving and player saving were
removed. Async will be implemented another way.
Now, instead of saving the full island or player database, individual
database entries are saved instead to be more efficient.
They respectively got renamed to Island#ban() and Island#unban(). They now require the UUID of an issuer (which can be null, but it's better to provide one)
AddonDescriptionBuilder has been renamed to AddonDescription.Builder ; and there is no longer public constructors in this class.
This change is obviously API breaking, but it's relatively "internal", so hopefully people didn't use it.
Speed of schem pasting is in the config.yml of BentoBox.
Old schems will work and paste async, but attached blocks, e.g.,
torches, may fall off due to being pasted ticks before the supporting
block is pasted. Newer schems will not have this issue.
Further work is needed to optimize entity pasting.
Known issue: if a player logs out during the pasting, things go wrong
until the next reload. Needs investigation and mitigation.
There's no mitigation against the server shutting down or crashing
mid-paste.
This was a bigger job than expected. I moved the addon loading locale
stuff into the LocalesManager class from the AddonsManager and put a jar
file lister in Utils. There could be some more combining of plugin jar
and addon jar file finding there. Finally, I added a sophisticated test
that creates a temporary addon jar with a locale file and checks that it
is saved correctly. Phew!
Flag was marked as deprecated, which may be okay, but because it caused
a lot of warnings in the tests because they bypass the builder I removed
the deprecation but kept the warning in the JavaDoc.
This will load all schems in an add-on's schem folder if it exists and
associate them with this world set (overworld, nether and end). Schems
can be named anything, but the partner nether or end worlds must be
pre-fixed with "nether-" or "end-" in the filename.
Additional schems can be added by the admin into the schem folder, or
they can be stored in the jar file of the add-on. Both are supported.
No changes are required to current add-ons. I.e., there is no API
breakage here, but I would like to rename the SchemsManager method
loadIslands(World world) to be loadSchems(World world) in the future.
Related issues/PR:
https://github.com/BentoBoxWorld/BentoBox/issues/104https://github.com/BentoBoxWorld/BentoBox/issues/207https://github.com/BentoBoxWorld/BentoBox/issues/378https://github.com/BentoBoxWorld/BentoBox/pull/408
This will improve the consistency of the code, as well as the Javadocs.
Locales (and some other files) still need to be updated to remove these references to team leader.
Fixes#281
Replaced Addon#setEnabled(boolean) with Addon#setState(Addon.State).
Now, if an exception gets thrown while enabling an addon, it'll automatically stop enabling it and set its state to "INCOMPATIBLE" or "ERROR". These values could later be get to be displayed in the version command.
I edited it so it only happens on BentoBox's panels. Having it closing "every" inventory was causing issues with vanilla inventories (crafting table, etc...)
I could not fix the related tests though : PanelListenerManagerTest#testOnInventoryClickOutside (PanelListenerManagerTest.java:128) is failing every time.
Removed purge-related settings.
Renamed all database-related settings and methods to replace `db` with `database`.
Moved confirmationTime to `island.confirmation.time`.
Renamed inviteWait, banWait and resetWait to inviteCooldown, banCooldown, resetCooldown. Also moved them under `island.cooldown.x`.
Removed kickWait and leaveWait, using confirmationTime instead.
Moved `island.require-confirmation.<command>` to `island.confirmation.commands.<command>`.
Updated tests.
Updated getters and setters using code automation. Sadly, this wiped out all the Javadoc.
Also commented out CellState.RESERVED.
That was a tough one. I had to rewrite IslandGrid#getIslandAt(int, int) quite a few times before using the stream() thing. I tested it a bit - it seems it is working like a charm.
I just hope that it won't be something useless - another plumbing change that adds nothing. It shouldn't - because of the "RESERVED" thing - but, well... it's been quite a hard thing!
Hopefully, this is the last API breaker. I renamed the classes that
started with BSB to be just BB (bentobox). I now have to fix all the
add-ons I just broke...
Added reference about and info commands. These command run across worlds
and currently have no perms associated with them.
The main point was to enable BentoBox to have is own commands.
This API enables any command to have a cool down and to have that cool
down called by another command. For example, the Kick command sets the
cool down on the Invite command. It is possible for commands to set cool
downs on themselves too.
Currently, cool downs are not stored persistently in the database so
they disappear if the server is reloaded. This should be okay for now.
There are some weird NPE's that I couldn't work out in the test classes.
They do not occur when the class is run by itself, only when it is run
with all the others so I don't know why it is happening.