Commit Graph

35 Commits

Author SHA1 Message Date
tastybento 83eaa50b49 Refactor to improve code quality 2024-03-31 18:16:45 -07:00
tastybento 1215a43766 Add feature to limit blueprint availability. 2024-03-31 17:29:18 -07: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
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 af3b0bba2d
Fixes missing locale text
The message was linked to a non-existing path.
2023-10-20 20:01:41 +03: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
BONNe 35ce1a7d81
Rework blueprint and blueprint bundle names. (#2026)
* Fixes issue when blueprint clipboard was stuck after saving.

The issue was that Map#putIfAbsent still creates a new task, even if object is already in map. The usage requires to use Map#computeIfAbsent.

* Rework blueprint and blueprint bundle names.

There was an issue with using non-english characters in blueprint names. It was not possible, as all chars for names were converted to lower cased english letters. It included display names.

I reworked it a bit and now it should be possible to set non-english names for bundles and blueprints.

Fixes #1954
2022-09-29 18:44:07 +03: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 27c1b6505c Uses and catches specific IOException for new islands
Relates to c3442c29ba
2019-12-16 17:24:48 -08:00
tastybento c3442c29ba Reworked how new island spots are found.
Fixed bug where max attempts check was not working, which could cause a
timeout crash.

https://github.com/BentoBoxWorld/BentoBox/issues/1057
2019-12-15 14:41:59 -08:00
tastybento d5d6f20bb9 Remove imports 2019-10-25 17:31:24 -07:00
Florian CUNY 8692685822 Improved user feedback when pasting (creation/reset) an island
Implements https://github.com/BentoBoxWorld/BentoBox/issues/996
2019-10-21 17:55:35 +02:00
tastybento 65aee40533 Code smell cleanup 2019-07-27 17:19:04 -07:00
tastybento 6926ecbb9e Implements an island reservation system using the admin register command (#850)
* Implements an island reservation system using the admin register command

Admin flies to an empty spot and registers the player there. This
creates a bedrock block to mark the spot but it sets the island as
reserved for the target player. The next time a player issues the island
command (or island create) they get the selection of islands and it is
pasted at that location.

https://github.com/BentoBoxWorld/BentoBox/issues/749

* Update src/main/java/world/bentobox/bentobox/database/objects/Island.java

Co-Authored-By: Florian CUNY <poslovitch@bentobox.world>

* Update src/main/java/world/bentobox/bentobox/database/objects/Island.java

Co-Authored-By: Florian CUNY <poslovitch@bentobox.world>

* Update src/main/java/world/bentobox/bentobox/database/objects/Island.java

Co-Authored-By: Florian CUNY <poslovitch@bentobox.world>

* Update src/main/java/world/bentobox/bentobox/database/objects/Island.java

Co-Authored-By: Florian CUNY <poslovitch@bentobox.world>
2019-07-22 00:36:14 +02:00
tastybento d5be5f81c2 Fixes and adds tests for IslandCreateCommand
Tests were failing from 824a744cd1
2019-06-09 17:18:17 -07:00
Florian CUNY 824a744cd1 Fixed the Island Creation Panel showing although there is 1 bundle available
Implements #744
2019-06-09 23:05:47 +02: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
tastybento 7ea0edea91 Shifted panel to IslandCreationPanel 2019-05-18 12:22:19 -07:00
tastybento 6b6a757727 Temporarily enabling the blueprint selection panel.
Please replace when the alternative panel does something.
2019-05-15 19:24:31 -07:00
tastybento 700043fe40 Implemeted Blueprint bundles and blueprints (#672)
* A prototype for Blueprint bundles and blueprints

This stores blueprints inside bundles. Each bundle can have up to 3
blueprints defines by the World.Environment.

This is not a finished manager. It just handles all the saving and
loading side of things. I thought this would help you so you can then
concentrate on the UI.

* WIP: Copy blocks to Blueprint done.

* WIP Pasting done.

* WIP: Added BlueprintsManager to ultimately replace SchemsManager.

* Moved blueprint suffix and changed to .blu

* Fixed unit test.

* Now tested and working.

Integrated with new island and resetting island.

If there are no blueprint bundles or blueprints then a default bedrock
set will be made and put in the game mode addon's blueprints folder.

Still to do: enable schems to be loaded and pasted for legacy support.
Add blueprints and a bundle to GameModeAddons like BSkyBlock.

* Renamed most of the classes

* Cleaned up clipboard and paster.

* Further cleanup on blueprint clipboard and paster.

* Merged blueprint classes into one package.

* Put Blueprint data objects in their own package.

Isolated schems classes for later removal.

* Renamed admin command classes and changed locale files.

* More clean up to remove schems

* Schem to blueprints converter done.

Converts schems to blueprint bundles and sets up a default set. Tested
the happy-path. Need to do more testing on edge cases.

* Added basic UI for development. Fixed bug with schem conversion.

* Adds permissions into the blueprints.

Fixes tests, cleans up some naming

* Added IslandCreationPanel and created BlueprintManagementPanel

* Fixed JSONDatabaseHandler's constructor being public

* Made the Blueprints button in ManagementPanel open the Blueprint management panel

* Fixed tests and ignored one (NPE)
2019-05-15 20:16:41 +02:00
tastybento 4e73d7de5a Improvements to the Paster (#632)
* Version up 1.4.1-SNAPSHOT

* Sets pos1 and pos2 after pasting a loaded schem

Corrects version name in POM.

* Shifted schem name validation into SchemsManager
2019-04-14 01:54:04 +02:00
tastybento cfa6861e58 Added IslandCreateCommand test and use of canExecute API. 2019-03-09 22:09:54 -08:00
tastybento 8334de8cba Fixes island pasting issue when pasting clipboard every tick.
https://github.com/BentoBoxWorld/BentoBox/issues/535

due to race conditions with task timers and incorrectly shared field
variables, islands would not paste completely if pasted every tick.
Now pasting is handled in its own class with a new instance created with
each paste.
2019-02-10 15:36:37 -08:00
Florian CUNY 2bec47ba90 Made User#hasPermission(String) return true if the user is op 2019-02-08 21:17:57 +01:00
Florian CUNY aea057317b Added option to apply the reset cooldown when the player creates an island for the first time
Closes #456.
2019-01-27 10:10:25 +01:00
Florian CUNY 29d0cb6eb3
IslandCreateCommand: add "new" alias 2019-01-23 15:39:41 +01:00
tastybento 0adc2e3078 Uses current API to enable multiple schems.
This will load all schems in an add-on's schem folder if it exists and
associate them with this world set (overworld, nether and end). Schems
can be named anything, but the partner nether or end worlds must be
pre-fixed with "nether-" or "end-" in the filename.
Additional schems can be added by the admin into the schem folder, or
they can be stored in the jar file of the add-on. Both are supported.

No changes are required to current add-ons. I.e., there is no API
breakage here, but I would like to rename the SchemsManager method
loadIslands(World world) to be loadSchems(World world) in the future.

Related issues/PR:
https://github.com/BentoBoxWorld/BentoBox/issues/104
https://github.com/BentoBoxWorld/BentoBox/issues/207
https://github.com/BentoBoxWorld/BentoBox/issues/378
https://github.com/BentoBoxWorld/BentoBox/pull/408
2018-12-23 19:31:00 -08:00
Florian CUNY 76af2335e2 Finished max-islands (from WorldSettings) 2018-12-09 14:19:53 +01:00
Florian CUNY 102ad864e1 Simplified condition in IslandCreateEvent 2018-09-15 10:44:04 +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