Commit Graph

32 Commits

Author SHA1 Message Date
tastybento 2b19d43c85 Remove restrictions on having multiple islands for team members.
Added API to enable checking for teams on islands easier.
2024-03-29 19:38:44 -07:00
tastybento 13bd1bb8f3
Fix for #2281 (#2282) 2024-01-22 14:50:24 -08:00
tastybento 0e0c502e1d
Team gui (#2251)
* WIP - add GUI for teams.

* WIP teams GUI

* Moe WIP on team GUI

* Modified file to avoid an NPE.

* Minor refactor to prevent int to Integer warning.

* Use latest dependencies for tests to pass.

* Move to singleton pattern for RanksManager,

* Team GUI WIP

* Added support for kick, setowner, and leave.

* Added support for accepting and rejecting an invite.

* Fixed bugs with text and operations.

* WIP for team invites.

* Adds inviting to the GUI.

* Fix tests

* Fixed minor bugs reported by SonarCloud

* Up Minecraft version and paper to 1.20.4 in POM

* Added features based on Discord feedback.

1. added some lore to the invite button to explain the players shown are
from the game world
2. removed the team state in chat
3. added a search to the invite panel

* Added back button.

Refactored some code and templates.

* Fixed bugs with teams and uncoop untrust etc of Ops.

* Return to name search GUI if name not found.

* Added return to GUI for player search

* Use Path.of
2024-01-08 20:50:26 +09: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
BONNe 4200fe4abb
Fixes a bug that removed old owner from island (#2218)
* Fixes a bug that removed old owner from island

These changes fix a bug that was introduced by clearing the island cache from the old owner for 2.0 verison.

This will set the previous owner as sub-owner on the island.

* Fixes rank on event fired.

Changes from Visitor to Sub owner rank

* Update IslandsManager.java

Removes line that removes player from cache. 

They should remain in the cache.

---------

Co-authored-by: tastybento <tastybento@users.noreply.github.com>
2023-10-30 09:17:26 +02:00
tastybento e4836b9cef Remove island number check for owner transfer.
This is not needed anymore (we think).
2023-10-21 07:55:03 -07:00
tastybento ea5529f077
Enables permissions to set how many islands a play can create. (#2201)
Multiple Island Permissions #2199
2023-10-15 19:01:02 -07: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 cfad9879a5 Refactored setowner command and added test class 2021-10-03 19:20:45 -07: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
Florian CUNY de124ab182 Call a RankChange event for the old island owner in Setowner commands
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1342
2020-05-09 11:39:17 +02:00
tastybento b29da53f43 Revert "Made BentoBoxCommand#setup() default (#1258)"
This reverts commit 7de842e284.
2020-04-07 13:38:44 -07:00
Clément P. (Cleymax) 3bd0ff4a69 Added IslandRankChangeEvent (#1260)
Implements #1135

changed name of the event to append Event to it

Call the event in proper places
2020-04-04 21:57:59 +02:00
Florian CUNY 7de842e284
Made BentoBoxCommand#setup() default (#1258)
* Made BentoBoxCommand#setup() "default" and deprecated it

* Undeprecated BentoBoxCommand#setup() and changed its javadoc

* Put back setup in IslandGoCommand and IslandSethomeCommand

* Removed setup in AdminPurgeStatusCommand
2020-04-04 20:40:14 +02:00
tastybento 6e81af47b4 Adds explicit permissions to team commands (#1146)
https://github.com/BentoBoxWorld/BentoBox/issues/1144

Also fixes a bug where the untrust was using the coop perm.

Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
2020-01-25 09:12:12 +01:00
Florian CUNY 3b0f023fac Fixed subcommands not inheriting permissions from parent commands (mostly admin commands) 2020-01-24 21:18:33 +01: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 784988ca54 Test class cleanup. Use Bukkit direct calls instead of Bukkit.getServer 2019-10-18 19:33:24 -05: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
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
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 e26d801cf2 Removed deprecated method and replaced with getOwner(). 2018-11-18 19:03:51 -08:00
Florian CUNY 75e5d29934 Replaced IslandTeamSetownerCommand label to "setowner" instead of "setleader" 2018-10-28 10:28:23 +01:00
Florian CUNY 14a3ed6792 Renamed TeamEvent.TeamMakeLeaderEvent to TeamEvent.TeamSetOwnerEvent 2018-10-28 10:19:55 +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 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
Florian CUNY f89bda6b5d Replaced #setParameters(String) by #setParametersHelp(String) in commands 2018-08-11 13:33:42 +02:00
tastybento 67ab937b97 Revert "Removed useless #setDescription() and #setParameters() in commands"
This reverts commit 0e8e9dde67.
2018-08-10 13:47:58 +09:00
Florian CUNY 0e8e9dde67 Removed useless #setDescription() and #setParameters() in commands 2018-08-09 11:56:05 +02:00
tastybento 3c74ef0694 Moved admin and island commands into API package 2018-08-02 19:26:46 -07:00