Commit Graph

131 Commits

Author SHA1 Message Date
tastybento 4810c4c4ad Adds the ability to include MythicMobs in Blueprints. Fixes #2316 2024-03-10 10:40:26 -07: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
BONNe fc658ca073
Fixes warning about already existing file saving. (#2260)
Spigot JavaPlugin#saveResources either replaces or complains that replacement is disabled. So it is necessary to check if file does not exists before saving it.

Fixes #2259
2024-01-05 06:18:41 +02:00
BONNe 31fb10629a Fixes merge conflicts. 2024-01-04 10:18:25 +02:00
BONNe bfb487342a
Customizable Island Creation Panel (#2255)
* Customizable Island Creation Panel

This implements customizable Island Creation Panel. By default, panel is generated in `/plugins/bentobox/panels` folder, however, if GameModeAddon has a specific panel defined in their folder, then that panel is taken.

* Create UnitTests for new panels

* Add island creation panel saving on loading

* Remove old IslandCreationPanel and move to the new one.

* Fixes some issues with locale and panel

---------

Co-authored-by: tastybento <tastybento@users.noreply.github.com>
2024-01-04 17:14:23 +09:00
BONNe 3be034bfa9
Customizable Language Selection Panel (#2254)
* Customizable Language Selection Panel

This implements customizable Language Selection Panel. By default, panel is generated in `/plugins/bentobox/panels` folder, however, if GameModeAddon has a specific panel defined in their folder, then that panel is taken.

* Migrate LanguagePanelTest to customizable panel.

* Remove original LanguagePanel

* Save language_panel.yml on server starting.

* Fixes some bugs in LanguagePanel.
2024-01-04 17:09:44 +09:00
tastybento cc5c8aa9b6
Adds an ItemAdder hook to delete any blocks when island is deleted. (#2250)
* Adds an ItemAdder hook to delete any blocks when island is deleted.

Also includes a flag for explosions.

* Make the error reporting method non-abstract.

This is not a mandatory method for many hooks.

* Delete this class as it is not used any more and just duplicate.

* Added test class.

* Minor issues resolved.
2023-12-28 10:30:20 +09:00
tastybento 86d8d147d1
Delete slimefun chunks/blocks when island is deleted. (#2247) 2023-12-24 21:24:21 +09:00
tastybento c63de278fe Revert "This changes the loading to not be on STARTUP (#2214)"
This reverts commit 4a6bf31dff.
2023-11-10 10:54:30 -08:00
tastybento 4a6bf31dff
This changes the loading to not be on STARTUP (#2214)
Worlds are then created in onEnable and not one-tick later.
2023-10-28 21:16:36 -07:00
tastybento 489a1e332d Remove unregistration of MV worlds workaround.
This is no longer needed as with
https://github.com/Multiverse/Multiverse-Core/releases/tag/4.3.12 (or
maybe earlier) as the issue is fixed where the generator was not
remembered across reboots.
2023-10-15 13:57:48 -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 08d73f232b Adds a config section in BentoBox to run commands when it is loaded
Commands are run as console.
2023-08-15 17:25:26 -07:00
tastybento 9bd0104a3d Put island deletion under one class manager
The goal is to make BentoBox less of a monster class and have fewer
dependent classes.
2023-07-01 12:49:18 -07:00
tastybento 4c0cb9f17c Unregisters worlds with MV on shutdown.
Fixes #2149
2023-06-26 22:08:49 -07: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
Irmo van den Berge ac4922534e
Register BentoBox World Generator option with MyWorlds (#2039)
Signed-off-by: Irmo van den Berge <irmo.vandenberge@ziggo.nl>
2022-10-19 11:27:12 +03:00
BONNe bf87cca754 Implement proper entity teleportation between dimension.
Teleportation via portals for entities was in a mixed state. It was not fully implemented and not fully prevented. Especially when portal linking was enabled.

Now I implemented world settings flag: ENTITY_PORTAL_TELEPORT.
Enabling this flag will allow entities to use portals to switch dimensions.

Fixes #2023 and #966
2022-09-30 21:33:17 +03:00
BONNe 755aeb866e Rework player teleportation.
I reworked the classes and some teleportation operations. Now teleportation should find the closest available spot, instead of always being the highest block at original Y location. Part of #1994.
Also, I fixed an issue that portals stopped working if some conflicting options were enabled. Now portals will not work only if nether is disabled in config.
2022-09-30 01:26:31 +03:00
BONNe f969f2721f Disable DynmapHook as it is not implemented.
Fixes #1995
2022-07-06 20:39:15 +03:00
tastybento d14ad977ab Clean up imports. 2022-01-22 13:14:57 -08:00
tastybento 00e174258e Hook into Vault after other plugins have loaded.
https://github.com/BentoBoxWorld/BentoBox/issues/1913
2022-01-07 19:08:15 -08:00
Huynh Tien ce1d8e5117
Rework the chunk deletion (#1897)
* delete island one by one

* register before IslandDeletionManager

* optimize imports

* setting

* just some indents

* config

* run synchronously

* a bit reformat before recoding

* proper delete chunks

* comment

* combine the task call

* expose the NMS Handler

* don't have to try-catch this

* we know that this is final

* expose copy chunk data so that it can be overridden

* Don't have to use Vector

* set block from minimum height

* remove NMS and use fallback if not set

* only get the height once

* fix test
2022-01-01 17:38:27 -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 29fa03976c Fix some code smells. 2021-09-19 18:29:19 -07:00
tastybento 063fa97cf3
Removed the unused WorldEdit hook. (#1853)
If someone wants to add it back later they can, but this code does
nothing right now.
2021-09-13 19:46:10 -07:00
tastybento 23857501f5
Static code analysis (#1844)
* StringBuffer (Java 5) may be declared as StringBuilder

* Replace map with flatMap

* Use instanceof naming

* No need to specify paramter types.

* Remove verbose code

* Fix JavaDoc issues

* Make internal class a record.

* Remove unused import.

* Make internal class a record.

* Made internal class a record.

* Removed unused import

* Fix typos

* Fix typo in test.
2021-08-29 18:17:38 -07:00
Florian CUNY 8ecfee4359
Added since javadoc to getIslandsManager and getPlayersManager()
Completes 2bef0fe57c
2021-03-21 22:08:21 +01:00
tastybento 99e6e11a4a Disable LangUtilsHook for now until @Poslovitch can review. 2021-03-19 15:18:44 -07:00
apachezy 0f0d8b9ebc
Added LangUtils support. (#1693) 2021-03-12 20:04:34 -08:00
tastybento 2bef0fe57c Added convenience methods getPlayersManager() and getIslandsManager()
This just helps make the API more friendly and consistent with other
manager getters.
2021-01-24 14:14:31 -08:00
tastybento 9570f342ee
Add try catch around second stage plugin loading task. (#1609)
https://github.com/BentoBoxWorld/BentoBox/issues/1281
2020-12-19 10:28:46 -08:00
Gabriele C b74eeb95d8
Prevent save task overlaps (#1588) 2020-11-27 10:21:39 -08:00
Gabriele C 232d9097cf
Limit island/player saves per tick (#1578)
* limit island/player saves per tick

* Whoops

* 20 players/islands per tick should be enough

20 players/islands * 20 tick * 60 seconds * 5 minutes (default interval) = 120000 saved entries :)
2020-11-27 10:12:10 -08:00
tastybento ba903bdaca
Stops async db saving on shutdown. Adds JSON backup. (#1558)
* Stops async db saving on shutdown. Adds JSON backup.

* Fixes test failures and added Util class tests.
2020-11-01 13:58:29 -08:00
tastybento ab6799c159 Remove fancy error printing. Just print raw error. 2020-07-16 12:32:51 -07:00
tastybento e364094a4f This stops BentoBox if there is an island distance mismatch. 2020-07-15 18:09:32 -07:00
tastybento 88b331d1e4 MySQL databases were not saving properly on shutdown.
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1292
2020-04-20 18:37:42 -07:00
tastybento b6dd7d114e Revert "Fixed BentoBox not properly disabling if errors at startup (#1285)"
This reverts commit ee2f86ae3b.
2020-04-20 07:26:34 -07:00
tastybento ee2f86ae3b
Fixed BentoBox not properly disabling if errors at startup (#1285)
Fixes #1281
2020-04-20 13:15:55 +02:00
Florian CUNY 962b7d734a Removed MVdWPlaceholderAPIHook and all related methods
It was increasingly causing issues, ranging from long start times, unreliability with some of our placeholders, to much more...
There's a way for MVdWPAPI users to get PAPI's placeholders, so they should definitely use that instead.
2020-04-04 15:38:29 +02:00
Florian CUNY e322f4047a Moved BSTATS_ID to the BStats class 2020-03-21 10:49:58 +01:00
NotMyFault 530a76b0a8
Improve bStats playersPerServer chart (#1225)
Updated bStats to 1.7.
Removed the "metrics" config option as it is now part of bStats's own `config.yml`.
2020-03-18 08:32:35 +01:00
tastybento 784988ca54 Test class cleanup. Use Bukkit direct calls instead of Bukkit.getServer 2019-10-18 19:33:24 -05:00
tastybento 595de7a602 Waits until blueprints loaded before firing BentoBoxReady event
https://github.com/BentoBoxWorld/BentoBox/issues/985
2019-10-13 21:02:25 -07:00
tastybento 2db926f640 Spreads out backup database saving to avoid lag
https://github.com/BentoBoxWorld/BentoBox/issues/976
2019-10-07 16:16:26 -07: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
tastybento deb21e7ed6 Adds GameModeAddon method that is called when BentoBox loads all addons.
Required to fix https://github.com/BentoBoxWorld/BentoBox/issues/940
2019-09-13 20:43:53 -07:00
Florian CUNY 87e4aeb9fb Added a warning on startup stating to switch from YAML asap 2019-09-08 16:20:48 +02:00
tastybento 0f16d58ee7 Uses a single config object instead of a new one every save.
Required to avoid concurrent async saves clashing.
2019-07-18 21:55:23 -07:00