This solves the issue in customizable GUI's where variables are defined directly into the panel button name and description instead of providing the link to the locale.
Not all users want to specify all text into a locale, and they would not get parsed variables just because of that.
This change fixes it and it does not give any bad situations even if the reference is just missing text in the locale, as there will be nothing for parsing.
* Remove 1.18.2 from supported version list.
1.18.2 support was removed with changes in commit 056cff4b6f
Also, mark 1.19, 1.19.1 and 1.19.2 as incompatible. It happens because of GSon library changes that prevents bentobox compiled with Spigot 1.19.3 to run on older versions.
* Fixes GSON crashes introduced by migrating to 1.19.3 api.
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.
* Code clean up from Sonar Cloud analysis
* Fix tests
* Remove code smell
* Rename "island" which hides the field declared at line 25.
* Removed code smells.
* Rename variable record to rec
Renamed "record" variable to not match a restricted identifier.
Restricted Identifiers should not be used as identifiers. "record" is
using in Java 16.
* Added private constructor to prevent instantiation of static class
Changed variable name to rec instead of restricted "record".
* Remove Blueprint code smells.
* Use a record for database settings constructor
Code smell: Methods should not have too many parameters. I'm not sure
what methods are using this class though.
* Update MyWorlds version
The POM for MyWorlds is invalid and causes a warning, but this still
persists with this version.
* Extracted nested try block into a separate method.
Makes it clear when reading the code what might be caught
* Extracted nested try block into a separate method.
* Fixed JavaDoc /** instead of just /*
* Extracted nested try block into a separate method.
* Refactored to not assign loop counter from within the loop body.
* Better delete option. With results.
That said, this is legacy code to handle an issue that occurred a long
time ago and this whole set of code can probably be removed.
* Catch Exceptions not Throwable
* Log error with BentoBox logError
* Use computeIfAbsent
Using these instead leads to cleaner and more readable code.
* User can no longer be null
* Added the missing @Deprecated annotation and @since ref
* Added @since reference
* Merge if statements
* Use BentoBox error logging.
* Added JavaDoc @since
* Remove deprecated class and move used class
* Remove deprecated WoodType and use Type.
* Remove unused import
* Extracted nested try block into a separate method.
* Comment empty default statement
* Clean up logic; avoid switch
* Use Java instead of Guava
* private constructor to hide the implicit public one.
* Private constructor to hide the implicit public one.
Merged if statement.
* Add comment
* if merge
* Make variable constant
* Remove unused imports
* Remove deprecated and unused method
* Remove unused import
* Typo
* Remove instanceof and cast
* Remove superfluous null check
* Put constant at bottom of file because @BONNe likes it there.
* Simplify particle validation code
* Fixes#2046. Handles null players for placeholders.
* Remove unused import
* Fixes#2049 for adjacent island spaces
This also deletes blocks in the event rather than setting them to AIR as
was done previously.
Addresses #2058
We already have a option to protect against hostile mobs when logging in
or teleporting, but not respawn. This adds protection to that. Admin can
turn off the option if they want it more hard core.
In theory, this should not be required, but it seems that a player's
world might be null in some edge cases. Alternatively, the Util.getWorld
function can return a null if the player was in a nether or end but that
does not have a corresponding overworld.
Addresses #2057
Superflat was not working properly. It was always clearing just 1 (first) chunk because it referenced the chunk from the first event that created the clearing task.
The issue should be fixed.
In 1.19 worlds it was fixed that super-flat worlds are generated at min-height, instead at 0.
This change keeps the previous super-flat chunk generation until 1.18 is dropped.
The end portals and gateways teleports players to a different dimension upon player touches it. So teleportation should consider these positions as unsafe, otherwise player will be teleported to the different dimension instantly.
Fixes#2040
This change switches from plain JDBC driver implementation to a HikariCP Pool implementation.
Pool Implementation is complete for PostgreSQL and SQLite, while MariaDB and MySQL implementation still uses JDBC drivers, however with HikariCP pools.
Also, I added extra properties for SQL databases, where users could specify their own datasource properties.
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
When players will exit the end-gate, they will be teleported to proper island, instead of world spawn point.
The only way how players can be teleported to the spawn is if they do not have islands.
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.
* 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
* Adds ProtectionBoundingBox for environment
Since minecraft introduced different island heights for different dimensions, protection bounding box were returned wrong area for nether and end dimensions.
This change adds a new method that allows to get proper protection bounding box for requested dimension.
Due to the fact, that nether and end islands can be disabled, then this method may return null.
Fixes#2014
* Adds BoundingBox for environment
Since minecraft introduced different island heights for different dimensions, bounding box were returned wrong area for nether and end dimensions.
This change adds a new method that allows to get proper bounding box for requested dimension.
Due to the fact, that nether and end islands can be disabled, then this method may return null.
Part of #2014
* Fixes Island#onIsland check for non-island worlds
Island#onIsland method was missing checks if island mode is enabled for requested dimension. It returned false positive situations in cases when island generation were disabled in nether or the end worlds.
* Fixes Island#inIslandSpace check for non-island worlds
Island#inIslandSpace method was missing checks if island mode is enabled for requested dimension. It returned false positive situations in cases when island generation were disabled in nether or the end worlds.
* Adds some helper methods in Island object.
- Island#getNetherWorld - returns the nether world or null
- Island#getEndWorld - returns the end world or null
- Island#getWorld(Environment) - returns world of requested environment or null
- Island#isNetherIslandEnabled - returns if nether is generated and nether islands are enabled.
- Island#isEndIslandEnabled - returns if end is generated and end islands are enabled.
The commit was wrong. Protection range should not be decreased, as that would mean that max X and Z blocks are not included in island protection bounding box.
This change is the same as 3c65194dfb but was missed when it was fixed.
Relate to #473
* Check if unique name contains chars not supported in regex expression
Cannot start, contain, or end with special char, cannot contain any numbers.
Can only contain - for word separation
* Negation fix
* 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
* Move to new EngineHub maven repository
* Remove unused WorldEdit dependency
* Use Java 17 in GitHub Actions
* Also change maven-compiler-plugin and maven-javadoc-plugin versions to 17
* Implements new VISITOR_TRIGGER_RAID flag.
This world settings flag allows toggling if visitors can or cannot start a raid on an island they are visiting.
Relates to #1976
* Fixes abuse of Raid Mechanism and Mob Natural Spawn Rules.
Fixes to #1976
* Simplify raid abuse detection.
Spigot in 1.18 introduce new way how block particles should be displayed. However, BentoBox never fully implemented it.
To avoid such issues in-future, I added checks for each particle type that requires extra data object.
Fixes#1989
* Update to Spigot and Paper API 1.19 and Java 17
* Set minimal version to 1.18.
* Add breeding protection for Axolotl and Goats (1.18)
Add breeding protection for Frog and Allay (1.19)
* Clean up switch statement in BlockInteractionListener
* Add chest boat support to BreakBlocksListener.
Part of #1987
* Add powdered snow pickup with bucket protection.
* Add glow ink sac protection on signs.
Switch to SheepDyeWoolEvent as it now contains player variable.
* Clean up Hurting Listener
* Mark 1.16.5, 1.17 and 1.17.1 as incompatible.
Mark 1.18, 1.18.1 and 1.18.2 as supported.
Add 1.19 as compatible.
Part of 1987
* Add ChestBoat inventory protection.
Part of #1987
* Clean up LockAndBanListener
* Add MANGROVE_PRESSURE_PLATE protection.
Part of #1987
* Add Glow Item Frame protection to player interact event.
* Clean up MobSpawnListener
* Clean up ChestDamageListener
* Change from custom method to Tag.PRESSURE_PLATES to detect pressure plates.
Part of #1987
* Implement proper chest boat protection.
Part of #1987
* Move to 1.19 R1 world regenerator.
Part of #1987
* Add allay to the animal entity list.
Part of #1987
* Add axolotl and other fish scooping protection.
Part of #1987
* Fixes Bucket and Glass Bottle filling.
Buckets and bottles were not working since cauldron splitting by type. This change fixes that.
It also protects from filling bottles with water from water sources or waterlogged blocks.
* Remove 1.17.1 compatibility check for biome adapter.
Add cheezee 1.19.1 compatibility version.
* Fixes chest boat interactions.
Part of #1987
* Implement Allay protection.
New flag ALLAY is required to interact with allays.
Part of #1987
* Prevent visitors for being targeted by entities if ENTITY_ATTACK is enabled.
* Implement Sculk Sensor and Shrieker activation protection setting.
Part of #1987
* Add music discs to the LangUtilsHook
Part of #1987
* Fixes failing unit-tests.