Commit Graph

950 Commits

Author SHA1 Message Date
tastybento
4a24364f81 Collect water wasn't overriding bucket usage for visitors
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1545
2020-10-12 15:45:38 -07:00
tastybento
f09ea1ffef Adds PreCreateEvent for API 2020-10-12 14:07:47 -07:00
tastybento
fad1fc84da
Enables nether and end teleporting even if they are disabled by server (#1539)
* Enables nether and end teleporting even if they are disabled by server

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

* Fix PortalTeleportationListener tests

* Revert Travis.yml
2020-10-11 07:38:21 -07:00
tastybento
fb53ac17e1
Inserts gamemode name into placeholders before passing to PaceholderAPI (#1514)
https://github.com/BentoBoxWorld/BentoBox/issues/1512

Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
2020-10-08 17:47:54 -07:00
tastybento
4609881542 Citizen NPCs are not island visitors so do not protect them.
https://github.com/BentoBoxWorld/BentoBox/issues/1518
2020-09-18 13:45:39 -07:00
tastybento
5a5435d815 Let Citizens handle its own PVP protection.
https://github.com/BentoBoxWorld/BentoBox/issues/1518
2020-09-17 08:09:39 -07:00
tastybento
c8a85a9ba2 Added Settings class junit tests 2020-09-13 09:52:05 -07:00
tastybento
bc0e8a9df4 Added GeoMobLimitTab test class 2020-09-12 16:44:00 -07:00
tastybento
b3ffa1511b Updated LockAndBanListener tests. 2020-09-12 16:01:23 -07:00
tastybento
40ecbc8ec6 Update API for event constructor - anchor spawn 2020-09-12 15:53:52 -07:00
tastybento
42622d6e38 Fixes test by using non-deprecated event constructor.
API 1.16.2 removed a deprecated EntityShootBowEvent event constructor.
2020-09-07 13:29:33 -07:00
tastybento
450c459350 Doors are not safe ground blocks.
https://github.com/BentoBoxWorld/BentoBox/issues/1517
2020-09-06 16:16:06 -07:00
tastybento
e9370b9a05 Prevent expel tab-complete from detecting invisible players.
https://github.com/BentoBoxWorld/BentoBox/issues/972
2020-09-02 21:50:25 -07:00
tastybento
9ff62dad2a Added TextVariables.GAMEMODE constant 2020-09-01 16:58:13 -07:00
tastybento
ea4ef1e21a Adjusts tabComplete for a number of commands.
Enforces the need to type at least one letter for whole-server tab
completes.
2020-08-31 22:03:51 -07:00
tastybento
c1ede3c66a Prevent invites to vanished players
https://github.com/BentoBoxWorld/BentoBox/issues/972
2020-08-31 20:59:11 -07:00
tastybento
845d27de68 Adds or enhances tab complete for kick/uncoop/untrust
https://github.com/BentoBoxWorld/BentoBox/issues/1509
2020-08-30 13:41:04 -07:00
tastybento
1e4056e33a Clears player cache by name and UUID
Previously only UUID was checked, but joining with a name and different
UUID is possible. This clears out the cache so commands that look up
names like ban do not use the old UUID.

https://github.com/BentoBoxWorld/BentoBox/issues/1468
2020-07-25 14:37:45 -07:00
tastybento
284b5865da Prevents instant lava placing when scooping.
https://github.com/BentoBoxWorld/BentoBox/issues/1459
2020-07-22 22:29:37 -07:00
tastybento
bdbfd33a34
Fixed code smells (#1444)
* Code smell changes

* Fixes issues raised in reviews.
2020-07-09 09:03:01 +02:00
Florian CUNY
5e0e19a1be Breaking boats/minecarts is now handled by their respective flags
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1430
Improved description for MINECART and BOAT flags
2020-07-04 13:11:09 +02:00
tastybento
2b5deb4133 Added unregisterFlag method to FlagManager
This was requested on Discord. Enables plugs or addons to tidy up flags
if they are disabled for some reason.
2020-07-02 16:05:42 -07:00
tastybento
89849442a9 Protected hoglin and strider breeding
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1419
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1418
2020-06-28 15:05:48 -07:00
tastybento
23fecdea54 Improves HeadGetter and Panel
Will replace more than one head in a panel if found.
2020-06-28 09:15:42 -07:00
tastybento
b87533fffb
Introducing (limited) 1.16.1 support (#1416)
* 1.16.1 changes

* Fixed failing tests in PhysicalInteractionListener
HOWEVER, the code somehow no longer protects the pressure plates... I'm investigating that.

* Implemented future-proof buttons, doors, fence gates, trapdoors protection

* Protected REDSTONE_WIREs under "REDSTONE" flag
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1421

* Fixed bug with pressure plates

* Fixed params order in assertEquals in PhysicalInteractionListenerTest

* Fixed EnderChestListenerTest errors

* Fixed most errors in BlockInteractionListenerTest

* Added 1.16.1 to ServerCompatibility

* Fixed BlockInteractionListenerTest

* Fixed backwards compatibility in BlockInteractionListener
Also made use of existing Tags (ANVIL, BEDS, SHULKER_BOXES)

* Fixed BlockInteractionListenerTest (again)

* Fixed backwards compatibility in PhysicalInteractionListener

Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
2020-06-26 22:09:33 +02:00
tastybento
9f5fb590e0 Fixes test broken by old flag name being used
cbbd361b03
2020-06-21 13:41:42 -07:00
Florian CUNY
cbbd361b03 Split the animal/monster spawn flags to "natural" and "spawners"
Implements https://github.com/BentoBoxWorld/BentoBox/issues/1351
2020-06-21 17:47:01 +02:00
tastybento
7ee706c982 Fixes elytra protection. Adds test class.
https://github.com/BentoBoxWorld/BentoBox/issues/1403
2020-06-16 19:12:07 -07:00
tastybento
09072282bb
Replaces command running with single Util method (#1374)
Adds respawn commands.
2020-06-13 18:51:05 -07:00
tastybento
0fec5aec51 Added insufficient rank error and fixed tests.
The no permission error was being added, but thats wrong because it's
not lack of permission but lack of rank that is the issue. This adds a
new error and shows it in the various commands.
2020-06-06 17:01:09 -07:00
tastybento
38db699801
Uses async location loading for home teleporting (#1381)
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1241

Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
2020-06-02 10:22:35 +02:00
tastybento
d6b2a88b32 Fixes rank checking for team invites
Only owners could invite players successfully. This now checks based on
rank.
Added a method to allow rank checking on UUID. Had to make tests be
specific to the User.class.

https://github.com/BentoBoxWorld/BentoBox/issues/1377
2020-05-30 11:22:05 -07:00
tastybento
fdb4df3d93 Show correct missing permission for multi sethome command
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1367
2020-05-25 16:44:22 -07:00
tastybento
2e0ca14729
Uses perform command instead of direct call. (#1359)
* Uses perform command instead of direct call.

Goal is to enable 3rd party alias plugins to catch the command.

* Fires PlayerCommandPreprocessEvent before performCommand

Adds a / to the front of the default player commands.

Fixes issue with MyCommand plugin.

* Fixes tests
2020-05-23 19:53:55 -07:00
tastybento
feab01cde8
Add ability for DataObjects to specify custom db table name (#1348)
Automated migration for existing databases is supported.
2020-05-13 10:49:42 +02:00
Florian CUNY
937052d378 Fixed addon api-version compatibility check
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1346
Added a unit test to prevent regressions

Newer BentoBox releases are now properly considered "compatible" to addons expecting an older patch release
2020-05-09 11:26:00 +02:00
tastybento
9a517446c8 Panel should ignore color codes when checking player name for heads
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1343
2020-05-07 16:19:09 -07:00
tastybento
61fe218a16 Purge was not calculated player logins correctly.
https://github.com/BentoBoxWorld/BentoBox/issues/1333
2020-05-02 16:14:03 -07:00
Florian CUNY
314fddc400 Fixed tests 2020-04-29 18:51:07 +02:00
tastybento
f9906fa2f5 Fixed broken build. Fixed failed tests. 2020-04-27 18:58:14 -07:00
tastybento
e381d61c3c Fixes issue where addon has no perms in addon.yml
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1312
2020-04-26 10:08:45 -07:00
tastybento
17186dd791 Remove unused imports 2020-04-26 08:32:52 -07:00
Florian CUNY
a5c710ce3a Fixed tests 2020-04-26 13:17:22 +02:00
tastybento
1f3a79127a
Implements placeholder permissions for addons (#1305)
Implements #1303. 

Addons will no longer need to see their permissions updated each time there is a new gamemode. They can use [gamemode] in their permissions to automatically register the permissions on all available gamemodes.
2020-04-26 01:20:48 +02:00
tastybento
fe58159db3
Adds saveObjectAsync with a CompletableFuture return for databases (#1308)
Deprecates the saveObject() method
2020-04-26 01:00:49 +02:00
Florian CUNY
46ba40b70d Fixed IslandsManager#getSafeHomeLocation throwing NPE if world is not an island world
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1306
The method now properly returns null if the world is not an island world.
2020-04-25 14:40:47 +02:00
tastybento
ae63125f50
Enables UUIDs to be used in admin commands as well as names (#1298)
Implements a solution for #1297.

Adds Util#getUUID(String nameOrUUID)
2020-04-23 21:16:09 +02:00
tastybento
b1dcec2160
Adds API to enable commands to be hidden from help and tab (#1301)
Implements #1300.

Adds CompositeCommand#setHidden(boolean).
2020-04-23 20:54:45 +02:00
tastybento
eee8709636 Combined safe spot checking into one place.
We had two sets of checking with different criteria. This consolidates
them.

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1296
2020-04-22 18:25:10 -07:00
tastybento
88b331d1e4 MySQL databases were not saving properly on shutdown.
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1292
2020-04-20 18:37:42 -07:00
tastybento
85d5a3a6ac
Adds a single character prefix to database tables (#1278)
* Adds a single character prefix to database tables

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

* Fix tests

* Fix bug with substring
2020-04-18 14:16:36 -07:00
tastybento
f5f2d7ac39 Fixes IslandTeamKickCommand test (commands.island.team.kick.cannot-kick) 2020-04-17 07:14:13 -07:00
tastybento
d327ea4a89 Protect paintings from projectiles and being placed.
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1273
2020-04-09 16:02:51 -07:00
tastybento
b6b9b11f53 Removed unused imports 2020-04-07 13:42:42 -07:00
Florian CUNY
5b01f39f9e Fixed tests and logic with coop/trust limits 2020-04-05 15:15:26 +02:00
Florian CUNY
e7b1f51a83 Fixed tests 2020-04-05 00:38:30 +02:00
Florian CUNY
962b7d734a Removed MVdWPlaceholderAPIHook and all related methods
It was increasingly causing issues, ranging from long start times, unreliability with some of our placeholders, to much more...
There's a way for MVdWPAPI users to get PAPI's placeholders, so they should definitely use that instead.
2020-04-04 15:38:29 +02:00
Florian CUNY
2c7316ba21 Added AdminPurgeStatusCommand and improved some purge-related messages
Implements https://github.com/BentoBoxWorld/BentoBox/issues/1254
2020-04-04 15:31:22 +02:00
tastybento
02b16c233c Fixes tests. 2020-04-02 14:49:45 -07:00
tastybento
c724b6bbf2 Remove unused import 2020-04-02 13:21:26 -07:00
Florian CUNY
9e620cbbac Fixed spawn islands that could be purged as unowned
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1255
Also added a few more tests to prevent regression
2020-03-31 14:30:27 +02:00
tastybento
25d43c4f9f Removes velocity on teleporting
https://github.com/BentoBoxWorld/BentoBox/issues/1248
2020-03-28 09:42:55 -07:00
tastybento
8e77dc95df Fix perm tests in JoinLeaveListener. 2020-03-18 16:35:20 -07:00
tastybento
1933d498f6 Fixes handling of negative perms for value setting
https://github.com/BentoBoxWorld/Limits/issues/73#issuecomment-600748928
2020-03-18 14:18:38 -07:00
tastybento
71c923975b Fixes tests for PVPListener class.
Were broken by PR https://github.com/BentoBoxWorld/BentoBox/pull/1230
2020-03-18 08:50:10 -07:00
tastybento
0a86ddd0ab Fixes island creation on joining.
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1221

The original code could actually never work because the check for
whether a player had played before or not was occuring immediately after
addPlayer, which added the player to the server. Also, the code to run
was running in a thread and not on the main thread, so if it had run
could have caused errors.
2020-03-10 18:30:50 -07:00
tastybento
34ce9d3fc2 Speed up new island spot search.
Relates to https://github.com/BentoBoxWorld/CaveBlock/issues/44
Added a test case to benchmark search algorithms.
2020-03-06 18:04:38 -08:00
tastybento
30d9ed3887 Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1216 2020-03-05 16:47:52 -08:00
tastybento
669986b422 Added IslandEventTest class and fixed bugs with IslandEvent
IslandReserveEvent was missing.
2020-03-04 19:02:50 -08:00
tastybento
b99be85bad Removed unused comments 2020-03-04 18:50:23 -08:00
tastybento
f7a3da1502 Fixes IslandResetCommandTest failure 2020-03-04 18:47:37 -08:00
tastybento
b4a1398fcb Limits island height to value values only.
Relates to https://github.com/BentoBoxWorld/SkyGrid/issues/39
2020-02-29 15:29:24 -08:00
tastybento
8393784498 Fixes projectile damage by block bug
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1211
2020-02-29 10:04:59 -08:00
tastybento
b189ebde65 Ignores colors when checking panel names
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1202

Black is a default color so there can be a mismatch between the
inventory title and the expected title if colors are used. In general,
it is safer not to check colors for GUIs.
2020-02-21 18:53:20 -08:00
tastybento
65dbd530d5 Added IslandPreclearEvent
This event gets called prior to an island being cleared of players and
other data. This can happen before a reset or an admin delete. It is
there so addons can perform tasks on the players before the island is
cleared.

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1200
2020-02-20 16:56:35 -08:00
tastybento
d3a7a908f1 Fixes tests for NewIsland class
Broken by https://github.com/BentoBoxWorld/BentoBox/pull/1179
2020-02-19 19:46:49 -08:00
Florian CUNY
f383c196a5 Updated FLINT_AND_STEEL flag description to also tell about campfires 2020-02-12 13:39:01 +01:00
Florian CUNY
120be13b36 Fixed and improved Breeding protection
It wasn't catching breeding with some newer animals (Pandas, Foxes...), was a bit overprotective (it could prevent feeding some animals), or wasn't catching some breeding items (Golden Carrots, ...).
I rewrote it so that every animal is now protected with the foods that actually make them breed (based off the MC wiki page about Breeding).
Once we will move to 1.15 API, we will have to add BEES in that.
2020-02-12 11:36:08 +01:00
tastybento
05a4b2d2c7 Adds new perm for bypassing delayed commands.
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1136
2020-02-07 18:42:39 -08:00
tastybento
332967950f Fixes the API checking algorithm.
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1176
2020-02-07 18:25:40 -08:00
tastybento
898e310e4f Handle null itemInHand for BlockPlaceEvent
Officially, null is invalid as an in-hand item. It should be AIR.

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1172
2020-02-07 11:52:01 -08:00
tastybento
ab89e4835e Fixes island center startx/z correction.
https://github.com/BentoBoxWorld/BentoBox/issues/1169
2020-02-04 12:20:31 -08:00
Florian CUNY
2e3b9962c8 Fixed "PVP disabled in ..." messages not using world-specific messages.
No matter which dimension the player was in, in some cases, it was telling "PVP disabled in the Overworld".
2020-02-02 11:07:27 +01:00
tastybento
07706d78e1 Enables tp commands to work from console.
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1158
2020-01-30 10:12:31 -08:00
Florian CUNY
093373550d Fixed tests (again) for IslandTeamInviteAcceptCommand 2020-01-25 08:45:06 +01:00
Florian CUNY
1bcb12a51f Fixed tests for IslandTeamInviteAcceptCommand 2020-01-24 21:56:18 +01:00
tastybento
97f7b2c563 Deleted islands could not be used as new islands
Added test class for DefaultNewIslandLocationStrategy to cover the
cases.

https://github.com/BentoBoxWorld/BentoBox/issues/1147
2020-01-21 13:15:55 -08:00
tastybento
013e17d73a Removed unused import. 2020-01-18 08:43:47 -08:00
Florian CUNY
0559a86e8d Implemented optional argument to AdminGetrankCommand to specify which island to perform the check on.
Implements https://github.com/BentoBoxWorld/BentoBox/issues/1106
Updated en-US + added 'general.errors.player-is-not-owner' message.
2020-01-18 10:47:08 +01:00
Florian CUNY
abf5e1f071 Fixed failing test in JoinLeaveListener (erroneous) 2020-01-18 09:58:16 +01:00
Florian CUNY
e17056376a Fixed erroring tests 2020-01-18 09:52:02 +01:00
Florian CUNY
37a4145322 Added specific messages when entering/leaving an island the player is member of
Implements https://github.com/BentoBoxWorld/BentoBox/issues/1084
Improved color codes for existing messages
2020-01-17 13:34:05 +01:00
tastybento
c7e0492612 Fixed bug (sonar cloud) and improved test PortalTeleportationListener 2020-01-14 15:01:19 -08:00
tastybento
8b27003cfb Stops velocity for player going through end portal to end
https://github.com/BentoBoxWorld/BentoBox/issues/1118
2020-01-10 15:41:59 -08:00
tastybento
7a7641354f Compiling under Java 9+ (#1112)
* Compiles in Java 11

* Compile under Java 11 only.
2020-01-10 23:12:37 +01:00
tastybento
1c500a0c05 Redstone on islands will operate if mods or ops are present
even if the offline redstone flag is active and no team members are
online. This enables staff to bypass the "Offline Redstone" feature,
which means if staff need to moderate players islands then redstone is
an issue.

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1102
2020-01-07 17:20:04 -08:00
tastybento
a3a0efb3a3 Removes only team members from island.
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1096
2020-01-07 13:12:53 -08:00
tastybento
aa5c253e03
Fix for double calling of events (#1111)
* Fixes tests for AdminSetrankCommand

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

* Fixes double calling of events.

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

* Makes AddonEvent static

https://github.com/BentoBoxWorld/BentoBox/pull/1111
2020-01-07 10:15:12 -08:00
tastybento
28200a44a8 Removed unused imports 2020-01-06 11:22:37 -08:00
Florian CUNY
a0718f0e6b Added a 3rd optional "island owner" argument to AdminSetrankCommand
Implements https://github.com/BentoBoxWorld/BentoBox/issues/787

This allows to coop or trust players on another player's island.
Related tests are ignored due to a lack of time to fix them.
2020-01-05 17:45:53 +01:00
Florian CUNY
ceef422c54 Improved tab-completion for AdminSetrankCommand
Relates to https://github.com/BentoBoxWorld/BentoBox/issues/787
2020-01-05 13:38:18 +01:00
Florian CUNY
fab6b295b6 Fixed tests 2019-12-31 14:38:49 +01:00
Florian CUNY
53d728af94 Added LECTERN protection flag
Implements https://github.com/BentoBoxWorld/BentoBox/issues/1094
2019-12-31 14:06:49 +01:00
Florian CUNY
4a209d875e Fixed players being stuck in SPECTATOR gamemode when accepting invite 2019-12-30 16:17:10 +01:00
tastybento
21eeedbbb0 Fixes addon disablement in onEnable.
Clean up imports.

https://github.com/BentoBoxWorld/BentoBox/issues/1090
2019-12-29 05:55:57 -08:00
Florian CUNY
fbceaa51d3 Improved UserTest#testHasPermission() 2019-12-23 14:06:56 +01:00
Florian CUNY
fc23da4343 Added Util#isInteger() and made commands use it for more reliability 2019-12-21 14:23:32 +01:00
Florian CUNY
1d486efbe7 Added AdminRangeAddCommand, AdminRangeRemoveCommand
Implemented https://github.com/BentoBoxWorld/BentoBox/issues/1072

Moved the various "invalid-value" messages to the admin range node in en-US.
Made AdminRangeSetCommand use the more generic 'must be positive number' message - causes issues with floats, which I will fix later on.
2019-12-21 11:34:38 +01:00
Florian CUNY
3e65f5e902 Fixed admin range set/reset commands not working if player is in team
Updated tests
2019-12-21 10:57:17 +01:00
tastybento
1058f2dd64 Fixed tests for IslandTeamInviteAcceptCommand 2019-12-20 16:50:59 -08:00
tastybento
a025271629 Fixed message on trusting a player.
https://github.com/BentoBoxWorld/BentoBox/issues/1073
2019-12-17 11:30:59 -08:00
tastybento
c3442c29ba Reworked how new island spots are found.
Fixed bug where max attempts check was not working, which could cause a
timeout crash.

https://github.com/BentoBoxWorld/BentoBox/issues/1057
2019-12-15 14:41:59 -08:00
Florian CUNY
30abc0e6a8 Fixed tests 2019-12-14 11:39:51 +01:00
tastybento
a82e6bbdc0 Cleaned up EggListener test code. 2019-12-08 12:03:58 -08:00
tastybento
3dc836bbfe Fixed IslandCache test class.
Added mock to make island.isOwned() true.
2019-12-08 11:58:34 -08:00
tastybento
a42da35174 Fixed AdminPurgeCommand test class.
Added mock for island.isOwned() and island.isUnowned() methods.
2019-12-08 11:56:12 -08:00
tastybento
eb06b39b4a Fixed EnterExitListener test class.
Added island.isOwned() mocking.
Added 2 test cases to handle unowned island testing.
2019-12-08 11:52:33 -08:00
Florian CUNY
3e81b4a3cf Fixed tests and ignored some that are throwing null mocks errors 2019-12-07 18:21:32 +01:00
tastybento
3f1d6d16ff Added Mockito.framework().clearInlineMocks() to all test classes per
https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2

This is just e defensive measure and may not have an affect on any
particular class.
2019-12-06 08:29:29 -08:00
tastybento
4b9b24e121 Fixed issue where Ops and mods had to stand still on teleport
https://github.com/BentoBoxWorld/BentoBox/issues/1059
2019-12-05 23:37:45 -08:00
tastybento
e511d1b9e9 Fixes banlist command number in unlimited case
Added test methods to confirm operation.

https://github.com/BentoBoxWorld/BentoBox/issues/1060
2019-12-05 22:37:03 -08:00
tastybento
294ed23225 Remove unused imports 2019-12-01 08:37:39 -08:00
tastybento
7c3e81cc5e Fixes JoinLeaveListenerTest failure. 2019-11-30 18:37:11 -08:00
tastybento
032b5c2988
Allows a space to be placed after a color code in locale files. (#1045)
Space will be stripped if it exists. This makes GitLocalize able to
machine translate much better.

Changes to the English locale file was made. Other languages do not have
to add spaces. Note that adding or removing spaces from files is easy
with regex.

https://github.com/BentoBoxWorld/BentoBox/issues/1044
2019-11-30 16:17:38 -08:00
tastybento
7737456309 Fixes issue with island protection range and permissions.
Permissions could set the island protection range greater than the
island distance.

This commit also fixes the User method that calculates the max value
from a permission. The default value was being used as the starting
point rather than 0, so it was not possible to set perms to go less than
the default value.

Added test clases around all these items.

https://github.com/BentoBoxWorld/BentoBox/issues/1047
2019-11-28 21:48:07 -08:00
tastybento
5f52b32cd3 Enables operation on 1.13.2 servers.
Avoids use of AbstractVillager for now. Alternative to PR
https://github.com/BentoBoxWorld/BentoBox/pull/1035
2019-11-25 21:17:41 -08:00
tastybento
b3dde9ad3e Fixes blueprint clipboard manager test. 2019-11-25 20:18:49 -08:00
tastybento
ff60127762 Sanitizes blueprint and bundle names
https://github.com/BentoBoxWorld/BentoBox/issues/1038

Allows spaces to exist in the bundle names.

Added tests to check for bad chars and foreign chars in names.
2019-11-25 19:57:11 -08:00
tastybento
0e6061455f Fixes flow into adjacent islands when island abut.
https://github.com/BentoBoxWorld/BentoBox/issues/1034
2019-11-24 13:45:18 -08:00
tastybento
df40c3477c Verifies material exists on server and if not supplies AIR.
https://github.com/BentoBoxWorld/BentoBox/issues/1037
2019-11-20 18:02:30 -08:00
tastybento
336f4e9bd4 Explicitly cancels the portal if there is no nether or end.
https://github.com/BentoBoxWorld/BentoBox/issues/1036
2019-11-20 17:08:04 -08:00
tastybento
4753681b47 Fixes flow out of water logged blocks like slabs.
The check `isLiquid()` does not work for water logged blocks like slabs
or fences so it was possible for players to get liquids outside of the
the island.

https://github.com/BentoBoxWorld/BentoBox/issues/1034
2019-11-17 17:45:51 -08:00
tastybento
cd7b02fdf2 Excludes spawn island from offline redstone prevention flag
https://github.com/BentoBoxWorld/BentoBox/issues/1031
2019-11-16 10:22:46 -08:00
tastybento
2c8739a48b Fixes damage to wandering traders.
https://github.com/BentoBoxWorld/BentoBox/issues/1029
2019-11-14 18:05:55 -08:00
tastybento
f67baf6501 Add protection for firework explosions from crossbows.
https://github.com/BentoBoxWorld/BentoBox/issues/1027
2019-11-14 17:44:56 -08:00
tastybento
c9b0c74d08
Paper lib (#1026)
* Remove unused imports

* Implements PaperLib within bentobox

* Added PaperLib methods to Util for addons to call

* Uses PaperLib for island deletion

* Point to https://github.com/BentoBoxWorld/MVdWPlaceholderAPI in POM
2019-11-13 15:10:33 -08:00
Florian CUNY
a1b7df19c7 Added WorldSettings options to create island on first login
Implements https://github.com/BentoBoxWorld/BentoBox/issues/889
2019-11-09 17:50:27 +01:00
tastybento
21e75c645e Return to previous code for BlockInterationListener 2019-11-06 08:32:06 -08:00
tastybento
21916b5a59 Remove code smells. 2019-11-05 23:11:56 -08:00
tastybento
ef67079831 Fix for tests.
Note Flags cannot be used in class definitions without becoming nulls.
They have to be done in the constructor.
2019-11-05 22:36:28 -08:00
tastybento
c56b9bec18 Refactorer BlockInteractionListener and added test class
May fix:

https://github.com/BentoBoxWorld/BentoBox/issues/1023
2019-11-05 21:45:26 -08:00
tastybento
77a3797d3b Added EntityInteractListener test class & fixed bug
https://github.com/BentoBoxWorld/BentoBox/issues/1012
2019-11-05 18:26:17 -08:00
tastybento
de2f2a22ce Addresses new types of creature spawning for 1.14.x servers
https://github.com/BentoBoxWorld/BentoBox/issues/1020
2019-10-30 14:16:47 -07:00
tastybento
a27f54a6f7 Fixes tests for IslandTeamCommand 2019-10-27 13:26:22 -07:00
Florian CUNY
85b45df13b Improved the IslandTeamCommand: added last joined timestamp for offline team members
Redid the whole layout - it looks much nicer now!
Implements https://github.com/BentoBoxWorld/BentoBox/issues/997
2019-10-27 13:35:29 +01:00
Florian CUNY
24d6b15340 Fixed MySQLDatabaseHandlerTest 2019-10-20 09:31:40 +02:00
tastybento
c67f1ac48b Made method calls more robust.
Calling these methods using a valid world but one that was not a
gameworld created an NPE. Now they respond with a default value.
2019-10-19 11:32:18 -07:00
tastybento
784988ca54 Test class cleanup. Use Bukkit direct calls instead of Bukkit.getServer 2019-10-18 19:33:24 -05:00
tastybento
02e8243bd0 Fixed admin register of spawn island.
https://github.com/BentoBoxWorld/BentoBox/issues/991
2019-10-18 19:32:54 -05:00
tastybento
bee960d823 Fixes invites.
https://github.com/BentoBoxWorld/BentoBox/issues/988

Adds test classes for IslandTeam command and redoes
IslandTeamInviteCommand test class.
2019-10-17 20:43:01 -07:00
Florian CUNY
a080e4f4c4 Fixed crashing tests 2019-10-13 10:39:27 +02:00
tastybento
6f96f47ae5 Adds invites to trust and coop (#971)
Implements https://github.com/BentoBoxWorld/BentoBox/issues/800

* WIP

* Generic invites for team, coop and trusting.

Needs play testing.

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

* Fixed tests and added handling in trust and coop commands

* Completes invite, trust and coops command and tests.

* Minor documentation/settings improvements

* Renamed InviteType to Invite.Type

* Fixed compilation error
2019-10-13 09:28:49 +02:00
tastybento
e9e10eed75 Fixes island near command for team members.
https://github.com/BentoBoxWorld/BentoBox/issues/981
2019-10-10 08:14:00 -07:00
tastybento
6085deff49 Clears home locations when admin kicking a player
https://github.com/BentoBoxWorld/BentoBox/issues/980
2019-10-09 12:57:29 -07:00
tastybento
94ff2ebf75 Tie banned falling command to world flag and fix bugs
https://github.com/BentoBoxWorld/BentoBox/issues/863
2019-10-03 14:11:32 -07:00
tastybento
215c79d74d Now with a fall distance check!
https://github.com/BentoBoxWorld/BentoBox/issues/863
2019-10-03 13:42:40 -07:00
tastybento
42ba6dcc50 Adds banned commands when falling to WorldSettings
To complete the functionality, the addon will need to overrider the
banned falling command method

https://github.com/BentoBoxWorld/BentoBox/issues/863
2019-10-03 13:34:03 -07:00
tastybento
b448df5418 Improves mob removal on teleport.
Will not remove mobs for chorus fruit, ender pearl or spectator
teleports. Will not remove mobs if the teleport distance is less than
the mob removal distance.
Mob teleport removal is already a world setting.
2019-10-02 16:11:15 -07:00
tastybento
4d861613e9 Added test class for AdminResetFlagsCommand 2019-09-29 14:35:30 -07:00
tastybento
8a1d969103 Added ability to reset one island flag to default for all islands
https://github.com/BentoBoxWorld/BentoBox/issues/958
2019-09-29 14:35:15 -07:00
Florian CUNY
4eae5fada0 Fixed tests compilation errors 2019-09-28 14:05:58 +02:00
tastybento
55544ada0a Fixes island respawn bug.
Not all players were respawning on their island. Also, deaths in nether
or end did not teleport back to overworld island.
2019-09-20 18:39:50 -07:00
tastybento
60e85d6512 No wither damage on non-BentoBox game worlds
https://github.com/BentoBoxWorld/BentoBox/issues/954
2019-09-19 15:37:45 -07:00
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