Commit Graph

46 Commits

Author SHA1 Message Date
tastybento 2c75939bc3 JavaDoc and import changes 2024-04-06 09:08:11 -07:00
tastybento 0e6a25d74b WIP - needs work on team invites. 2024-03-29 20:26:07 -07:00
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 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 397f9e4700 Added more JavaDoc for API usage 2023-08-01 09:43:47 -07:00
tastybento f00320095d Added since and forRemoval to Deprecated annotations. 2023-02-05 15:55:51 -08:00
tastybento a604d5cf82
Add [owner] in command placeholders #2080 (#2081) 2023-01-31 07:13:01 -08:00
tastybento 10a73e66b4 Added explicit @since annotation 2023-01-01 09:25:09 -08:00
BONNe db323390cf
Implements adding unknown default island flag values in settings. (#2001)
* Implements option to define non-existing flags in WorldSettings.

This change adds 2 new methods in WorldSettings:
* WorldSettings#getDefaultIslandFlagNames
* WorldSettings#getDefaultIslandSettingNames

These methods replace getDefaultIslandFlags and getDefaultIslandSettings methods.
Default implementation just reads values from replaced methods.

Fixes #1830

* Implement conversion from flag id to actual flag object.

Replaces flag assignment to new island based on flag id's.

Fixes #1830

* Switch from Flag object to String object in Island class.

This switch allows to keep flags that are not present in current BentoBox installation. Otherwise, unknown flags may cause an issues.

Fixes #1830

* Implement FlagBooleanSerializer.

This serializer converts input map of String, Boolean to map of String, Integer.

This map is used to read island setting flags, and integer value is not classic boolean values. (0 for true and -1 for false).

Fixes #1830
2022-07-06 20:20:08 +03:00
tastybento 6309c675d4 Added a way to skip block checking for game modes.
https://github.com/BentoBoxWorld/BentoBox/issues/1694
2021-02-28 15:22:57 -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 09072282bb
Replaces command running with single Util method (#1374)
Adds respawn commands.
2020-06-13 18:51:05 -07:00
tastybento 6fa89b0b4d
Uses Locale.ENGLISH for toLowerCase and toUpperCase (#1378)
The locale should be explicitly declared otherwise the default locale of
the operating system will be used, which may result in unexpected bugs.
2020-05-30 21:52:05 +02:00
BONNe 97341ce657
Add DefaultPlayerCommand and DefaultAdminCommand (#1293)
Helps to implement #498.

Also added 4 new WorldSettings methods:
* getAdminCommandAliases()
* getPlayerCommandAliases()
* getDefaultPlayerAction()
* getDefaultNewPlayerAction()

Co-Authored-By: Florian CUNY <poslovitch@bentobox.world>
2020-04-26 00:57:14 +02:00
Clément P 0f2ba0e202
Added coop and trust limits (with permissions) (#1267)
Implements #1065.

Added two new permissions:
* [gamemode].trust.maxsize.[NUMBER]
* [gamemode].coop.maxsize.[NUMBER]

Added two new WorldSettings and related methods in IWM:
* getMaxCoopSize() (defaults to 4)
* getMaxTrustSize() (defaults to 4)

* Add limit for coop players #1065

* Edit comparison sign

* Add limit for trust players #1065

* Add default value and add since javadoc tags

* improved messages

* readded missing "

Co-authored-by: Florian CUNY <poslovitch@bentobox.world>
2020-04-05 14:28:59 +02:00
tastybento 06b5aac36f
Added LIMIT_MOBS flag (WORLD_SETTING) (#1155)
It provides a way to prevent selected EntityTypes from spawning at all.
Partially implements https://github.com/BentoBoxWorld/BentoBox/issues/1133
2020-02-16 13:12:32 +01:00
Florian CUNY 70f8538b74
Updated WorldSettings#getOnLeaveCommands() javadoc 2020-01-12 15:18:30 +01:00
Florian CUNY 48f898aa2c Added WorldSetting#isTeleportPlayerToIslandUponIslandCreation()
Implements https://github.com/BentoBoxWorld/BentoBox/issues/1032
2019-12-23 15:01:32 +01:00
tastybento e8810d41d9 Added a setting to be able to disable auto nether/end island pasting
https://github.com/BentoBoxWorld/BentoBox/issues/1063

Note that corresponding settings must be added to game mode addons.
Also, note that I added this as a default method so that it will not
break current older game mode addons.
2019-12-15 16:03:43 -08:00
tastybento 22cd2379d3 Javadoc fixes 2019-12-01 09:03:22 -08:00
Florian CUNY a1b7df19c7 Added WorldSettings options to create island on first login
Implements https://github.com/BentoBoxWorld/BentoBox/issues/889
2019-11-09 17:50:27 +01: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
tastybento 42ba6dcc50 Adds banned commands when falling to WorldSettings
To complete the functionality, the addon will need to overrider the
banned falling command method

https://github.com/BentoBoxWorld/BentoBox/issues/863
2019-10-03 13:34:03 -07: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 5fe4cccf7b Corrects wrong branch commit for world protection flags.
https://github.com/BentoBoxWorld/BentoBox/issues/840
The previous commit was a different approach. This is the correct one.
Does not break API.
2019-07-13 19:31:20 -07:00
tastybento 574fbc182f Added world protection settings to config
https://github.com/BentoBoxWorld/BentoBox/issues/840

This adds (or fixes) the ability for admins to set the default setting
of a protection flag. The flags go in the world flags section of a game
mode's config.yml.
2019-07-13 15:25:10 -07:00
tastybento b6fcf511a6 API addition - adds reset deaths on new island (#817)
* API addition - adds reset deaths on new island

BentoBox currently tracks deaths in the worlds but the current API only
allows them to be reset when a player joins a team. This setting enables
deaths to be reset when a player starts a new island or resets an
island.

WARN: This should be the only additional WorldSetting we need for deaths.

* Update src/main/java/world/bentobox/bentobox/api/configuration/WorldSettings.java

* Update src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java

* Update src/main/java/world/bentobox/bentobox/managers/island/NewIsland.java

* Update src/main/java/world/bentobox/bentobox/managers/IslandWorldManager.java
2019-07-07 07:59:49 +02:00
tastybento 8b79ce3b3e Removes nether trees (#822)
https://github.com/BentoBoxWorld/BentoBox/issues/746

NOTE: The settings will need to be removed from the game mode addons too otherwise it will be confusing to admins.
2019-07-07 07:52:48 +02:00
tastybento 88a3ebbf2a Removed sum deaths setting.
This setting was originally for the ASkyBlock level calculation and so
should go into the Level addon, not BentoBox.
2019-06-08 09:05:49 -07:00
Florian CUNY c79df4c813 Added javadoc since tags in WorldSettings 2019-06-08 08:01:42 +02: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 f0baeece3d Added sum deaths setting support.
Other items WIP
https://github.com/BentoBoxWorld/BentoBox/issues/738
2019-06-07 21:00:13 -07:00
tastybento 180b88544a Database transition (#662)
- JSON is now the default database type
- JSON database files are now pretty-printed
- It is now possible to migrate from a database type to another through the use of a command and specific transition database types
- It is recommended to move from YAML to JSON.

= Commits breakdown =

* Proposal to make JSON the default database and retire YAML.

* Make JSON file format easier to read.

* Fix tests.

* Adds a hybrid Yaml2Json database type.

This database always tries to use JSON if it is available. If a YAML
file is found, it will be loaded and replaced with a JSON file.

* Move to generic database transition code

* Better comments

* Adds transitional database options so admins can choose.

Adds Yaml2MySQL option and changes config.yml to add instructions.

* Enables full database migration between databases.

Adds /bbox migrate command.

Adds a number of transition databases. DB starts transition  when the
server boots up and will migrate organically. The admin can force an
immediate update using the bbox migrate command.

This operation requires an API breaking change: Addons that use the
Config API must now implement ConfigObject in their config class instead
of DataObject. This is to differentiate YAML config classes from YAML
database classes. If a class is already implements WorldSettings
(GameModeAddons), then no change is required because WorldSettings
implements ConfigObject now. If an old addon is used that does not
implement ConfigObject, BentoBox will not load.

* Added null check to YAML deletion

* Removed the 2YAML transition dbs because YAML is deprecated.

YAML does not support some data structures so conversion could corrupt
data.

* Fixed some javadoc and added missing DatabaseType#JSON2MARIADB

* Renamed package database/transitiondb to database/transition
2019-05-08 21:15:22 +02:00
tastybento 23491d0c4a
Flag visibility (#617)
* Saves world settings to config.yml when they are changed mid-game.

* Fixes and adds to tests

* WIP: Added visibility settings for flags.

Tests still need to be fixed and requires saving to config.yml.

* Fixes tests

* Completed changes.

* Renames method to be hidden flags instead of visible settings

GameModeAddons will need to adjust WorldSettings API based classes.
2019-03-23 15:38:06 -07:00
tastybento 5351b162c5 Moved obsidian scooping to be a world flag in settings 2019-01-03 09:46:56 -08:00
Florian CUNY 708c014d14 Moved allowObsidianScooping to WorldSettings and renamed ObsidianToLava to ObsidianScoopingListener
#432
2019-01-03 16:30:36 +01:00
Florian CUNY c078d8dce6 Added ban limit (#getBanLimit() in WorldSettings)
Closes #423.

I had some trouble with unit testings, that's why I didn't update them to test the new features :(
2019-01-02 14:37:52 +01:00
Florian CUNY efd0aba8e8 Improved WorldSettings Javadoc 2019-01-02 13:45:21 +01:00
tastybento b374096c6e WIP: Shifted to GameModeAddon for IWM 2018-12-27 17:25:14 -08:00
Florian CUNY 76af2335e2 Finished max-islands (from WorldSettings) 2018-12-09 14:19:53 +01:00
Florian CUNY ec2793e6f8 Made IslandSethomeCommand a ConfirmableCommand
#237

It adds a bunch of WorldSettings and updates the en-US locale as well!
2018-10-25 09:43:36 +02:00
Florian CUNY 87c54aaf08
Added #isDeathsCounted() in WorldSettings
#164
2018-10-07 10:24:22 +02:00
tastybento f152d218fc Removed entity and tile limit settings from world settings
The functionality of limiting certain entities or tile entities can be
provided by an addon instead.
2018-08-17 17:42:57 -07:00
tastybento 765268aa25 Code cleanup using Intellij 2018-08-04 21:50:10 -07:00
tastybento 783caf985f Added generic cooldown methods to CompositeCommand
This API enables any command to have a cool down and to have that cool
down called by another command. For example, the Kick command sets the
cool down on the Invite command. It is possible for commands to set cool
downs on themselves too.
Currently, cool downs are not stored persistently in the database so
they disappear if the server is reloaded. This should be okay for now.
2018-08-04 18:45:13 -07:00
Florian CUNY 3473fb48e6 Renamed 'world.bentobox.bbox' to 'world.bentobox.bentobox' 2018-07-31 18:03:32 +02:00