Commit Graph

46 Commits

Author SHA1 Message Date
tastybento 1215a43766 Add feature to limit blueprint availability. 2024-03-31 17:29:18 -07:00
tastybento 78f84de3cb Use Bukkit pasting if user is too close to new island.
This prevents players experiencing invisible blocks at the expense of
lag.
2024-02-23 23:04:47 -08:00
tastybento 872940011a Loads of minor code smell fixes
Mostly replacing instanceof check and cast with e.g. 'instanceof Player
player'
Replaced some "switch" statements by "if" statements to increase
readability.
Used the primitive boolean check to avoid potential NPEs.
Reordered field modifiers to comply with the Java Language
Specification. Mainly @NonNull position.
2022-12-31 18:19:25 -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 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
BONNe d8fa029ac9
Fixes an issue where Blueprint Pasting did not send or include nether and the end blueprints times. (#1979) 2022-06-16 22:44:38 +03:00
tastybento 9dc4ebc2d1
Make variables final if they can be. (#1843)
* Make variables final if they can be.

* Do not use final so that test can pass.

For testing, we use a trick to set this variable, but it won't work if
it is final. Right now, I'd like to keep the test.
2021-08-29 18:17:21 -07:00
tastybento 54bc554763 Code smell reduction 2020-09-12 16:55:54 -07:00
tastybento 1ebae9b1a4
Uses completablefutures to paste islands sequentially (#1410)
* Uses completablefutures to paste islands sequentially

* Removes debug
2020-06-22 00:01:30 +02:00
Florian CUNY 5d08f15d5f Removed Schem to Blueprint conversion
It was introduced in BentoBox 1.5.0 and bStats shows that all the servers are using BentoBox 1.5.3+. We can therefore safely remove this from BentoBox.
2020-06-02 14:01:35 +02:00
Florian CUNY 2e04619cd9 Got rid of a null-check for blueprints' names
Blueprints' names can no longer be null
2020-06-02 10:29:05 +02:00
tastybento a6d6895676 Fixes admin blueprint delete command
https://github.com/BentoBoxWorld/BentoBox/issues/1382
2020-06-01 12:15:49 -07:00
Florian CUNY c5eb8ac7e7 Fixed some code smells 2020-02-11 11:28:15 +01:00
tastybento 9f65537ab8 Load chunks before pasting islands. Runs async.
1.15.2 can take a looooong time to load a chunk, sometimes up to 10
seconds.

https://github.com/BentoBoxWorld/BentoBox/issues/1180
2020-02-10 20:14:43 -08:00
Florian CUNY c307f9b844 Prevent loading Blueprint Bundles that have duplicate uniqueIds
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1117
I also slightly improved the logs.
2020-01-11 11:38:30 +01:00
Florian CUNY 31d92961b7 Added some nullability annotations in BlueprintsManager 2020-01-11 11:21:15 +01:00
Florian CUNY 13fab3173e Added AdminBlueprintDeleteCommand
Implements https://github.com/BentoBoxWorld/BentoBox/issues/1048

Also added BlueprintsManager#deleteBlueprint(GameModeAddon, String)
Fixed a code smell in AdminBlueprintSaveCommand
2019-12-01 11:54:23 +01:00
tastybento ff60127762 Sanitizes blueprint and bundle names
https://github.com/BentoBoxWorld/BentoBox/issues/1038

Allows spaces to exist in the bundle names.

Added tests to check for bad chars and foreign chars in names.
2019-11-25 19:57:11 -08: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
Florian CUNY 27647da6f4 Force the Blueprint name to be lowercased using English locale 2019-10-05 22:22:25 +02:00
tastybento 6cd8c70bd4 Pastes default nether or end blueprints if island doesn't exist
Fixes issue where the nether-island or end-island named blueprints were
deleted.

https://github.com/BentoBoxWorld/BentoBox/issues/943
2019-09-15 14:10:52 -07:00
tastybento fefa806852 Fixes concurrency issue when loading blueprints and bundles
https://github.com/BentoBoxWorld/BentoBox/issues/868
2019-07-30 08:58:43 -07:00
tastybento 799decfcac More defensive code. 2019-07-28 13:36:17 -07:00
tastybento 998d5390d1 Added defensive code.
https://github.com/BentoBoxWorld/BentoBox/issues/868
2019-07-28 13:31:35 -07:00
tastybento 2403cd201f Fixes tests, removes debug. 2019-07-27 10:43:58 -07:00
tastybento e009cf5152 Fixes default bundle loop error.
If an addon doesn't have any default bundles a default one is made, but
the previous code was making multiple attempts to do that instead of
doing it once.
2019-07-27 10:15:37 -07:00
tastybento 3f3ac57f1e Cleans up code smells. 2019-07-11 13:55:17 -07:00
tastybento 349f339be3 Fixed tests for BlueprintsManager.
https://github.com/BentoBoxWorld/BentoBox/pull/811
2019-07-04 13:08:50 -07:00
CustomEntity 6e8d5ef903 More async stuff & WorldEdit integration: Blueprint ClipboardFor… (#811)
* Add asynchronous task

* First commit

* Add asynchronous tasks for Blueprint.

* Add BlueprintSchematicConverter class to convert schematic in blueprint and inversely

* BlueprintClipboardReader, BlueprintClipboardWriter and BlueprintClipboardFormat have been added !

* BlueprintClipboardReader, BlueprintClipboardWriter and BlueprintClipboardFormat have been added !

* javadoc in BlueprintClipboardFormat

* Rename src/main/java/world/bentobox/bentobox/blueprints/BlueprintClipboardFormat.java to src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintClipboardFormat.java

* Update and rename src/main/java/world/bentobox/bentobox/blueprints/converter/BlueprintClipboardReader.java to src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintClipboardReader.java

* Update and rename src/main/java/world/bentobox/bentobox/blueprints/converter/BlueprintClipboardWriter.java to src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintClipboardWriter.java

* Update and rename src/main/java/world/bentobox/bentobox/blueprints/converter/BlueprintSchematicConverter.java to src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintSchematicConverter.java
2019-07-04 09:22:59 +02:00
tastybento d6248a3577 Fixes code smells. 2019-06-23 19:13:00 -07:00
tastybento f50e59eef1 Fixed right click not clearing blueprints in management panel
Fixed NPE if a bundle does not have an end or nether bp.
2019-06-15 22:09:17 -07:00
tastybento a0e35b240b Added BlueprintsManagerTest and improved BlueprintsManager 2019-06-15 09:47:05 -07:00
tastybento d57a9aa6d8 Remove debug logging. 2019-06-05 19:32:03 -07:00
tastybento 7843d2b23a Fixes blueprint saving with same name.
Blueprints saved with the same name were not overwriting the internal
blueprint list causing duplicates.
2019-05-27 09:16:22 -07:00
tastybento 94e90257fa Adds renaming and icon setting to the Blueprint Management panel
https://github.com/BentoBoxWorld/BentoBox/issues/701
2019-05-26 22:03:09 -07:00
tastybento 2a1ce5eafa Added Blueprint Bundle renaming 2019-05-26 19:40:13 -07:00
tastybento 8ac0f08285 Fix - saved blueprints were using a null name until reload. 2019-05-26 16:33:29 -07:00
tastybento 0fd25f02cd Fixes pasting of blueprints with crops, etc.
https://github.com/BentoBoxWorld/BentoBox/issues/702

Also fixes pasting of entities in the ground when they are on blocks
like crops that are slightly less than an integer block high.
2019-05-26 16:07:50 -07:00
tastybento 9e36865a9f Fixed some code smells (#698)
* WIP code clean up and code smell removal

* Tried to fix a few more code smells
2019-05-26 22:14:24 +02:00
tastybento 4c16b0d779 Implement Blueprint Bundles GUI (#691)
* WIP Blueprint GUI

* Basic implementation. Still WIP.

Needs to enable description adding.

* Added description entry for blueprint bundle.

* Readded maven-javadoc-plugin
2019-05-20 08:18:24 +02:00
tastybento 7ea0edea91 Shifted panel to IslandCreationPanel 2019-05-18 12:22:19 -07:00
Florian CUNY 7c07982669 Avoid using printStackTrace in BlueprintsManager 2019-05-18 15:01:36 +02:00
tastybento 1cd794fd09 Missing import. 2019-05-17 21:13:27 -07:00
barpec12 50592de136 Allow to load blueprints with lowercase names (#686)
Restore the possibility to load blueprints with lowercase names
2019-05-18 00:37:43 +02: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
Florian CUNY 6bf66ec98c Started implementation of Blueprints (replacement of Schems) 2019-04-14 14:55:24 +02:00