Commit Graph

20 Commits

Author SHA1 Message Date
tastybento 29be58da5d Fix tests 2024-04-08 21:36:54 -07:00
tastybento aaa1504dc6 WIP multipaper 2024-04-07 17:05:21 -07:00
tastybento 12bf37d2c2
No tabs (#2243)
* Remove all tabs from source and replace with 4 spaces.
2023-12-04 20:55:40 -08:00
tastybento 63d092db93
Multi island api update (#2224)
* Fixes bug with island team joining and deletion. Include debug.

* Remove ambiguous API with mutli-island.

* Add back deprecated methods so developers can be wartned not to use them

* Added back in deprecated methods.

* Fix bugs and NPEs.

* Fix some code smells

* Remove debug logging.
2023-11-12 12:22:12 -08:00
tastybento a4bef159be
2 0 0 multi island (#2185)
* Multi world WIP - stashing

* Initial work on supporting multiple islands per player

The default allowed number is 5 for now, but will be set to 1 by
default.

Lots more work to do on this!

* More work on multi island. Fixed tests so clean compile.

* Remove unused imports

* Updated island go and homes command to multi island

Updated tests.

* Do not reload addons anymore.

* Add island name when entering or leaving own island

* Remove unused import

* Adds island names to /island go command.

* Enables more homes to be set if player has more than one island

* Switch to using a set for islands and explicit primary boolean in Island

* WIP

* Fix bugs with the go command.

* Be able to delete multiple islands, e.g. when joining a team

This is not fully tested.

* Do not remove all islands when a player does reset.

Players can reset just the island they are on.

* More fixes for go command

* Fix tests

* Fix @NonNull annotation

* Fix home syntax listing reference for IslandDeleteHome

* Fixed deletehome for multiple islands.

* Fix /island command teleport to current island default home.

* Remove deprecated code.

* Fix tag for concurrent island setting in config.yml

* Improve error when trying to make additional islands over limit

* Update config.yml

* Correctly assign invites for islands.

* Switch to canExecute API in prep for multi-island handling

* Prevent players from obtaining more concurrent islands by owner transfer

* Handle leaving and disbanding of teams

* Fix tests

* Fix minor bugs or code smells.

* Restore the quarantine code from deprecation.

This code can stay. It checks if islands can load, and if not puts them
in a trash. It does no harm.

* Remove unneeded eq()'s

* Fix tests
2023-09-16 15:55:52 -07:00
tastybento 2c283ae3a9
Javadoc and other cleanup from code analysis (#2099) 2023-02-26 17:48:37 -08:00
tastybento 69fa951907 Handles null player world better on joining server
In theory, this should not be required, but it seems that a player's
world might be null in some edge cases. Alternatively, the Util.getWorld
function can return a null if the player was in a nether or end but that
does not have a corresponding overworld.
Addresses #2057
2022-12-04 20:36:41 -08:00
tastybento cef31306ac Fix JoinLeaveListenerTest 2022-01-28 21:54:30 -08:00
tastybento 3dd9e973fb Island range perms could be 2x island distance
This could allow protection ranges to be much greater than the island
range and therefore overflow into adjacent islands.

https://github.com/BentoBoxWorld/BentoBox/issues/1851
2021-09-11 16:50:43 -07:00
tastybento b906f5561a
Hex pr 1820 (#1822) 2021-08-19 12:09:23 -07: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 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 8e77dc95df Fix perm tests in JoinLeaveListener. 2020-03-18 16:35:20 -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
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
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 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 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