Commit Graph

742 Commits

Author SHA1 Message Date
tastybento
a8473c27a9 Added test for isCheckForBlocks 2021-02-28 15:25:30 -08:00
tastybento
bae0e6c36f Fix tests. 2021-02-28 15:24:29 -08:00
tastybento
93417d6a6c Test cleanup 2021-02-28 08:10:18 -08:00
tastybento
010a56bc7b Fixed broken tests in IslandsManager 2021-02-28 07:54:13 -08:00
tastybento
dfd4df4e05
Adds maxMembers to the Island object for persistent storage (#1691)
* Adds maxMembers to the Island object for persistent storage

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

* Expanded approach to include coop and trusted ranks.

* Checks for max members/coops/trusts on accept based on island setting.

* Write island max member/coop/trusted if owner joins server

This updates the island's settings based on the owner's permissions.
2021-02-27 11:19:02 -08:00
tastybento
04be4cf7de Fixed long standing bug in unused Util method getClosestIsland
Changed AdminRegisterCommand to use the method to remove code
duplication.
2021-02-17 18:36:57 -08:00
tastybento
969b413588 Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2021-02-16 17:15:19 -08:00
tastybento
97ac70cea3 Handle null users when getting island. Added test case.
A recent change to placeholders meant that it is possible for users to
be null. See https://github.com/BentoBoxWorld/BentoBox/issues/1654
2021-02-16 17:15:07 -08:00
tastybento
6316ca2411
Enables panels to know the context of the world that initiated them. (#1682)
Panel API did not have this context so commands had to force players to
be in the world that the command used. These changes add the world
context to the PanelBuilder and changes the settings panels to use it.
Players and admins can now run settings commands in any world.

https://github.com/BentoBoxWorld/BentoBox/issues/1673
2021-02-16 15:56:34 -08:00
tastybento
14592ec518 Improves obsidian scooping in presence of water.
https://github.com/BentoBoxWorld/BentoBox/issues/1683
2021-02-15 15:50:32 -08:00
tastybento
fb4ad90328 Obsidian scooping was weird with just one bucket.
It's not clear why this was flakey. It might be that the event was being
canceled.

https://github.com/BentoBoxWorld/BentoBox/issues/1683
2021-02-14 22:25:08 -08:00
tastybento
b27d0bbca4 Use BlockInteractionListener to protect Hives and Bee Nests 2021-02-14 16:56:38 -08:00
tastybento
770d8b0bef Harvest listener 2021-02-14 12:52:51 -08:00
tastybento
582aa9fa9e Adds world flag to prevent pets from teleporting off home island
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1442
2021-02-14 11:05:40 -08:00
tastybento
1d9ce7241e
Decouple island location from island center. (#1659)
* Decouple island location from island center.

This enables the protection area to move anywhere within the island
boundaries

* Paste island at island location.

* Move visitors to the island location

* Added island location placeholders

* Use island location instead of island center

* Fix tests

* Allow radius 1 islands.

* Correct admin range set limit

* Debug in progress

* Fix island deletion.

The speed option was doing nothing except causing repeated actions on
the same chunks.

* Soft depend for WorldGeneratorApi for Boxed game mode

* Changed to "protectionCenter".

Added logic to expand the deletion area based on moving the island
protection location and range instead of just deleting everything. This
will keep deletion time to a minimum for BSkyBlock, etc.

* Fix tests.
2021-02-13 10:19:53 -08:00
tastybento
045b11ae1a Fix TestBentoBox test. 2021-02-06 15:10:45 -08:00
tastybento
e7672b17c4 Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2021-02-06 12:08:20 -08:00
tastybento
1da3539f02 Changed AdminSwitchCommand to use player meta data
Fixed tests. Abstracted common test code to AbstractCommonSetup class.
2021-02-06 12:08:09 -08:00
tastybento
4e7b78832a
Nether portals (#1597)
* Add WorldSettings methods for portals

* Vanilla portals option added.

Currently defaulted on for testing. Ultimately, the game mode config can
decide if the vanilla portal is used or not.
Note that the end platform is just a set of obsidian blocks.

* Reduces search radius when close to island edge

* Adds and fixes tests

* Use EntityPortalEnterEvent instead of PlayerMoveEvent

* Removed duplication between nether and end portalling

* Code clean up

* Single event handler for nether and end.

* Created new PlayerEntityPortalEvent class to enable entity teleports

Unfortunately, PlayerPortalEvent and EntityPortalEvent are not fraternal
classes so there's no way to apply code to both except via this
abstraction class.

Tests fail.

* Places end portal always in the same place.

* Teleport entites to nether or end

Identify the teleport cause manually because there is no method.
Teleports to the End happen but seem to be slightly different locations.
Some entities will disappear, others will stick around. I don't know
why.

* Put defaults back to false.

* Create end spawn point to default point when not making end islands

* Fixed PortalTeleportationListener tests.

* Updated since tag
2021-02-02 17:19:22 -08:00
tastybento
1eee225def Added test case for getSafeHomeLocationNoIsland() for player with no
island.

https://github.com/BentoBoxWorld/BentoBox/pull/1651
2021-01-20 16:01:06 -08:00
tastybento
942c1ff3b3 Test clean up.
Due to changes in the PAPI API code, the current tests don't run and are
ignored.
2021-01-17 11:31:40 -08:00
tastybento
42aefc530e Change to assertNotEquals 2021-01-16 11:53:07 -08:00
Florian CUNY
4ce87cd858 Fixed the same test, once again... 2021-01-16 15:37:35 +01:00
Florian CUNY
6105a2fe64 Fixed a test 2021-01-16 15:22:40 +01:00
Florian CUNY
f7e901def9 Ignored failing PlaceholderAPIHook tests for now
There's an issue with the mocking on PAPI's latest version
2021-01-16 14:52:05 +01:00
Florian CUNY
c60833a054 Fixed code smells in tests (SonarCloud) 2021-01-16 14:27:01 +01:00
tastybento
2c7f54fe10 Use orElseGet instead of orElse
orElse is a trap because it evaluates even if the Optional is empty.
orElseGet is the correct way.
2021-01-08 20:05:23 -08:00
tastybento
86af7b568c Fix test for clearArea 2021-01-04 22:53:11 -08:00
tastybento
4f0ef8feb0
Better island meta data api (#1630)
* Improves the meta data API for Island

* Unified API into MetaDataAble Interface

All classes now use the same interface and Optionals. Reduces code
duplication and makes the API the same across the board.

* Version 1.15.6

Fixed since JavaDocs
2021-01-03 11:31:34 -08:00
tastybento
d7c7559546 Adds a persistent metadata API to User and Island classes.
This is modeled after the Bukkit metadata API with the difference that
it is persistent, i.e., metadata is stored to the database. Metadata can
be placed on Islands or Users.

This API should be useful for addons that do not want or need to create
their own database tables and instead just want to tag the user with
some data, or tag the island with some data. It is intended for small
amounts of data, like boolean tags or other values.
2020-12-28 20:39:08 -08:00
tastybento
e84b1f1830 Fix tests that failed due to timezone 2020-12-28 16:35:44 -08:00
tastybento
72de0301e6 Added visited island UUID placeholder
Added test class for game mode placeholders.

Removed duplicated code for visited island placeholders.
2020-12-28 12:18:17 -08:00
tastybento
999d196e8e
Event fix with deprecation (#1623)
* Break out events and add individual handlers

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

* Corrected AddonEvents to have proper static handlers

* Made constructors protected.

Abstract classes should not have public constructors. Constructors of
abstract classes can only be called in constructors of their subclasses.
So there is no point in making them public. The protected modifier
should be enough.
2020-12-27 10:35:49 -08:00
tastybento
d774124d89 Fixed/removed tests
These are no longer relevant as this function is now in the
PlayersManager and tested there.
2020-12-24 21:56:02 -08:00
tastybento
c7d7871f94 Player clean up
Moved per removal to PlayersManager

Added cleanup to IslandResetCommand

Added test class for clean up method.
2020-12-24 15:30:52 -08:00
tastybento
e608a95442 Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1602 2020-12-14 19:08:04 -08:00
tastybento
2cb1e7c306 Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1579 2020-11-26 18:05:26 -08:00
tastybento
caed56f16e Load initial tp location async
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1584
2020-11-26 17:25:17 -08:00
tastybento
5321e1dda6 Prevent exposing vanished players with expel
https://github.com/BentoBoxWorld/BentoBox/issues/1573
2020-11-14 11:59:38 -08:00
tastybento
79f6600fd2 Fixed tests and other small code smells 2020-11-08 16:48:08 -08:00
tastybento
1d4fd435a9 Added World TNT Damage Flag
Enables admins to decide whether TNT should damage outside of island
boundaries

https://github.com/BentoBoxWorld/BentoBox/issues/1562
2020-11-08 10:43:15 -08:00
tastybento
ba903bdaca
Stops async db saving on shutdown. Adds JSON backup. (#1558)
* Stops async db saving on shutdown. Adds JSON backup.

* Fixes test failures and added Util class tests.
2020-11-01 13:58:29 -08:00
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