Commit Graph

39 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
BONNe 6bf12d5e20
Fixes EXP reset for players onJoin and onLeave (#2286)
The total experience does not reset player collected exp. This fixes that, as it will set level to 0 and progress in towards next level to 0
2024-01-30 19:32:13 -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 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 3ecdda65b5
Fixed bug with running onLeave commands (#1929)
In discord, it was reported that running the admin delete command produces a null-pointer if `[player]` placeholder is used.

With fast checking I found out the issue: incorrect user was passed to the command.
Also, I moved runCommands below all resets, so commands could be used to give items, or xp or other stuff that is removed.
2022-01-28 18:42:02 -08:00
tastybento d780bbd4c0
1.18.0 (#1860)
* Mark all home-related methods in PlayersManager as deprecated.

* Fix bug where maxHomes was shown as null

* Version 1.18.0

API changes may break compatibility with Addons.

* Remove usage of deprecated methods except for migration code.

* Prevent NPE. Check isPlayer instead of getWorld() == null

* Fix nullability issue and added to @Deprecated annotations

* Added deprecation notices to home methods in Players
2021-09-26 13:35:18 -07:00
tastybento f6f5b63110 Fix 2021-09-19 08:45:19 -07:00
tastybento 110a282deb Use isPlayer instead of null check.
Refactor code to be easier to understand.
2021-09-19 08:42:37 -07:00
tastybento 53f02ae686
Npe squashing (#1857)
* Fix hanging [uuid] in info.

* NPE checking

* Make getProtectionCenter nonNull

* More NPE fixes.

* Fix test

* Make getPlayer() and getOfflinePlayer() nonNull returns

This requires addons to not use null checks and instead us the isPlayer
or isOfflinePlayer methods.

* NPE blockers

* Deprecate CompositeCommand isPlayer method.

* Fix test
2021-09-18 17:59:32 -07:00
tastybento 8eac5070f0 Null check 2021-09-18 11:37:33 -07: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 b024d0cc8b Switch to use Util method to reset player health.
Reduces duplicate code.
2020-10-11 09:18:53 -07:00
tastybento 09072282bb
Replaces command running with single Util method (#1374)
Adds respawn commands.
2020-06-13 18:51:05 -07: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 b29da53f43 Revert "Made BentoBoxCommand#setup() default (#1258)"
This reverts commit 7de842e284.
2020-04-07 13:38:44 -07: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 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
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
tastybento 6d7f0eaf6d Avoids NPE in Admin Delete 2019-07-05 21:46:35 -07:00
Florian CUNY 64d89f9ca9 Improved success messages for admin commands and fixed failing tests
#630
2019-06-30 08:51:33 +02:00
tastybento 3f217e30ad Adds involved player UUID to IslandDeleteEvent
https://github.com/BentoBoxWorld/BentoBox/issues/790
2019-06-26 19:03:56 -07:00
BONNe 07b4e2d30c Fixed ArrayOutOfBoundsException in admin delete command (#600)
When admins tried to delete island, they got an ArrayOutOfBounds exception.
This will fix it.
2019-03-08 20:38:59 +01:00
tastybento ce0b9569ca Corrected comment 2019-02-10 21:58:56 -08:00
Florian CUNY 865a1d0caa Added BentoBoxCommand#canExecute(User, String, List<String>)
#530
2019-02-10 22:32:33 +01: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 0322ffe0ce Deprecated #getTeamLeader(...) methods
These have been deprecated in CompositeCommand, IslandCache and IslandsManager and they got replaced by #getOwner(...).
2018-11-18 11:12:54 +01: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
tastybento f844b9bb40 Fixed AdminDeleteCommand. 2018-08-18 10:39:07 -07:00
Florian CUNY 539d2a0516 Fixed some code smells 2018-08-15 09:43:28 +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
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 ea0f64a770 WIP added AdminDeleteCommand 2018-08-09 05:13:54 +09:00
tastybento d630c0d739 WIP - needs test class and testing 2018-08-08 13:05:12 +09:00