Commit Graph

34 Commits

Author SHA1 Message Date
tastybento 29be58da5d Fix tests 2024-04-08 21:36:54 -07: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 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 2c283ae3a9
Javadoc and other cleanup from code analysis (#2099) 2023-02-26 17:48:37 -08:00
tastybento 500f7292c6 Fix tests. 2021-09-25 09:34:02 -07:00
tastybento 0a4fc83218 Fix tests - just counts of events. 2021-09-25 08:33:07 -07:00
tastybento 999d196e8e
Event fix with deprecation (#1623)
* Break out events and add individual handlers

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

* Corrected AddonEvents to have proper static handlers

* Made constructors protected.

Abstract classes should not have public constructors. Constructors of
abstract classes can only be called in constructors of their subclasses.
So there is no point in making them public. The protected modifier
should be enough.
2020-12-27 10:35:49 -08:00
tastybento 9ff62dad2a Added TextVariables.GAMEMODE constant 2020-09-01 16:58:13 -07:00
tastybento f7a3da1502 Fixes IslandResetCommandTest failure 2020-03-04 18:47:37 -08: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
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 3f1d6d16ff Added Mockito.framework().clearInlineMocks() to all test classes per
https://github.com/mockito/mockito/wiki/What%27s-new-in-Mockito-2

This is just e defensive measure and may not have an affect on any
particular class.
2019-12-06 08:29:29 -08:00
tastybento 5164b1a02d Leader should not see kicked message
Adds test to make sure leader does not see kicked string and fixes
ignores.
2019-09-13 20:41:14 -07:00
Florian CUNY 5f65ba5968 Ignored error-ing tests
I need to learn how to deal with it, but for now I'd like 1.7.0 to be released before I got to go.
2019-09-08 15:52:14 +02:00
tastybento 60d7dfef85 Adds constructor to IslandResetCommand to allow no pasting
This is for games like SkyGrid that do not need pasting of a blueprint.
2019-08-30 10:16:05 -07:00
tastybento fa4c772572 Fixes IslandResetCommand test 2019-08-29 15:32:50 -07:00
Florian CUNY bf6659708c Ignored failing tests 2019-08-29 20:57:26 +02:00
tastybento 44cbd81320 Moved to Mockito 2 and PowerMock 2019-08-04 21:44:46 -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
Florian CUNY af2f600621 Fixed tests in IslandResetCommandTest 2019-04-08 11:34:51 +02:00
tastybento f983aa5f44 Fixed permission bug with custom schems and reset
https://github.com/BentoBoxWorld/BentoBox/issues/509
2019-02-01 20:51:57 -08:00
Florian CUNY 0f5b5b5693 Fixed IslandResetCommand tests 2019-01-18 21:24:46 +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 607db5b07f Removed some 'throws IOException' in IslandResetCommandTest 2018-12-09 13:20:49 +01:00
Florian CUNY ae23ad913a Renamed general.errors.not-leader to general.errors.not-owner 2018-12-09 13:18:24 +01:00
Florian CUNY a04a0cb3d0 Replace code referencing "teamleader" to "owner"
This will improve the consistency of the code, as well as the Javadocs.

Locales (and some other files) still need to be updated to remove these references to team leader.
2018-12-09 11:28:31 +01: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
Florian CUNY e11f173ca3 Made /is reset use the command cooldown API + switched "wait" settings to int
Aaaand had to update some tests. Lots of tests.
2018-08-14 21:11:46 +02:00
tastybento 82c35f9aa9 Fixed test breaks. 2018-08-12 14:28:25 -07:00
tastybento ba557a1068 API Breaker: renamed BSB classes to be just BB
Hopefully, this is the last API breaker. I renamed the classes that
started with BSB to be just BB (bentobox). I now have to fix all the
add-ons I just broke...
2018-08-05 20:08:03 -07:00
tastybento 765268aa25 Code cleanup using Intellij 2018-08-04 21:50:10 -07:00
tastybento 3c74ef0694 Moved admin and island commands into API package 2018-08-02 19:26:46 -07:00