Commit Graph

837 Commits

Author SHA1 Message Date
tastybento
6cd8c70bd4 Pastes default nether or end blueprints if island doesn't exist
Fixes issue where the nether-island or end-island named blueprints were
deleted.

https://github.com/BentoBoxWorld/BentoBox/issues/943
2019-09-15 14:10:52 -07:00
tastybento
6e3e3561c1 Cleans directory before deleting. 2019-09-14 16:40:30 -07:00
Florian CUNY
1ccc1822a7 Fixed one of BlueprintsManagerTests to be less OS-dependant 2019-09-14 22:03:23 +02:00
tastybento
6154e65b6e Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2019-09-13 20:44:03 -07:00
tastybento
5164b1a02d Leader should not see kicked message
Adds test to make sure leader does not see kicked string and fixes
ignores.
2019-09-13 20:41:14 -07:00
tastybento
797f7146dc Fixed standard nether and end spawn protection. Added test class.
https://github.com/BentoBoxWorld/BentoBox/issues/927
2019-09-12 16:53:35 -07:00
Florian CUNY
5f65ba5968 Ignored error-ing tests
I need to learn how to deal with it, but for now I'd like 1.7.0 to be released before I got to go.
2019-09-08 15:52:14 +02:00
tastybento
46a432e75f Fix tests 2019-09-07 14:45:15 -07:00
tastybento
49d8cd8791 Added BlueprintManagementPanel test class 2019-09-04 16:08:50 -07:00
tastybento
60d7dfef85 Adds constructor to IslandResetCommand to allow no pasting
This is for games like SkyGrid that do not need pasting of a blueprint.
2019-08-30 10:16:05 -07:00
tastybento
fa4c772572 Fixes IslandResetCommand test 2019-08-29 15:32:50 -07:00
tastybento
87168a5ea9 Compile against Spigot 1.14.4 (#919)
Fixes #914.

* Shifts to compile with 1.14.4 API.

Note that this will make some events incompatible with 1.13.2 because of
a class not found error.

* WIP

* Fixed deprecated APIs and ItemStackAdapter test case

* Fixes enderchest test bug.

* Updated server version compatibilities in ServerCompatibility
2019-08-29 21:18:45 +02:00
Florian CUNY
bf6659708c Ignored failing tests 2019-08-29 20:57:26 +02:00
tastybento
b0813e308d Added IslandSpawnCommand test class 2019-08-28 15:13:16 -07:00
tastybento
52d0544726 Rewrote JSON object loading to avoid throwing exception
Related to 68f90edb2f
2019-08-27 09:08:22 -07:00
tastybento
a2c42ffcc7 Added IslandInfoCommand test case.
Fixed bug where info with a name would only work with island owners.
2019-08-25 18:13:45 -07:00
tastybento
495c82a720 Added admin getrank command test class.
Fixed bug with getrank permission.

PDX > SJC
2019-08-25 12:49:54 -07:00
tastybento
6808e755d0 Fixes entry event and messaging when teleporting from another world
https://github.com/BentoBoxWorld/BentoBox/issues/911
2019-08-21 21:19:52 -07:00
tastybento
a0e1382875 Added event checking to enter/exit test class 2019-08-21 18:03:28 -07:00
tastybento
33b4c70f25 Adds tabbed panel method to hide tab if it is empty.
https://github.com/BentoBoxWorld/BentoBox/issues/896
2019-08-17 19:08:00 -07:00
tastybento
08e520565d Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2019-08-16 08:27:05 -07:00
tastybento
3e827068c9 Fixes trident vanishing when visitor attacks mobs
https://github.com/BentoBoxWorld/BentoBox/issues/846
2019-08-16 08:26:56 -07:00
tastybento
b9215d62b8 Added IslandDeletionManager test class 2019-08-15 12:53:20 -07:00
tastybento
fce8a65501 Shifted unban command to canExecute API and updated test class. 2019-08-14 10:49:04 -07:00
Florian CUNY
1ae3171340 Removed deprecated methods/classes
PremadeEvent, NewIsland.Builder#world()
2019-08-13 11:14:53 +02:00
tastybento
fb169304cc Pegs banlist command to same rank level as ban command
https://github.com/BentoBoxWorld/BentoBox/issues/891
2019-08-12 19:13:29 -07:00
tastybento
e86fb09cf9 Allows island team members as well as the owner to see the ban list
https://github.com/BentoBoxWorld/BentoBox/issues/891
2019-08-12 18:49:02 -07:00
tastybento
54f44cf30f Range permission was not used when making new island
https://github.com/BentoBoxWorld/BentoBox/issues/664

Added test class for NewIsland class
2019-08-10 15:11:46 -07:00
tastybento
b5202c3944 Code smell improvements and null protections 2019-08-10 11:44:29 -07:00
tastybento
186b14a67f Adds Wither damage world settings flag. 2019-08-10 11:40:07 -07:00
Florian CUNY
8119b5c99e Moved Flag events to api/events/flags package 2019-08-10 13:15:33 +02:00
tastybento
21fd9e9e1a Fix for console error when using the player command in console
https://github.com/BentoBoxWorld/BentoBox/issues/886
2019-08-09 14:08:21 -07:00
tastybento
1e04e480a7 Added test case to FlagTest 2019-08-07 22:43:22 -07:00
tastybento
d4814a6219 Added BlockEndDragon test and reduced code duplication 2019-08-07 22:35:49 -07:00
tastybento
dc728ba0dc Added test class for LanguagePanel 2019-08-07 21:13:59 -07:00
tastybento
44cbd81320 Moved to Mockito 2 and PowerMock 2019-08-04 21:44:46 -07:00
tastybento
be673fa527 Switched to latest Mockito and PowerMockito libs. WIP 2019-08-03 18:05:15 -07:00
tastybento
13ee55a173
Tab panels (#857)
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
2019-08-03 16:45:41 -07:00
tastybento
d622c12425 Fixes island creation on reservation.
New island panel was not being shown to reserved island players when
using /island or /island go.

https://github.com/BentoBoxWorld/BentoBox/issues/875
2019-08-02 10:29:41 -07:00
tastybento
91077ef895 Fixes NPE with island ban of an offline player
https://github.com/BentoBoxWorld/BentoBox/issues/872
2019-08-02 09:22:12 -07:00
tastybento
5de285249f Make getPermissionPrefix consistent
https://github.com/BentoBoxWorld/BentoBox/issues/870
2019-07-29 12:00:45 -07:00
tastybento
0f5629b729 Adds new flag change events and fires them.
Updated click tests.

https://github.com/BentoBoxWorld/BentoBox/issues/753
2019-07-28 16:15:23 -07:00
tastybento
ff91255a6a Prevents setting rank of visitor or lower.
https://github.com/BentoBoxWorld/BentoBox/issues/849

Adds test class for admin setrank command.
2019-07-27 21:01:14 -07:00
tastybento
65aee40533 Code smell cleanup 2019-07-27 17:19:04 -07:00
tastybento
10b8c51aee Make superflat check more accurate
Will allow fix superflat to run in SkyGrid.

https://github.com/BentoBoxWorld/SkyGrid/issues/22
2019-07-27 10:47:48 -07:00
tastybento
2403cd201f Fixes tests, removes debug. 2019-07-27 10:43:58 -07:00
tastybento
6926ecbb9e Implements an island reservation system using the admin register command (#850)
* 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>
2019-07-22 00:36:14 +02:00
tastybento
74372b391a Prevents items from disappearing when blocked from breaking blocks
https://github.com/BentoBoxWorld/BentoBox/issues/846
2019-07-18 22:43:35 -07:00
tastybento
e99f84f7c7 Prevents named mobs from being cleared on teleport.
Adds a setting in BentoBox config to set the clear radius.
Adds defensive code to avoid clearing mobs in non game worlds.

https://github.com/BentoBoxWorld/BentoBox/issues/847
https://github.com/BentoBoxWorld/BentoBox/issues/819
2019-07-18 21:58:16 -07:00
tastybento
e284a6b57a Adds ability to require players to stand still for a command to execute
https://github.com/BentoBoxWorld/BentoBox/issues/837
2019-07-13 22:32:09 -07:00
tastybento
5fe4cccf7b Corrects wrong branch commit for world protection flags.
https://github.com/BentoBoxWorld/BentoBox/issues/840
The previous commit was a different approach. This is the correct one.
Does not break API.
2019-07-13 19:31:20 -07:00
tastybento
574fbc182f Added world protection settings to config
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.
2019-07-13 15:25:10 -07:00
tastybento
9422f8ac3d Added purge protection command and test class for purge.
Note that game mode addons must add the purge command before it can be
used.

https://github.com/BentoBoxWorld/BentoBox/issues/836
2019-07-11 22:50:32 -07:00
tastybento
3f3ac57f1e Cleans up code smells. 2019-07-11 13:55:17 -07:00
tastybento
1c1996ba4c SQL Database abstraction (#831)
* 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
2019-07-11 09:31:28 +02:00
tastybento
060c602009
Makes command ranks a protection setting (#823) 2019-07-08 20:02:58 -07:00
tastybento
44003773c7 Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2019-07-06 23:33:22 -07:00
tastybento
abd88c0826 Adds a cooldown API for flags. (#821)
* 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
2019-07-07 08:08:16 +02:00
tastybento
8b79ce3b3e Removes nether trees (#822)
https://github.com/BentoBoxWorld/BentoBox/issues/746

NOTE: The settings will need to be removed from the game mode addons too otherwise it will be confusing to admins.
2019-07-07 07:52:48 +02:00
tastybento
3f29c29243 Import cleanup 2019-07-06 22:05:47 -07:00
tastybento
6634a4e1f5 Fixes issue with hostile mobs not being removed on teleport
https://github.com/BentoBoxWorld/BentoBox/issues/818
2019-07-06 13:42:25 -07:00
tastybento
d6b0859d40 Teleports void visitors to same environment as they left.
https://github.com/BentoBoxWorld/BentoBox/issues/814
2019-07-05 21:46:09 -07:00
tastybento
edd7bbf97a A lot of database work.
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
2019-07-05 20:11:06 -07:00
tastybento
014c5d574f Fixes clean super flat tests. 2019-07-05 20:07:19 -07:00
tastybento
b1f66eb31b Fixes bugs and code smells from Sonarcloud. 2019-07-04 16:54:05 -07:00
tastybento
349f339be3 Fixed tests for BlueprintsManager.
https://github.com/BentoBoxWorld/BentoBox/pull/811
2019-07-04 13:08:50 -07:00
Florian CUNY
9fdf320fdf Ignored failing/errors in BlueprintsManagerTest 2019-07-04 13:26:46 +02:00
Florian CUNY
6759a8acc9 We're no longer switching the player to SPECTATOR mode when teleporting
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/786
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/578
2019-07-03 10:36:50 +02:00
tastybento
bd69179354 Ensures a single database connection is used. (#807)
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.
2019-07-02 06:46:54 +02:00
Florian CUNY
64d89f9ca9 Improved success messages for admin commands and fixed failing tests
#630
2019-06-30 08:51:33 +02:00
Florian CUNY
6ceebe09ce Fixed tests 2019-06-30 08:24:55 +02:00
Florian CUNY
e7133b2176
Added SQLite database (#791)
* 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
2019-06-28 08:33:43 +02:00
Florian CUNY
eb37beb79c Ignored failing tests 2019-06-27 14:39:34 +02:00
tastybento
1f4fa0e203 Fixes bug where NPC inventories were protected by the container flag
https://github.com/BentoBoxWorld/BentoBox/issues/788
2019-06-26 20:51:02 -07:00
tastybento
3f217e30ad Adds involved player UUID to IslandDeleteEvent
https://github.com/BentoBoxWorld/BentoBox/issues/790
2019-06-26 19:03:56 -07:00
Florian CUNY
bfcc50aeed Fixed CleanSuperFlatListener tests 2019-06-23 09:09:54 +02:00
tastybento
99d34d06ba Better blueprint bedrock handling
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
2019-06-22 22:44:33 -07:00
tastybento
a0e35b240b Added BlueprintsManagerTest and improved BlueprintsManager 2019-06-15 09:47:05 -07:00
BONNe
492361663e Fixed NPE in PanelListenerManager tests (#764)
* 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
2019-06-14 14:03:08 +02:00
Florian CUNY
7c6f6a991b Ignored failing tests 2019-06-14 10:34:53 +02:00
Florian CUNY
ad3cb821f4 Fixed BentoBoxReloadCommandTest 2019-06-12 13:25:28 +02:00
tastybento
d5be5f81c2 Fixes and adds tests for IslandCreateCommand
Tests were failing from 824a744cd1
2019-06-09 17:18:17 -07:00
tastybento
e4026928cd Completely redid the MySQL tests and added MariaDB tests 2019-06-08 23:01:20 -07:00
tastybento
fc2de2501c Added assertions to tests per SonarCloud 2019-06-08 19:14:25 -07:00
Florian CUNY
272e99bc12 Close all panels on plugin disable (#743)
* Close all panels on plugin disable
https://github.com/BentoBoxWorld/BentoBox/issues/726

* Adds panel closing to bbox reload and fixes errors.
2019-06-08 19:13:19 -07:00
tastybento
c463ad0ea0 Fixed and added to InventoryListenerTest 2019-06-08 17:02:06 -07:00
tastybento
88a3ebbf2a Removed sum deaths setting.
This setting was originally for the ASkyBlock level calculation and so
should go into the Level addon, not BentoBox.
2019-06-08 09:05:49 -07:00
tastybento
efdb9a25dc Implements kicked-keep-inventory config setting.
https://github.com/BentoBoxWorld/BentoBox/issues/738
2019-06-07 22:18:34 -07:00
tastybento
ccdfccdf09 Removes a reset from player if they leave an island
https://github.com/BentoBoxWorld/BentoBox/issues/738
2019-06-07 21:33:29 -07:00
tastybento
f0baeece3d Added sum deaths setting support.
Other items WIP
https://github.com/BentoBoxWorld/BentoBox/issues/738
2019-06-07 21:00:13 -07:00
tastybento
899315b437 Fixes tests. 2019-06-07 19:14:28 -07:00
tastybento
9b8c8f6bc8 fixes issue with bbox reload command
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.
2019-06-07 17:37:16 -07:00
tastybento
7b2e8a657e Rewrite of cooldowns to use island ID instead of player ID
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
2019-06-05 22:55:32 -07:00
tastybento
f6bc6c6415 Adds check for players online for offline growth listener.
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/729
2019-06-03 19:55:44 -07:00
tastybento
5a6b1862a0 Added Island Creation Panel Test.
Fixed bugs with slot management.
2019-06-02 16:49:20 -07:00
tastybento
9b0575246c Reworked island team coop command and test. 2019-06-01 13:22:28 -07:00
tastybento
0ab56028dc Fixed bug with Addon for saving non-existent files from jar
Improved addon tests.
2019-06-01 12:23:29 -07:00
tastybento
2946e3c298 Fixes superflat generation with Multiverse
https://github.com/BentoBoxWorld/BentoBox/issues/716
2019-05-30 23:04:23 -07:00
tastybento
c7f2eb5f2a Fixes drop into block after island reset issue.
https://github.com/BentoBoxWorld/BentoBox/issues/705
2019-05-29 17:13:22 -07:00
tastybento
607d92868e Hides deprecated flags from the flags list.
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.
2019-05-28 09:30:21 -07:00
tastybento
f5338bfaac Fix tests 2019-05-26 17:35:19 -07:00
tastybento
7882a77b14 Small optimization around utility sameworld check
May improve https://github.com/BentoBoxWorld/BentoBox/issues/676
2019-05-26 17:19:31 -07:00
tastybento
a00dedbdc4 Fixed tests.
Relates to https://github.com/BentoBoxWorld/BentoBox/pull/692
2019-05-23 20:09:35 -07:00
tastybento
700043fe40 Implemeted Blueprint bundles and blueprints (#672)
* 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)
2019-05-15 20:16:41 +02:00
tastybento
877046fe8c Fixes PanelListenerManagerTest
The InventoryView interface uses final methods so it cannot be mocked.
This test implements the interface so that the code can be tested.
2019-05-15 08:57:11 -07:00
tastybento
9437b916e0 Ignored PanelListenerManager tests 2019-05-14 13:29:14 +02:00
tastybento
d631d2cb86 Fixes user tests. 2019-05-11 08:28:10 -07:00
Florian CUNY
3f83a89215 Added placeholders replacement in BentoBox's own messages
It is now possible to use external placeholders into BentoBox's messages.
2019-05-11 16:11:57 +02:00
tastybento
8ce47772c2 Addon reloading: adds parameter to register flag
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
2019-05-10 15:18:13 -07:00
tastybento
91b650bdee Added BoundingBoxTypeAdapter for database storage
Renamed other adpaters to be TypeAdapters for consistency.
2019-05-08 15:33:40 -07:00
tastybento
2e8150da84 Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git
into develop

Conflicts:
	src/main/java/world/bentobox/bentobox/managers/AddonsManager.java
2019-05-08 12:23:28 -07:00
tastybento
01022a2500 Added bentobox addon reload command. 2019-05-08 12:18:33 -07:00
tastybento
180b88544a Database transition (#662)
- 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
2019-05-08 21:15:22 +02:00
Florian CUNY
3c688a0b12 Ignored failing tests 2019-05-08 11:39:04 +02:00
tastybento
d8799f183f Makes copying schems to the clipboard async.
https://github.com/BentoBoxWorld/BentoBox/issues/504
2019-05-05 16:39:11 -07:00
tastybento
2f1bc509fa Change cycle click test to test Travis 2019-05-04 22:36:16 -07:00
Florian CUNY
a594427c5a Fixed tests 2019-05-04 22:26:26 +02:00
tastybento
4472817b07 Removed tests. 2019-04-28 07:32:42 -07:00
tastybento
8a885eac7f Refactor of clipboard to separate out file saving/loading (#641)
* 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
2019-04-28 13:41:24 +02:00
Florian CUNY
6100420bae Added better success messages to admin team commands
#630
2019-04-28 11:21:58 +02:00
Florian CUNY
f333cfbe6f Added [name] textvariable to admin setowner command 'already-owner' message 2019-04-28 11:15:26 +02:00
Florian CUNY
722f136e3f Added better success message to AdminTeamKickCommand
#630
2019-04-28 10:39:31 +02:00
Florian CUNY
3ef6529c40 Added better success messages for admin deaths and island team kick commands
#630
2019-04-28 10:21:35 +02:00
Florian CUNY
c2659b8d12 Merge remote-tracking branch 'origin/develop' into develop 2019-04-27 21:05:03 +02:00
Florian CUNY
8ba0ebd170 Added better success feedback messages for IslandBanCommand and IslandUnbanCommand
#630
2019-04-27 21:03:40 +02:00
tastybento
cfee1229d1 Uses BoundingBox for copying blocks to schems
https://github.com/BentoBoxWorld/BentoBox/issues/636
2019-04-22 07:35:54 -07:00
tastybento
7499b19fea Added offline message event.
This event is fired if the player is offline but the recipient of a
message.
2019-04-17 22:22:16 -07:00
tastybento
4e73d7de5a Improvements to the Paster (#632)
* 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
2019-04-14 01:54:04 +02:00
tastybento
f5ad5aa2c9 Improves API and JavaDocs for getMembers (#628)
* Improves API and JavaDocs for getMembers

https://github.com/BentoBoxWorld/BentoBox/issues/627

* Fixed indentation in Island
2019-04-10 15:40:54 +02:00
Florian CUNY
af2f600621 Fixed tests in IslandResetCommandTest 2019-04-08 11:34:51 +02:00
Florian CUNY
38875829b9 Ignored PlaceholdersManagerTest tests - could not fix them 2019-04-08 10:34:25 +02:00
Florian CUNY
5dd7796be4 Deprecated GameModePlaceholderManager
GameModePlaceholderManager#registerGameModePlaceholders(...) is now handled by PlaceholdersManager#registerDefaultPlaceholders(...).
2019-04-07 20:59:21 +02:00
Florian CUNY
e66f3842b7 Fixed GameModePlaceholderManager tests 2019-04-07 10:13:34 +02:00
Florian CUNY
1c2d3bed41 Fixed missing import 2019-03-28 20:11:55 +01:00
Florian CUNY
b72b5830a8 Removed no longer needed tests (due to spigot's nullability annotations) 2019-03-28 20:08:54 +01:00
Florian CUNY
5073d9cf5c Fixed code smells 2019-03-24 15:47:25 +01:00
tastybento
2912ae18d2 Auto add default placeholders for GameModeAddons (#616)
https://github.com/BentoBoxWorld/BentoBox/issues/322
2019-03-24 15:30:58 +01:00
tastybento
23491d0c4a
Flag visibility (#617)
* 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.
2019-03-23 15:38:06 -07:00
tastybento
cab584d13d Saves world settings to config.yml when they are changed mid-game. (#615)
Addresses https://github.com/BentoBoxWorld/BentoBox/issues/614
2019-03-23 21:54:45 +01:00
tastybento
7990378355 Adds island expel command.
Requires GameModeAddons to use it.

https://github.com/BentoBoxWorld/BentoBox/issues/524
2019-03-21 20:41:30 -07:00
tastybento
05e542442e Adds an admin schem list command and test class
Lists available schems for game mode

https://github.com/BentoBoxWorld/BentoBox/issues/563
2019-03-20 22:33:30 -07:00
tastybento
39c3861391 Item Frames could be placed on any island.
https://github.com/BentoBoxWorld/BentoBox/issues/610
2019-03-17 15:18:19 -07:00
tastybento
60b075c668 Fixes bug where coop or trusted could sethomes on other islands
https://github.com/BentoBoxWorld/BentoBox/issues/588
2019-03-13 00:01:23 -07:00
tastybento
fd7e3e4154 Changed approach to support test concurrency 2019-03-12 20:35:33 -07:00
tastybento
adf0b8247f Added database test classes for YAML 2019-03-11 22:53:40 -07:00
tastybento
384047329f Added Database class unit test class 2019-03-11 20:26:41 -07:00
tastybento
015f1dd694 Fixed setUp name of method 2019-03-11 19:01:45 -07:00
tastybento
a2631b88a6 Removed static and server calling from test class. 2019-03-11 19:00:05 -07:00
tastybento
cfa6861e58 Added IslandCreateCommand test and use of canExecute API. 2019-03-09 22:09:54 -08:00
tastybento
a6e72ec018 Small change to CustomIslandMultiHomeHelp test. 2019-03-09 22:09:11 -08:00
tastybento
e0a8831ae0 Added test class for CustomIslandMultiHomeHelp class 2019-03-09 21:22:00 -08:00
tastybento
2cdbc25f6a Rewrote Flag test class for better coverage 2019-03-09 20:55:54 -08:00
tastybento
127bc1e338 Removed extraneous BeforeClass from Flag test class 2019-03-09 19:33:18 -08:00
tastybento
ac079a6686 Improved PanelItemBuilder test class 2019-03-09 19:31:18 -08:00
tastybento
91dec86b5a Added tests to SafeSpotTeleport test class 2019-03-09 19:31:06 -08:00
tastybento
78d45364aa Improved FireListener test class 2019-03-09 19:30:49 -08:00
tastybento
58a975b5a5 Cleaned up MobSpawnListener test class. 2019-03-09 18:55:29 -08:00
tastybento
a1e6f37963 Fixes HurtingListener test class 2019-03-09 18:50:34 -08:00
tastybento
9f997f4548 Fixes MobSpawnListener test class 2019-03-09 18:50:19 -08:00
tastybento
ee5a2c920b Added Panel Test class.
Fixed bugs with head requesting.
2019-03-09 18:43:27 -08:00
tastybento
8f24e59a21 Fixes IslandsManager test cases and pufferfish removal
The clear area method should not remove pufferfish as per
https://github.com/BentoBoxWorld/BentoBox/pull/595
2019-03-09 16:54:54 -08:00
tastybento
16388e4721 Added Notifier test class 2019-03-09 16:42:46 -08:00
tastybento
d4d1b77c24 Added test class for island team invite accept command.
Reduced complexity of command.
2019-03-07 22:57:49 -08:00
tastybento
7471dd6f2e Enable Ops to adjust any island settings including spawn island
https://github.com/BentoBoxWorld/BentoBox/issues/599
2019-03-07 10:02:40 -08:00
tastybento
9742c1f0e3 Fixes NPE when going through a non-BentoBox world portal.
https://github.com/BentoBoxWorld/BentoBox/issues/583

Caused by a failure to check that world was in the known BentoBox worlds
before calling the IWM method.
2019-03-06 21:38:15 -08:00
tastybento
f0b57a3a64 Fixes test for offline redstone listener 2019-03-06 21:28:20 -08:00
Florian CUNY
2bb4301af7 Removed unneeded dangling javadoc in newly created test classes 2019-03-04 08:38:29 +01:00
tastybento
c004c8e4a4 Added InventoryListener test class. 2019-03-03 22:26:52 -08:00
tastybento
326d6d033c Added BucketListener test class. 2019-03-03 21:53:43 -08:00
tastybento
e9dc678a08 Added EggListener test class. 2019-03-03 21:28:43 -08:00
tastybento
9659610b11 Added BreakBlocksListener test class.
Also added a way to trap null location checks with checkIsland in
FlagListener.
2019-03-03 21:18:38 -08:00
Florian CUNY
f1b24a45d3 Fixed IslandEnterEvent and IslandExitEvent not being called if Flags#ENTER_EXIT_MESSAGES was set to false 2019-03-03 17:39:58 +01:00
Florian CUNY
4f7de44b67 Fixed tests 2019-03-03 15:33:54 +01:00
tastybento
2664acbe47 Adds null check for world in portal teleport listener
This should not occur, but apparently, it can sometimes.

https://github.com/BentoBoxWorld/BentoBox/issues/583
2019-02-26 08:19:05 -08:00
Florian CUNY
7da7dd4884 Added a better "not-in-team" message for AdminTeamKickCommand
#577
2019-02-24 11:22:33 +01:00
Florian CUNY
73417fd990 Fixed AdminTeamKickCommand not working properly
#577
2019-02-24 11:11:25 +01:00
Florian CUNY
29eb4b0486 Disabled the whole GitHub connectors thing and hid related settings 2019-02-22 10:03:04 +01:00
Florian CUNY
e361d9867c Fixed PVPListenerTest 2019-02-21 22:32:58 +01:00
tastybento
b711f3fd6c Fixes assertion error. 2019-02-21 12:42:53 -08:00
tastybento
83827da448 Fixes a number of issues with spawn island setting
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.
2019-02-21 10:46:29 -08:00
tastybento
160ef002e4 Fixes island coords that are not on the grid.
https://github.com/BentoBoxWorld/BentoBox/issues/549
2019-02-20 21:42:43 -08:00
tastybento
da464621e0 Enables negative values in numbered permissions.
https://github.com/BentoBoxWorld/BentoBox/pull/560
2019-02-20 12:33:30 -08:00
tastybento
c01bd2e784 Fix admin unregister test. Checks canExecute, not execute. 2019-02-20 11:58:08 -08:00
Florian CUNY
fa1325bf14 Fixed IslandSethomeCommandTest 2019-02-20 11:20:14 +01:00
tastybento
96dda2c96d Fixed portal teleportation listener
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.
2019-02-19 23:27:11 -08:00
tastybento
e56d6715af Fixed default help command test class 2019-02-19 23:03:17 -08:00
tastybento
dfc667953f Fixed team kick test class 2019-02-19 22:49:48 -08:00
Florian CUNY
9b1e955d18 Added Flags#FLINT_AND_STEEL, Flags#FIRE_BURNING, Flags#FIRE_IGNITE and removed Flags#FIRE + fixed Flags#FIRE_SCOOPING description in en-US locale
Closes #414

commit 0b551d174289ea1b75e55f0f4d268592a716f66f
Author: Florian CUNY <poslovitch@bentobox.world>
Date:   Tue Feb 19 10:50:08 2019 +0100

    Updated FireListenerTest

commit 3f2cc83037e1994a686bacd4d8541eece8c9dc53
Author: Florian CUNY <poslovitch@bentobox.world>
Date:   Tue Feb 19 10:40:46 2019 +0100

    Added descriptions in en-US for FIRE_BURNING, FIRE_IGNITE and FLINT_AND_STEEL

commit 880df9e904a0121804a73c2fcb40b9faa2aa290b
Author: Florian CUNY <poslovitch@bentobox.world>
Date:   Tue Feb 19 10:35:54 2019 +0100

    Fixed description of FISH_SCOOPING

commit 02259b0f8fdad31e7431d4d525b74bee6b499813
Author: Florian CUNY <poslovitch@bentobox.world>
Date:   Tue Feb 19 10:34:54 2019 +0100

    Improved description of FIRE_SPREAD

commit 92c5d137d8fb114dacdebc32626e04a5ee16982b
Author: Florian CUNY <poslovitch@bentobox.world>
Date:   Tue Feb 19 10:30:17 2019 +0100

    Added Flags#FIRE_BURNING and Flags#Fire_IGNITE

    These are SETTING flags

commit 0be4a87c1986a55a15fa16e87e4073921a269e34
Author: Florian CUNY <poslovitch@bentobox.world>
Date:   Tue Feb 19 10:21:52 2019 +0100

    Added Flags#FLINT_AND_STEEL

    #414
2019-02-19 10:56:11 +01:00
Florian CUNY
b9bc394945 Ignored failing tests 2019-02-17 15:10:40 +01:00
tastybento
bce17ce467 Added admin trash command to handle damaged island db (#546)
* 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
2019-02-17 13:32:05 +01:00
Florian CUNY
af6ec400d1 Fixed tests 2019-02-16 22:58:46 +01:00
Florian CUNY
3aefdc449d Renamed NetherPortals to PortalTeleportationListener
It is a way more explicit and conventional name, in my opinion!
2019-02-16 11:17:48 +01:00
Florian CUNY
a364128c5e Extracted standard nether/end spawns protection into its own listener
It was previously handled in the NetherPortals listener
2019-02-16 11:09:34 +01:00
Florian CUNY
5d7a7a0363 Ignoring NetherTreesListenerTest for now 2019-02-16 10:59:30 +01:00
Florian CUNY
9803a02471 Added NonNull to all listeners constructors 2019-02-16 10:58:25 +01:00
Florian CUNY
16c4c9b0be Revert "Fixed errors in tests"
This reverts commit b7f9892d95.
2019-02-16 10:48:41 +01:00
Florian CUNY
44729ae9cb Moved NetherTreesListener to the correct package 2019-02-14 11:34:33 +01:00
Florian CUNY
b7f9892d95 Fixed errors in tests
However, tests are still failing!
2019-02-14 11:32:16 +01:00
Florian CUNY
7ac5f556a1 Started NetherTreesListenerTest
I haven't worked that much on it yet. I've got tons of other things to do!
2019-02-14 11:13:00 +01:00
Florian CUNY
1eac578ba1 Moved the Nether trees conversion to its own listener 2019-02-14 11:08:54 +01:00
tastybento
58253eb7d7 Implements gamemode-specific flags API (#541)
* Implements gamemode flags API

https://github.com/BentoBoxWorld/BentoBox/issues/406

* New and improved
2019-02-13 07:58:33 +01:00
tastybento
f89419f3d8 Made declaring the player mandatory when calling FlagListener#checkIsland(...) (#543)
* 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
2019-02-13 07:55:36 +01:00
tastybento
75c9f6fb2c Enables dragon to be summoned using /summon command
https://github.com/BentoBoxWorld/BentoBox/issues/522
2019-02-11 19:11:48 -08:00
tastybento
179a71b548 Get island by its UUID API added
https://github.com/BentoBoxWorld/BentoBox/issues/341
2019-02-11 19:01:44 -08:00
tastybento
9dfb0573d9 Adds test class for Island Sethome command.
Refactors some of IslandSethomeCommand class to use the new canExecute
method.
2019-02-11 15:54:15 -08:00
tastybento
ac2e3596f7 Made admin unregister command confirmable.
Uses new canExecute API.
Also correctly removes any island members from the island.
2019-02-10 21:57:58 -08:00
tastybento
04e4b2dbe5 Merge branch 'develop' of https://github.com/BentoBoxWorld/bentobox.git into develop 2019-02-10 15:36:46 -08:00
tastybento
8334de8cba Fixes island pasting issue when pasting clipboard every tick.
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.
2019-02-10 15:36:37 -08:00
Florian CUNY
a2607c913f Fixed AdminDeleteCommand tests (oopsie) 2019-02-10 22:59:03 +01:00
Florian CUNY
0fd043df23 Partially fixed island owner losing inventory on /is team kick
Partially fixes #521.
See https://github.com/BentoBoxWorld/BentoBox/issues/521#issuecomment-462128961 for reference.
2019-02-10 13:34:17 +01:00
Florian CUNY
b8afd1919f Added Flags#TREES_GROWING_OUTSIDE_RANGE
#512
2019-02-09 11:39:12 +01:00
Florian CUNY
af96055753 Added testHasNotPermissionButIsOp in UserTest 2019-02-08 21:25:40 +01:00
tastybento
446028fbae Revert "Reworks how dragons are removed."
This reverts commit af9de5580a.
2019-02-05 22:54:48 -08:00
tastybento
af9de5580a Reworks how dragons are removed.
Enables manual summoning of end dragons

https://github.com/BentoBoxWorld/BentoBox/issues/522
2019-02-05 18:37:05 -08:00
tastybento
3ccd19bf9c Fix locales to show correctly based on GameMode and locations
Fixes console translations too.

https://github.com/BentoBoxWorld/BentoBox/issues/519
2019-02-04 23:02:07 -08:00
tastybento
fd882c018b Fixes enderchest world setting
It was being double handled by two listeners.

Fixes:
https://github.com/BentoBoxWorld/BentoBox/issues/516
2019-02-04 22:01:43 -08:00
tastybento
f4c149dd6f Moved test classes to match src packages 2019-02-04 20:39:21 -08:00
tastybento
7c099d941f Added IslandWorldManager test class
Fixed bugs found in IWM
2019-02-03 19:13:14 -08:00
Florian CUNY
1c06584131 Added Flags#LIQUIDS_FLOWING_OUT
Also fixed some Javadoc in Flags, and I've also done my very first test unit!

#511
2019-02-03 14:05:28 +01:00
Florian CUNY
30fb7820fc Minor modifications to ObsidianScoopingListenerTest 2019-02-03 13:59:00 +01:00
Florian CUNY
ea12d8c167 Moved all the flags listeners to subpackages 2019-02-03 10:22:44 +01:00
tastybento
f60a39a543 Fires team and island events. Adds new events.
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.
2019-02-02 20:40:44 -08:00
Florian CUNY
18eba5725c Uncommented out a failing test and added a Ignore annotation to it 2019-02-02 14:04:01 +01:00
Florian CUNY
de69c9c571 Removed deprecated FlagsManager#getFlagByID(String)
This method was actually still used in some classes, so I had to fix them as well.
2019-02-02 11:06:59 +01:00
tastybento
f983aa5f44 Fixed permission bug with custom schems and reset
https://github.com/BentoBoxWorld/BentoBox/issues/509
2019-02-01 20:51:57 -08:00
tastybento
f351704e8a Prevent placing of armor stands
https://github.com/BentoBoxWorld/BentoBox/issues/507
2019-02-01 19:44:46 -08:00
tastybento
8dbf7ec231 Admin team add command was not adding players correctly.
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.
2019-01-30 17:27:53 -08:00
tastybento
46cc901c23 Adds support for ItemStack storage in non-YAML databases.
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/501
2019-01-28 18:29:17 -08:00
tastybento
04fa7fab80 Fixes issue with missing user assignment of potion thrown
Adds test for throwing potion class.

https://github.com/BentoBoxWorld/BentoBox/issues/493
2019-01-27 19:51:03 -08:00
tastybento
db932dd836 Fix for LogEntry serialization.
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.
2019-01-26 15:32:52 -08:00
tastybento
4e81baf45e Flags are requested from FlagManager not statically
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.
2019-01-26 09:39:34 -08:00
Florian CUNY
5a573bdbbe Fixed tests 2019-01-20 10:00:17 +01:00
tastybento
2df5d2a916 Added FlagAdapterTest and fixed deprecation 2019-01-19 08:30:42 -08:00
Florian CUNY
5ce8362fd5 Added addons metrics chart + added AddonDescription#isMetrics so that addons need to explicitely opt in
Deprecated AddonDescription.Builder#Builder(String, String) and AddonDescription.Builder#version(String).
Added AddonDescription.Builder#Builder(String, String, String).
Updated tests
2019-01-18 22:06:06 +01:00
Florian CUNY
0f5b5b5693 Fixed IslandResetCommand tests 2019-01-18 21:24:46 +01:00
Florian CUNY
d57f9544f3 Added NonNull/Nullable annotations to IslandsManager and IslandCache 2019-01-18 11:33:29 +01:00
tastybento
49d2365f85 Removed unneeded commented out code 2019-01-15 15:46:59 -08:00
tastybento
016c502b66 Added explicit test for addon locale override 2019-01-15 15:43:37 -08:00
tastybento
0636532bb4 Fixed code and tests.
Test failures in the User test were right - I had a bug in my code.
2019-01-15 15:23:17 -08:00
tastybento
fa8c0ec0c8 Implements async superflat cleaning
Should avoid crashes when there's a lot of cleaning to do.

https://github.com/BentoBoxWorld/BentoBox/issues/431
2019-01-13 15:53:12 -08:00
tastybento
96639792b8 Fixed random test failures.
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.
2019-01-13 14:19:23 -08:00
tastybento
5f990b9103 Fix for PhysicalInteractionListenerTest
Sometimes would randomly fail. This should fix it. (He says...)
2019-01-13 09:07:05 -08:00
tastybento
8a1b487a58 Fix test cases for ban commands. 2019-01-13 08:52:57 -08:00
Florian CUNY
0f253c35ef Renamed IslandDeleteManager to IslandDeletionManager 2019-01-13 10:09:35 +01:00
tastybento
501c3257ed Island delete enhancements
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.
2019-01-12 17:12:30 -08:00
tastybento
b51178518a Fixes admin setowner and info commands for team members
https://github.com/BentoBoxWorld/BentoBox/issues/452
2019-01-07 21:37:37 -08:00
tastybento
cd4f0c2561 Fixes Invincible Visitors Settings GUI bug
https://github.com/BentoBoxWorld/BentoBox/issues/450

Added enhanced test to this class too.
2019-01-07 21:03:02 -08:00
tastybento
acb6cd5650 Added defensive null checking code to DB
Relates to https://github.com/BentoBoxWorld/BentoBox/issues/447
2019-01-07 07:46:59 -08:00
Florian CUNY
8da1dc1590 Ignoring IslandBan- & IslandUnbanCommand tests for now
I could not get them to work again
2019-01-05 10:58:32 +01:00
Florian CUNY
f75de015a2 Started working on AddonsManagerTest 2019-01-04 21:31:22 +01:00
tastybento
d13ae470d5 Removed unused imports. 2019-01-03 10:25:03 -08:00
tastybento
5351b162c5 Moved obsidian scooping to be a world flag in settings 2019-01-03 09:46:56 -08:00
Florian CUNY
9f676636e0 Fixed some code smells 2019-01-03 17:09:27 +01:00
Florian CUNY
2e2c7c69de Removed deprecated classes 2019-01-03 16:51:57 +01:00
Florian CUNY
708c014d14 Moved allowObsidianScooping to WorldSettings and renamed ObsidianToLava to ObsidianScoopingListener
#432
2019-01-03 16:30:36 +01:00
Florian CUNY
c549d969a4 Removed 'island.custom-ranks' from config
#432
2019-01-03 16:17:01 +01:00
Florian CUNY
369600e4d5 Renamed Island#addToBanList() and Island#removeFromBanList() + added log in them
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)
2019-01-03 15:59:24 +01:00
tastybento
5f193b19f5 Merge remote-tracking branch 'origin/develop' into async-paste2 2019-01-02 10:44:50 -08:00
Florian CUNY
c7a85c2b5a Fixed AddonDescription to use a valid Builder pattern
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.
2019-01-02 17:28:11 +01:00
Florian CUNY
01b7ace0be Fixed code smells 2019-01-02 14:48:17 +01:00
Florian CUNY
c078d8dce6 Added ban limit (#getBanLimit() in WorldSettings)
Closes #423.

I had some trouble with unit testings, that's why I didn't update them to test the new features :(
2019-01-02 14:37:52 +01:00
tastybento
9b44dbb113 Fixes tests.
I made pasting the clipboard async as well so this affected the test.
2019-01-01 14:11:41 -08:00
tastybento
2528442d6b Rewrote using state approach to be easier to understand.
Backwards compatible with current schems. New schems required to avoid
torch popping etc. Look for updates to AcidIsland and BSB.
2018-12-31 11:24:24 -08:00
tastybento
38e82ee617 WIP: Enables async-style pasting of schems.
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.
2018-12-30 20:34:50 -08:00
tastybento
c4a5eb2c88 WIP pastes but attachments fall when split across paste boundaries 2018-12-30 18:09:56 -08:00
tastybento
d7851b923e Fixes reload of locales from addons
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!
2018-12-25 23:17:06 -08:00
Florian CUNY
d24d61480b
Merge pull request #409 from BentoBoxWorld/flag-builder-v2
Nesting Flag builder in Flag
2018-12-24 09:32:09 +01:00
tastybento
68d6b008f4 Fixed tests by fixing the default rank value.
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.
2018-12-23 22:15:37 -08:00
tastybento
0adc2e3078 Uses current API to enable multiple schems.
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/104
https://github.com/BentoBoxWorld/BentoBox/issues/207
https://github.com/BentoBoxWorld/BentoBox/issues/378
https://github.com/BentoBoxWorld/BentoBox/pull/408
2018-12-23 19:31:00 -08:00
tastybento
d907506fda Adds ability for the start sign to use a locale file set by the addon
https://github.com/BentoBoxWorld/bentobox/issues/372

Signs must have [start] as their first line to be converted.
2018-12-20 14:01:42 -08:00
tastybento
a7365ef805 Fixes chunk deletion bug and corrects chunk calculations elsewhere.
https://github.com/BentoBoxWorld/bentobox/issues/405

Adds test class for DeleteIslandChunks class.
2018-12-19 22:15:38 -08:00
tastybento
ee4a0d7cfc Added tests for LocalesManager
Covers https://github.com/BentoBoxWorld/bentobox/issues/385
2018-12-16 00:35:25 -08:00
tastybento
b556b7160e Fixes reload bug when locale folder is missing.
https://github.com/BentoBoxWorld/bentobox/issues/385
2018-12-15 23:38:20 -08:00
Florian CUNY
7dd06b9d9b Fixed tests
They were broken as of 8a16940e14
2018-12-15 10:30:17 +01:00
Florian CUNY
fa5c7905da Deprecated Island#showInfo() and Island#showMembers() that were using useless parameters
Replaced them with equivalents only requiring an User as parameter.
2018-12-13 10:10:05 +01:00
tastybento
01b0c2004b Added ExperiencePickupListener unit test. 2018-12-13 08:48:40 +09:00
tastybento
1a1fe14775 Merge branch 'develop' of https://github.com/BentoBoxWorld/bentobox.git into develop 2018-12-09 22:54:44 -08:00
tastybento
3e07554d3b Fixed bug where animals could be bred or fed to grow up.
https://github.com/BentoBoxWorld/bentobox/issues/366
2018-12-09 14:09:53 -08:00
Florian CUNY
b20ef00853 Updated locales to replace all references of "leader" to "owner"
The island owner is no longer both known as "owner" or "team leader" depending on the methods you're using : it's "owner" everywhere now. Period. 🎉
2018-12-09 13:41:09 +01:00
Florian CUNY
607db5b07f Removed some 'throws IOException' in IslandResetCommandTest 2018-12-09 13:20:49 +01:00
Florian CUNY
ae23ad913a Renamed general.errors.not-leader to general.errors.not-owner 2018-12-09 13:18:24 +01:00
Florian CUNY
a04a0cb3d0 Replace code referencing "teamleader" to "owner"
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.
2018-12-09 11:28:31 +01:00
tastybento
33c374c52d Fixed NPE on portal use when there is no Nether world
https://github.com/BentoBoxWorld/bentobox/issues/365
2018-12-08 19:24:31 -08:00
tastybento
693c6ab17e Completes turtle protection update.
https://github.com/BentoBoxWorld/bentobox/issues/348
2018-12-01 10:51:20 -08:00
tastybento
46bb958a6d Added protection against turtle egg crushing.
Added test class for physical interactions.

EWR -> DEN
2018-11-30 18:49:58 -05:00
tastybento
c88ea31237 Fixes tab complete error with no island.
EWR ->  DEN
2018-11-30 17:39:24 -05:00
tastybento
0bd800ac09 Added test class for BentoBoxLocale
United flight LAS -> EWR almost in New York
2018-11-29 13:05:32 -08:00
tastybento
98264f03d0 Fixed armor stand moving by rods.
https://github.com/BentoBoxWorld/bentobox/issues/350

Added test cases, but more to add.
2018-11-20 14:29:56 -08:00
tastybento
ffd1af5867 Removes coop on logout of cooped player or server shutdown.
https://github.com/BentoBoxWorld/bentobox/issues/335
2018-11-20 12:52:12 -08:00
Florian CUNY
0322ffe0ce Deprecated #getTeamLeader(...) methods
These have been deprecated in CompositeCommand, IslandCache and IslandsManager and they got replaced by #getOwner(...).
2018-11-18 11:12:54 +01:00
Florian CUNY
c3ca82e12a Fixed the ENDER_CHEST flag not using the Notifier 2018-11-11 10:37:08 +01:00
tastybento
c2e9490bb0 Added min/max options for cycle click and restricted lock flag.
https://github.com/BentoBoxWorld/bentobox/issues/332
2018-11-10 19:28:46 -08:00
tastybento
68873e033f Added defensive code to handle island adding to grid.
When an island cannot be added to the grid, it should show some helpful
console error.

Related to https://github.com/BentoBoxWorld/bentobox/issues/326
2018-11-10 10:04:37 -08:00
Florian CUNY
d507efbe77 Fixed obsidian scooping replacing whole bucket stack with lava buckets
Fixes #338.
2018-11-10 10:04:10 +01:00
Florian CUNY
09905ab018 Renamed AbstractFlagListener to FlagListener 2018-11-04 16:40:20 +01:00
Florian CUNY
3e284b90eb Fixed protection listeners not being registered to Bukkit
Basically removed the "plugin loaded" limitation.
2018-11-03 11:31:08 +01:00
Florian CUNY
480d3f78d9 Added world condition in IslandsManager#userIsOnIsland
The world parameter was previously unused.
I also updated javadocs ; as well as the tests. Everything seems to be working fine.
2018-11-01 16:34:19 +01:00
tastybento
d9783c8d73 Fix for issue where team members are sometimes not recognized.
https://github.com/BentoBoxWorld/bentobox/issues/318
2018-10-30 13:21:27 -07:00
Florian CUNY
0dc9de9c37 Fixed broken file renaming
Well... Hopefully it'll fix it
2018-10-28 14:33:36 +01:00
Florian CUNY
6dd02a15b7 Made use of Addon.State
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.
2018-10-28 11:12:00 +01:00
Florian CUNY
e930510243 Renamed TestBSkyBlock to TestBentoBox 2018-10-28 10:34:22 +01:00
Florian CUNY
14a794a5b1 Lowercased some command class names to better fit how they are actually working in game 2018-10-28 10:27:01 +01:00
Florian CUNY
13c483e5eb Renamed AdminTeamMakeLeaderCommand to AdminTeamSetOwnerCommand 2018-10-28 10:19:14 +01:00
Florian CUNY
20b6c4a7cb Fixed tests and commands relying on previously broken API
Mistakenly pushed the previous changes on develop before committing these fixes.
2018-10-27 16:52:07 +02:00
Florian CUNY
95bfab916e Replaced Util#getPermValue(Player, String, int) with User#getPermissionValue(String, int) 2018-10-20 11:32:42 +02:00
tastybento
84a79fe1de Fixed and added tests for new deathCount option
Fixes test failures from commit a6d25d68a9

I added some more tests to check for in world as well as death count
being on/off.
2018-10-07 18:28:48 -07:00
tastybento
14b7a3aa82 Fixed teleporting to an island by using a member's name
https://github.com/BentoBoxWorld/bentobox/issues/300
2018-10-07 18:15:18 -07:00
tastybento
b83e5d4a56 Fixed tests for Invincible visitors. 2018-10-05 17:34:21 -07:00
tastybento
0f5ab8ab7d Added inWorld(World.class) to IWM
This had a ripple affect through the tests because now there are two
inWorld() methods - one for Location and one for World.
2018-09-29 09:01:20 -07:00
tastybento
2df049f70d Implements protection for standard Nether and End
This was missing so it needed to be added.

Related to: https://github.com/BentoBoxWorld/addon-bskyblock/issues/9
2018-09-25 22:20:30 -07:00
tastybento
86d40ca126 Fixed issue where standard Nether is protected.
Also applies to standard End.

https://github.com/BentoBoxWorld/addon-bskyblock/issues/9
2018-09-25 20:45:43 -07:00
tastybento
0f371f4800 Removed unneeded imports and code. 2018-09-25 20:05:23 -07:00
Florian CUNY
58de346dc9 Various changes to SafeSpotTeleport
* Replaced SafeTeleportBuilder by SafeSpotTeleport.Builder
* Added "overrideGamemode" parameter
* AdminTeleportCommand no longer overrides the player's gamemode when teleporting (fixes #262 )
2018-09-15 12:38:51 +02:00
Florian CUNY
02be048192 Removed "general.errors.unknown-player-name" : added a "[name]" textvariable in "general.errors.unknown-player"
Closes #263
2018-09-15 10:39:16 +02:00
tastybento
d744b58638 Fixed tests
Created two new tests:

1. A test that closing inventory does not happen unless it is a known
panel.
2. A test that verifies known panels are closed.
2018-09-08 10:35:40 -07:00
Florian CUNY
918f6de782 Fixed clicking outside of inventory closing it
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.
2018-09-08 17:12:15 +02:00
tastybento
505624b45c Fixes tests. Also fixes a bug.
https://github.com/BentoBoxWorld/bentobox/issues/258
2018-09-02 20:45:31 -07:00
Florian CUNY
a12eec7a6b Fixed Invincible Visitors unit testing 2018-08-31 21:12:44 +02:00
Florian CUNY
24d783be24 Cleanup in Settings
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.
2018-08-31 11:06:37 +02:00
tastybento
4eadd259f7 Added PanelBuilderTest and fixed bug in PanelBuilder
nextSlot() was not giving next slot after an assigned slot.

11600ft and descending into SFO. 14 miles out.
2018-08-31 07:28:02 +09:00
tastybento
f3bd4fa621 Removed unused import 2018-08-25 12:27:32 -07:00
tastybento
06f7b754b7 Removed enderman death drop flag. 1.13 drops blocks anyway. 2018-08-25 12:27:21 -07:00
tastybento
9e2c2c7dbc Adjusted remove rank test 2018-08-25 12:27:00 -07:00
tastybento
474de77ce2 Added death listener.
Counts player deaths in any game world.

Fixes https://github.com/BentoBoxWorld/addon-level/issues/18
2018-08-22 23:46:24 -04:00
tastybento
9b1c7f10ab Added Clipboard test class and improved Clipboard robustness
Flight # 2533
RDU to PHX
Above Memphis, TN
Altitude
38,006 ft
Ground speed
464 mph
2018-08-22 18:40:44 -04:00
tastybento
9847235df1 Fixes MySQL exists and delete functions. 2018-08-18 09:53:21 -07:00
tastybento
ec005569a1 Fixed tests for EnterExitListenerTest 2018-08-16 10:38:35 -07:00
tastybento
3f7198da25 NPE's fixed. Tests need to be fixed now. 2018-08-16 08:53:31 -07:00
tastybento
68624d2879 Removed unused imports. Removed unused classes InventorySave/Store 2018-08-15 20:30:34 -07:00
Florian CUNY
7815c837dd Deleted FlyingMobEvents (duplicate of GeoLimitMobs)
And also fixed a code smell with metrics method names in IslandsManager
2018-08-15 10:52:10 +02:00
Florian CUNY
82ebc8b018 Revert "Fixed IslandCacheTest"
This reverts commit 8fb4e58994.
2018-08-15 09:51:41 +02:00
Florian CUNY
539d2a0516 Fixed some code smells 2018-08-15 09:43:28 +02:00
Florian CUNY
e11f173ca3 Made /is reset use the command cooldown API + switched "wait" settings to int
Aaaand had to update some tests. Lots of tests.
2018-08-14 21:11:46 +02:00
Florian CUNY
8fb4e58994 Fixed IslandCacheTest
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!
2018-08-14 11:38:44 +02:00
Florian CUNY
4af03ee939 Fixed EnterExitListenerTest 2018-08-14 11:04:28 +02:00
Florian CUNY
2c16f88013 Updated tests 2018-08-13 21:05:47 +02:00
tastybento
6eeff3f383 Added test classes for coop, uncoop, trust and untrust commands. 2018-08-12 17:15:11 -07:00
tastybento
c1a6a233a9 Added team coop, uncoop, trust and untrust commands. 2018-08-12 16:43:47 -07:00
tastybento
82c35f9aa9 Fixed test breaks. 2018-08-12 14:28:25 -07:00
tastybento
bcb44c4cce Fixed PlayerManager tests. 2018-08-12 04:14:07 +09:00
Florian CUNY
9c240fbf54 Fixed tests in DefaultHelpCommandTest 2018-08-11 14:39:12 +02:00
tastybento
ea0f64a770 WIP added AdminDeleteCommand 2018-08-09 05:13:54 +09:00
Florian CUNY
cd7f8ddf24 Commented the failing test out, so Travis builds again 2018-08-07 16:02:54 +02:00
Florian CUNY
90a868bc40 Updated ItemParser to use the new banner materials 2018-08-07 16:02:29 +02:00
Florian CUNY
e232452f65 Fixed 2 out of 3 tests 2018-08-07 10:44:13 +02:00
Florian CUNY
cfbf3df1c3 BREAKING: Renamed [...]DatabaseConnecter to [...]DatabaseConnector
It was a typo shown by IntelliJ
2018-08-06 15:32:15 +02:00
Florian CUNY
5fa8f3997f BREAKING: Renamed a few API classes to a more generic name
`BBConfig` to `Config`.
`BBDatabase` to `Database`.
`BBDbSetup` to `DatabaseSetup`.

Sorry @tastybento, hope it won't bother you too much :/
2018-08-06 15:19:06 +02:00
tastybento
ba557a1068 API Breaker: renamed BSB classes to be just BB
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...
2018-08-05 20:08:03 -07:00
tastybento
cfdabbb176 Removed AboutCommand test to get a clean build.
Please see my comment on the commit. Final classes can't be mocked (as
far as I know) so it's kinda impossible to make a test for this one.
2018-08-05 20:00:23 -07:00
Florian CUNY
f8366cafec Started a test unit for AboutCommand 2018-08-05 10:56:15 +02:00