Commit Graph

57 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 19d81c70c6 Fix for Island team kick requires confirmation when using GUI #2311 2024-03-02 19:29:26 -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
tastybento ca604f893c
Relates to #2104. Adds user.displayName() as a placeholder option (#2108)
* Relates to #2104. Adds user.displayName() as a placeholder option

* Fix test
2023-03-18 10:27:50 -07:00
tastybento a604d5cf82
Add [owner] in command placeholders #2080 (#2081) 2023-01-31 07:13:01 -08:00
tastybento 18983e5570
Code cleanup (#2065)
* Cast operands to (double)

* Code clean up from static analysis

* Revert the GitHubAPI version change because it didn't work.
2022-12-29 10:01:25 -08:00
BONNe ad0931ffcb
Fixes kick command (#1960)
PR #1957 broke kick command and noone could kick players from teams.
This should fix it.
2022-04-03 08:12:41 +03:00
BONNe 9f21314818
Improve team kick command (#1957)
The kick command has an unnecessary owner check. As command should be configurable by island owners, then limiting it to an owner is wrong.
Add a code that allows kicking only lower-ranked players.

Add message that shows who kicked from the island.
Add message that shows that rank does not allow to kick.
2022-03-25 23:29:14 +02:00
tastybento 3a43c40634 Ensure oldIsland is never null. 2021-10-03 16:16:58 -07:00
tastybento ed85dce1b2 Fire TeamLeave and TeamKick events earlier so they can be canceled. 2021-02-20 11:13:55 -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 372f149f3d Remove code duplication between kick and leave command 2020-12-24 14:24:42 -08:00
tastybento b024d0cc8b Switch to use Util method to reset player health.
Reduces duplicate code.
2020-10-11 09:18:53 -07:00
tastybento 9ff62dad2a Added TextVariables.GAMEMODE constant 2020-09-01 16:58:13 -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 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
Florian CUNY 0f6852dac6
Fixed reference "cannot-kick" showing up in IslandTeamKickCommand 2020-04-17 15:03:49 +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
Florian CUNY 77e0f01510 Added options to reset player's health, hunger and XP
Implements https://github.com/BentoBoxWorld/BentoBox/issues/958

Added the following methods in WorldSettings and IslandWorldManager:
* #isOnJoinResetHealth()
* #isOnJoinResetHunger()
* #isOnJoinResetXP()
* #isOnLeaveResetHealth()
* #isOnLeaveResetHunger()
* #isOnLeaveResetXP()
2019-10-13 10:29:32 +02:00
Florian CUNY c53fece28f Added WorldSettings to run commands on island creation/join and deletion/leave
Implements https://github.com/BentoBoxWorld/BentoBox/issues/704

Gamemode addons will need to be updated to use the new WorldSettings, which have been properly documented so it should be easy to write down comments about them.
2019-09-28 13:48:24 +02:00
Florian CUNY 6aff686763 Made the 'owner kicked you from island' message more precise
Implements https://github.com/BentoBoxWorld/BentoBox/issues/923
This also adds a message sent to island members when the owner resets the island.
2019-09-08 15:04:41 +02:00
tastybento 060c602009
Makes command ranks a protection setting (#823) 2019-07-08 20:02:58 -07:00
tastybento b1f66eb31b Fixes bugs and code smells from Sonarcloud. 2019-07-04 16:54:05 -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 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
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 54aa2e61d3
Fixes IllegalArgumentException in VaultHook (#574)
* Added ability to get a User instance from an OfflinePlayer

* Made VaultHook use OfflinePlayer instead of Player

Fixes #572

* Fixed incomplete previous commit
2019-02-21 22:20:50 +01:00
BONNe 54811c5dbd Fix issue with offline players that kept inventory (#564)
Fixes #521 


* Fix issue with offline players that kept inventory, after being kicked out of team. (#521)

* Update src/main/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamKickCommand.java

Co-Authored-By: BONNe <bonne@bonne.id.lv>

* Update IslandTeamKickCommand.java

* Change QuarantinedWorld to PendingKicks.

Increase PlayerChangedWorldEvent event priority.
2019-02-21 16:55:09 +01:00
BONNe 34b2440117 Fixed owners who could not kick team members (#567)
So, UUID cannot be compared with == and !=. It should be always use UUID#equals(UUID) method.
2019-02-19 23:30:37 +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 f71ca4f084 Fixed likely NPE in IslandTeamKickCommand 2019-02-10 13:21:01 +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 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 ae23ad913a Renamed general.errors.not-leader to general.errors.not-owner 2018-12-09 13:18:24 +01:00
tastybento e26d801cf2 Removed deprecated method and replaced with getOwner(). 2018-11-18 19:03:51 -08:00
Florian CUNY c3d57acc11 Added convenience methods to VaultHook
VaultHook#getBalance(User) : double ;
VaultHook#withdraw(User, double) : EconomyResponse ;
VaultHook#deposit(User, double) : EconomyResponse
VaultHook#has(User, double) : boolean.

And made use of these nice new methods where it was needed.
2018-10-31 15:35:40 +01:00
Florian CUNY 0346ea8a23 Added resetting money when joining/leaving island (untested) 2018-10-30 18:22:26 +01: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 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 653e94e0b7 Made sub-class of CompositeCommand called ConfirmableCommand
This class inherits CompositeCommand and adds the confirming system.

It could be renamed Confirmable, like Bukkit has Cancellable for Events.
2018-08-14 11:43:21 +02:00
tastybento d44889e7b0 Added command rank settings and extra ranks. 2018-08-11 21:08:04 -07:00