Commit Graph

3490 Commits

Author SHA1 Message Date
tastybento d25d1713f8 Adds protection for sign editing for 1.20
Fixes #2135
2023-06-10 15:49:10 -07:00
tastybento 6932ce3759 Added support for 1.20 2023-06-10 10:03:17 -07:00
tastybento e4a3891590 Add new IslandNameEvent and test class for command 2023-06-06 20:38:59 -07:00
tastybento a7b1028496
Merge pull request #2128 from DustyGanteng/DustyGanteng-patch-1
Update en-US.yml
2023-05-28 11:37:01 -07:00
tastybento 9ffc838f2d
Merge pull request #2125 from zrdzn/patch-1
Fix typo in config
2023-05-28 11:35:40 -07:00
Dusty d0d01dbc2b
Update en-US.yml
Fixed weird remove reset count  message
2023-05-21 23:42:47 +07:00
tastybento 8f954090e7 Fixes VisitorKeepInventory to disregard coops and trusted
#2126
Also fixes some tests.
2023-05-13 09:20:47 -07:00
zrdzn 84adfaa622
Fix typo in config 2023-05-04 13:48:53 +02:00
steve4744 e991f09921
replace hardcoded file separator (#2121) 2023-04-21 13:05:00 +03:00
tastybento 577e476796 Remove console spamming debug. 2023-04-18 16:18:09 -07:00
tastybento 84e6523b9d Only disable Addons, not Pladdons
Plugin disabling is done by the server.

Fixes #2117
2023-04-08 16:20:35 +01:00
tastybento 5c5077a6b5 Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2023-04-08 15:49:36 +01:00
tastybento 9ee5bcbcf2 2023 2023-04-08 15:49:27 +01:00
BONNe c235abbfa6
Disable chunk generation on rengeneration (#2114)
The SimpleWorldRegenerator generated world new chunks that were not generated before. 
It is not necessary, as regeneration should happen only on used chunks.
2023-04-07 14:39:27 -07:00
tastybento b4737f104c Implements HARVEST and CROP_PLANTING protection flags
Requested by #2113
2023-04-07 20:51:59 +01:00
tastybento 073f3a49d5
Adds API to enable translations to be set and specific API for flags (#2109)
This was a request on Discord so that plugins can set flags and set the
name and lore for them too.
2023-03-26 10:06:38 -07:00
tastybento 1a293a6936
Implements NMS for pasting and supports older versions of server (#2110)
* Implements NMS for pasting and supports older versions of server

* Remove trial code that shouldn't have been committed.

* Remove trial code that shouldn't have been committed.

* Remove 1.19.3 support.

* Use 1.19.4 in POM
2023-03-26 10:05:54 -07:00
tastybento 85a7375004 Remove warnings on loading addons (not Pladdons) 2023-03-25 15:50:39 -07:00
tastybento 25e601b26c Now with proper commit... 2023-03-25 09:08:34 -07:00
tastybento 907268c2f4 Use Bukkit loadPlugin for loading Pladdons
Provides compatibility with Paper. Ensured bytecode rewriting is done
when code is loaded.
2023-03-25 09:08:18 -07:00
tastybento 6894695024 Clean up test classes; use latest API 2023-03-23 11:02:08 -07:00
tastybento 233e5ceb65 Add SHULKER_TELEPORT flag English text. 2023-03-19 18:49:16 -04:00
tastybento 5d67dbe5e3 Javadoc clarification 2023-03-18 17:46:56 -04:00
tastybento 2cb561b943
Update to 1.19.3 for NMS (#2107)
* Update to 1.19.3 for NMS

Clean up some imports and deprecation notifications.

* Added 1.19.4 to compatible servers
2023-03-18 10:28:19 -07:00
tastybento ca604f893c
Relates to #2104. Adds user.displayName() as a placeholder option (#2108)
* Relates to #2104. Adds user.displayName() as a placeholder option

* Fix test
2023-03-18 10:27:50 -07:00
tastybento 3285ef1ad2 Fix and enhancement for #2105 2023-03-17 20:45:15 -07:00
tastybento 70f044265a Fix test - 54 flags 2023-03-13 20:42:26 -07:00
tastybento 2940d2e492 Add cheat flag to prevent Endermen from teleporting
Fixes #2105
2023-03-13 20:17:03 -07:00
tastybento c31458f8e6 Remove offending blueprint original particle shower which doesn't work
Never did anything useful anyway. Fixes #2100
2023-03-04 23:36:32 -08:00
tastybento 2c283ae3a9
Javadoc and other cleanup from code analysis (#2099) 2023-02-26 17:48:37 -08:00
tastybento 6925a788f3 Put back the deprecated way to delete and adds a GameModeAddon API
to declare which type to use. AcidIsland will need updating to use this
API.
2023-02-24 17:33:53 -08:00
tastybento 1b81e74f4c Evaluates banned commands with spaces
Addresses #2092
2023-02-20 09:59:26 -08:00
tastybento 999ca242d7 Use Eclipse NonNull annotation instead of JetBrains NotNull 2023-02-19 08:41:21 -08:00
tastybento 7d0eb3586d Make events public so they can be instantiated in 3rd party JUnit tests
I need to create "fake" events to test addons but unless they are public
I cannot. All Bukkit events are public, so this should be fine.
2023-02-15 16:01:52 -08:00
tastybento 45f2dca414 Fixes max team size checks.
Fixes #2034
2023-02-12 12:08:38 -08:00
tastybento 8276406f9f Fix runCommands method
Note to future self, don't remove Util methods because someone might be
using them!
2023-02-12 08:22:22 -08:00
tastybento 5eaf54e905 Added AdminBlueprintLoadCommand test class 2023-02-11 15:47:52 -08:00
tastybento 04545e676f AdminBlueprintDeleteCommand test class. 2023-02-11 14:57:42 -08:00
tastybento 08a1ad8126 Added AdminBlueprintCopyCommand test class 2023-02-11 14:46:34 -08:00
tastybento 79d56a5cef Added test class for AdminBlueprintSaveCommand 2023-02-11 12:03:16 -08:00
tastybento f93c49184f Added AddonDescription test class 2023-02-11 10:11:51 -08:00
tastybento 0f0b5aacc2 Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2023-02-11 09:09:36 -08:00
tastybento e978b29d85 Bug fix: Use same seed for seed world as main world. 2023-02-11 09:09:25 -08:00
tastybento 6c1bcdec05 Added test class for IslandChunkDeletionManager 2023-02-08 20:23:19 -08:00
tastybento a793a33758 Minimal test class for BlueprintPaster 2023-02-08 19:53:16 -08:00
tastybento 1783bb7058 Fixes bug where pasting was happening twice 2023-02-08 19:21:50 -08:00
tastybento a703499817 Added test class. 2023-02-08 19:16:32 -08:00
tastybento 224be307a0 Fix JavaDoc errors 2023-02-08 18:40:03 -08:00
JamesMCL44 3623537d84
Update zh-HK.yml (#2085)
Update to latest locale for latest plugin version
2023-02-06 12:56:02 -08:00
tastybento f1eaa0fcde Refactor to reduce complexity 2023-02-05 16:23:23 -08:00
tastybento 9ccdcceaba Refactor to reduce complexity 2023-02-05 16:19:05 -08:00
tastybento 35ece03e5b Refactor to reduce complexity. 2023-02-05 16:08:23 -08:00
tastybento 760bc2e086 Define a constant instead of duplicating literals 2023-02-05 16:03:43 -08:00
tastybento caf994738e Defined a constant instead of duplicating "CHEST" 7 times 2023-02-05 16:00:06 -08:00
tastybento f00320095d Added since and forRemoval to Deprecated annotations. 2023-02-05 15:55:51 -08:00
tastybento 46d20f34ff Remove statements that are always true 2023-02-05 15:50:04 -08:00
tastybento df910e96d3 Refactor to reduce complexity. 2023-02-05 15:46:32 -08:00
tastybento f29e78557a Change location of seed world data.
Fixes #2087
2023-02-05 14:11:59 -08:00
tastybento 2d8b3074a9 Minor refactor to remove continue from for loop 2023-02-05 10:39:10 -08:00
tastybento ad2541963e Minor instanceof casting change 2023-02-05 10:38:09 -08:00
tastybento 2c1a018071 Clarify nonnull on Location 2023-02-05 10:37:43 -08:00
tastybento c6fc42846a Remove unused imports 2023-02-05 10:15:34 -08:00
tastybento 0e253f3ba5 Clarify that parameter is non-null 2023-02-05 10:10:25 -08:00
tastybento a68436fde1 Remove Optional from parameter. 2023-02-05 10:05:57 -08:00
tastybento 1d28979d5c Refactor to reduce complexity 2023-02-04 19:08:09 -08:00
tastybento 187132bc1d Refactor to reduce complixty. Added comments. 2023-02-04 19:00:18 -08:00
tastybento 3331ffac4e Refactor to reduce complexity. 2023-02-04 18:49:13 -08:00
tastybento f9e57898ab Refactor to reduce complexity. 2023-02-04 18:45:05 -08:00
tastybento 0c29d0b5dd
Uses seed worlds for deletion purposes (#2084)
* Uses seed worlds for deletion purposes

* Use Flat type

* Implement the superflat saver

* Fix nullable issue

* Fix tests.

* Fix code smells
2023-02-04 18:37:06 -08:00
tastybento 7040047fcb Fix broken test for IslandRespawnListener 2023-02-04 10:37:02 -08:00
BONNe ea6ca3d26b
Add variable parsing on reference text (#2073)
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.
2023-01-31 18:03:37 +02:00
tastybento a604d5cf82
Add [owner] in command placeholders #2080 (#2081) 2023-01-31 07:13:01 -08:00
tastybento bbb8207cf0 Teleportation was processed for entities even if it was switched off
Addresses #2078

Added test class to cover some of the logic in the teleportation class.
More tests can be written to cover the various outcomes.
2023-01-28 16:04:52 -08:00
BONNe e89970b49b
Remove 1.18.2 from supported version list. (#2074)
* 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.
2023-01-06 18:29:37 +02:00
tastybento 0de2c3a7b6 Update JavaDoc to indicate return value is immutable 2023-01-05 21:30:19 -08:00
tastybento 0f89de6c2a Make list mutable. 2023-01-05 21:16:50 -08:00
tastybento 8e40bf9dcf Added more validation for addon.yml and test class 2023-01-02 09:31:16 -08:00
tastybento 10a73e66b4 Added explicit @since annotation 2023-01-01 09:25:09 -08:00
tastybento 3746349e22 The protected modifier for constructor should be enough.
Constructors of abstract classes can only be called in constructors of
their subclasses. So there is no point in making them public.
2023-01-01 09:22:41 -08:00
tastybento 1262a08a22 Removed deprecated method isPlayer(User) 2023-01-01 08:43:31 -08:00
tastybento f545a4576e Remove unused comment 2023-01-01 00:19:10 -08:00
tastybento ab434b63fa Completed tests for User class 2023-01-01 00:17:30 -08:00
tastybento 6b88d31762 Bug fix for particle validation 2023-01-01 00:02:59 -08:00
tastybento 93ca9fb0e6 Correct nullable tags 2022-12-31 18:33:49 -08:00
tastybento 0bffe3806a Fix tests 2022-12-31 18:19:32 -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 056cff4b6f
Code clean up from Sonar Cloud analysis (#2068)
* 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
2022-12-31 16:41:17 -08:00
tastybento 0183380b82 Edited US English text entries
Supercedes #1033
2022-12-30 11:22:01 -08:00
tastybento 36ae34da5d
2049 trees growing outside range (#2050)
* 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.
2022-12-30 09:37:18 -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
tastybento bde294e0e6 Updated some dependency versions
https://github.com/BentoBoxWorld/BentoBox/issues/2064
2022-12-28 12:37:33 -08:00
tastybento e7f1269443
Support for 1.19.3 (#2060) 2022-12-11 17:51:52 -08:00
tastybento e2b5545f3f Expand remove mobs world setting to include respawning protection
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.
2022-12-04 21:06:14 -08:00
tastybento 69fa951907 Handles null player world better on joining server
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
2022-12-04 20:36:41 -08:00
tastybento 7aa1e2da89 Fix to handle kelp and bamboo spread.
Addresses #2053. This is actually due to a server bug
https://hub.spigotmc.org/jira/browse/SPIGOT-5312. This change uses the
BlockSpreadEvent to trap kelp and bamboo and bamboo sapling.
2022-11-26 17:36:19 -08:00
tastybento 2629e940c7
2046 null player placeholder support (#2048)
* Fixes #2046. Handles null players for placeholders.

* Remove unused import
2022-11-13 08:49:22 +02:00
tastybento 1c4fb76828
Fixes #2045. Hides invisible team members from the count. (#2047) 2022-11-12 02:28:09 +02:00
BONNe acb984ee90
Fixes super-flat clearing
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.
2022-11-01 23:04:59 +02:00
BONNe d9ad9f158b
Fixes a mistake in clean super flat listener
There was a logical mistake in checking if a clean super flat should work.
2022-11-01 20:10:45 +02:00
BONNe 87a6799cd1
Fixes clean super-flat issue from 1.19 worlds
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.
2022-11-01 18:25:39 +02:00
tastybento d50208c0e1
Add and fix tests for end gateway and portal. (#2044) 2022-10-31 17:59:04 -07:00
BONNe a22ce33175
Mark end portals and gateways as unsafe location. (#2042)
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
2022-10-19 11:41:00 +03: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 b48a5a73b8 Merge remote-tracking branch 'origin/master' into develop-fix
# Conflicts:
#	pom.xml
2022-10-11 09:55:16 +03:00
BONNe 065f4ba4bd Spigot does not support parallel stream processing for placing blocks and entities in the world.
This is a hot-fix release.
2022-10-11 09:37:59 +03:00
BONNe e47890c16e Merge remote-tracking branch 'origin/develop' into develop 2022-10-04 15:54:34 +03:00
BONNe 866dff6244 Fixes missing FLAG check on clicking minecart entities
Players could open minecart entities, even without flag requirement.

Fixes #2031
2022-10-04 15:54:18 +03:00
BONNe 369001d368
Rework SQL database implementation. (#1993)
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.
2022-10-04 12:31:51 +03:00
BONNe 1a59ca7785 Merge remote-tracking branch 'origin/develop' into master
# Conflicts:
#	pom.xml
#	src/main/java/world/bentobox/bentobox/blueprints/BlueprintPaster.java
#	src/main/java/world/bentobox/bentobox/database/objects/Island.java
#	src/main/java/world/bentobox/bentobox/versions/ServerCompatibility.java
2022-10-04 11:56:32 +03:00
BONNe b263c92c13
Use Spigot only events. (#2029)
I missed that EntityMoveEvent is only Paper. Interesting why Spigot does not have such...

Fixes #2028
2022-10-01 01:50:32 +03:00
BONNe 52bca66149 Add better config description for safe-spot-search-range. 2022-09-30 21:46:01 +03:00
BONNe f01e5540c7 Deprecate old player teleportation code. 2022-09-30 21:41:02 +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 682d835961 Add all dimension checks for methods. 2022-09-30 14:34:28 +03:00
BONNe 4458d16274 Fixes incorrect condition for missing island check. 2022-09-30 14:34:12 +03:00
BONNe d197ce8bea Add class description. 2022-09-30 02:34:46 +03:00
BONNe aa7abe02bf Teleport island-less player to the spawn if he exits nether 2022-09-30 02:33:07 +03:00
BONNe 97c4cf883f Implement proper end exit portal handling.
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.
2022-09-30 02:25:44 +03:00
BONNe eb5147e710 Change to direct PlayerTeleportListener#portalProcess method call. 2022-09-30 01:31:05 +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 173808b787
Adds glow berries protection. (#2027)
Uuups... someone forgot to add them.

Fixes #2020
2022-09-29 18:58:53 +03: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
Huynh Tien 12926f9ee7
setBlock & setEntity as CompletableFuture (#2019)
* setBlock & setEntity as CompletableFuture

* use collectingAndThen toArray
2022-09-05 09:28:16 +03:00
BONNe 9088ea4b80 Fix failing unit-test 2022-08-26 12:43:05 +03:00
BONNe 50bc236bbc Fix failing unit-test 2022-08-26 12:27:11 +03:00
BONNe c7b48b3d2a
Update Spigot 1.19.2. (#2017)
Add 1.19.2 compatibility.
2022-08-26 12:17:19 +03:00
BONNe 6f791420e7
Proper dimension processing (#2015)
* 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.
2022-08-26 11:32:03 +03:00
BONNe 6c1399c2b4
Fixes wrong admin permission.
Default Amin command should have `admin` instead of admin.*
2022-08-14 20:12:15 +03:00
BONNe 44201afa1f Fixes an issue with missing parent permission check before command execution.
Implement a new method that recursively checks if player has access permission to all commands in whole hierarchy.

Fixes #2010
2022-08-03 19:00:42 +03:00
BONNe 64b4c43742 Revert 6e734fc343
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
2022-07-25 00:16:16 +03:00
BONNe a59697c14e Fixes particle spawning for older API usage.
Border addon used still older BentoBox API. This change fixes it, and fixes API compatibility with older addons/plugins.
2022-07-14 11:29:46 +03:00
BONNe 5a527d4119 Add parent for admin team's commands.
This is a parity change with player command.
2022-07-13 12:35:20 +03:00
BONNe aed8caeb76 Tweak translation for skulk sensor and shrieker. 2022-07-10 01:44:15 +03:00
BONNe 927fcba15a Disables biome copying by default in blueprints.
Biome will be copied only if it is required by copy command parameter.

Fixes #1862
2022-07-07 00:08:15 +03:00
BONNe 9ec8730359 Prevents liquids from being placed from dispenser outside island area.
Fixes #1869
2022-07-06 23:55:17 +03:00
BONNe 9643f617b6 Implement a command that allows to reset island name.
Fixes #1879
2022-07-06 23:30:51 +03:00
BONNe 3784aa48d7 Disables podzol and coarse dirt from becoming path.
This protection reuses Flags.COARSE_DIRT_TILLING.

Fixes #1878
2022-07-06 23:00:20 +03:00
BONNe 2f244c0606 Fixes an issue when portals did not operate under 0.
Fixes #1977
2022-07-06 22:12:47 +03:00
BONNe f969f2721f Disable DynmapHook as it is not implemented.
Fixes #1995
2022-07-06 20:39:15 +03:00
Galić Mijo cbd063c9e8
Check if unique name contains chars not supported in regex expression (#1998)
* 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
2022-07-06 20:21:36 +03:00
BONNe db323390cf
Implements adding unknown default island flag values in settings. (#2001)
* 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
2022-07-06 20:20:08 +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
Sliman4 3cd5b05130
Fix Actions (#1992)
* 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
2022-06-16 14:57:42 +03:00
BONNe 1991dc7236
Fixes failing test
Increase flag listener counter.
2022-06-14 09:09:06 +03:00
BONNe c54358441d
Raid abuse fix (#1991)
* 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.
2022-06-14 02:42:48 +03:00
BONNe e41f5ac24f
Fixes a bug that prevented mobs to attack
Commit 85b52f4b introduced a bug that prevented entities to target any island member. This should fix it.
2022-06-14 02:33:35 +03:00
BONNe d984955af3 Fixes Range Display command crashes.
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
2022-06-14 01:18:52 +03:00
BONNe 85b52f4bfb
Implement new 1.19 materials and entities (#1990)
* 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.
2022-06-14 00:38:53 +03:00
BONNe 6f2a9929c0
Fixes Glowing Item frames protection (#1985)
* Fixes glowing item frame protection.
Glowing item frames were not protected.

Fixes #475

* Fixes check-style.
2022-06-05 21:52:37 +03:00
BONNe aad10ad74f
Move database dependencies to the Spigot Libraries. (#1982) 2022-05-29 22:56:50 +03:00
BONNe 345b9e2564
Fixes an incorrect <Material>:CMD-<number> parsing
The issue was that it used an incorrect value for parsing Material. Instead of stripped part[0] it used whole text with CMD in it.
2022-05-23 23:23:22 +03:00
BONNe 3ab7ac8484
Implement ability to create ItemStacks with Custom Model Data. (#1981) 2022-05-23 20:46:02 +03:00
Huynh Tien 0f815d8175
More abstract on Blueprint Paster (#1970)
* more abstract on Paster

* comment and stuff

* How about Impl

* ok, PasteHandler

* PasteUtil

* don't check other BlockState if there is one matched

* world as an argument

* forgot the impl

* createBlockData from BlueprintBlock

* fix remaining conflicts

Co-authored-by: tastybento <tastybento@users.noreply.github.com>
2022-05-03 18:39:27 +01:00
evlad 4ab579f2cd
Feat: Filtering spectators from visitors (#1974)
* support 1.18 negative y

* feat: visitor gamemode spectator check
2022-05-03 08:03:49 +03:00
Huynh Tien 6fba4bfbea
More abstract on World Regenerator (#1969)
* more abstract on delete chunks

* update NMS to 1.18.2

* at most abstract, requires only the island and the world

* it's weird that we can't use whenComplete

* rename to WorldRegenerator
2022-05-02 15:23:31 -07:00
evlad d07c1b5a8c
support 1.18 negative y (#1973)
Fixes an issue where blueprint starting block could not be placed in negative area.
2022-05-01 08:44:42 +03:00
Huynh Tien 3e0368fbab
fix null on invitedPlayer (#1972) 2022-04-28 15:39:39 +03:00
BONNe c4c51d00e2
Fixes wrong protection bounding box (#1971)
#1966 fixed a bounding box size for the whole island, while the protection bounding box was still wrong.

Fixes https://github.com/BentoBoxWorld/BSkyBlock/issues/473
2022-04-26 12:06:50 +03:00
tastybento 928f1eb1eb
Version 1.20.1 (#1966)
* Version 1.20.1

* Added name of the addon causing the issue.

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

* Use world min-height for island bounding box.

* Fixes a bug when fallback could not use reusable

There was an issue in PanelItemTemplate that prevented fallback buttons to be "reusable" things.
The issue was that reusable items were not passed to the panel item reader.

* Adjusted test to try to avoid errors

* Fix for random test failures.

* Added 1.18.2 support

* Address unnecessary PVP reports on each teleport (#1948)

If a player is teleporting on the same island in the same dimension, it keeps spamming that PVP is enabled in dimension. 
It should be enough with sending messages when the player teleports to the island.

Fixes #1885

* Fixes bug with Safe Spot Teleport (#1951)

There was a bug that prevented finding a safe spot if all valid blocks were in height with the `startY` location.

Reported via discord.

* Fix Exception error reported by IDE

I am not sure why Eclipse is saying this is an error.

* Fix for kicking offline players

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

* Add an option in SafeSpotTeleport to cancel if fail (#1952)

There was no option to cancel teleportation if SafeSpotTeleport could not find a valid spot. This option could be used to avoid creating "backup" blocks in situations when teleportation is avoidable, f.e. visiting an island.

* Replace peplaceAll with replace

It does the same thing if the first argument is not a regex.

* Use constants for common strings

* Use constants for common strings

* Go back to replaceAll

This is required.

* Clearer paster (#1953)

* WIP - make easier to understand.

* Small refactor of paster to make it easier to understand

* Fix tabs to spaces. Sorry - new editor!

* Fix tabs to spaces

* Fix tab to spaces

* Improve team kick command (#1957)

The kick command has an unnecessary owner check. As command should be configurable by island owners, then limiting it to an owner is wrong.
Add a code that allows kicking only lower-ranked players.

Add message that shows who kicked from the island.
Add message that shows that rank does not allow to kick.

* Solve crashes with Addon#allLoaded call (#1959)

If some addon has code in Addon#allLoaded that crashes the call, then it did not disable addon as well as did not call allLoaded for every other addon that was left in the list.

This should be solved by adding an extra try-catch.

* using java 16 syntax (#1958)

* Fixes kick command (#1960)

PR #1957 broke kick command and noone could kick players from teams.
This should fix it.

* Fixes a bug with blueprint height (#1961)

Blueprint clipboard was preventing setting Y below 0 or above 255. 

The code was not adjusted to 1.18 changes.
Reported via discord.

* Fixes Lava Duplication Glitch (#1964)

Due to the fact, that Obsidian Scooping uses one tick delay to remove obsidian, a player with a bucket in hand and offhand duplicated lava. 
To avoid that, added an extra check that ignores the interact event if a player holds a bucket in both hands, and interacted hand is offhand.

Fixes #1963

* Fixes failures in obsidian cooping listener. (#1965)

Failures happened after implementing #1964

Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: Invvk <70810073+Invvk@users.noreply.github.com>
2022-04-17 09:04:37 -07:00
BONNe b3e55a7b55
Fixes failures in obsidian cooping listener. (#1965)
Failures happened after implementing #1964
2022-04-11 08:23:13 +03:00
BONNe 9f163f0572
Fixes Lava Duplication Glitch (#1964)
Due to the fact, that Obsidian Scooping uses one tick delay to remove obsidian, a player with a bucket in hand and offhand duplicated lava. 
To avoid that, added an extra check that ignores the interact event if a player holds a bucket in both hands, and interacted hand is offhand.

Fixes #1963
2022-04-11 08:13:12 +03:00
BONNe 4341c28aca
Fixes a bug with blueprint height (#1961)
Blueprint clipboard was preventing setting Y below 0 or above 255. 

The code was not adjusted to 1.18 changes.
Reported via discord.
2022-04-03 21:36:51 +03:00
BONNe ad0931ffcb
Fixes kick command (#1960)
PR #1957 broke kick command and noone could kick players from teams.
This should fix it.
2022-04-03 08:12:41 +03:00
Invvk c02e566266
using java 16 syntax (#1958) 2022-04-01 00:12:47 +03:00
BONNe 36751d5573
Solve crashes with Addon#allLoaded call (#1959)
If some addon has code in Addon#allLoaded that crashes the call, then it did not disable addon as well as did not call allLoaded for every other addon that was left in the list.

This should be solved by adding an extra try-catch.
2022-04-01 00:12:27 +03:00
BONNe 9f21314818
Improve team kick command (#1957)
The kick command has an unnecessary owner check. As command should be configurable by island owners, then limiting it to an owner is wrong.
Add a code that allows kicking only lower-ranked players.

Add message that shows who kicked from the island.
Add message that shows that rank does not allow to kick.
2022-03-25 23:29:14 +02:00
tastybento 6796fceee8
Clearer paster (#1953)
* WIP - make easier to understand.

* Small refactor of paster to make it easier to understand

* Fix tabs to spaces. Sorry - new editor!

* Fix tabs to spaces

* Fix tab to spaces
2022-03-19 16:19:31 +00:00
tastybento 51dbca0f99 Go back to replaceAll
This is required.
2022-03-19 15:12:04 +00:00
tastybento b0f1417166 Use constants for common strings 2022-03-19 14:45:44 +00:00
tastybento 0b3ef8df6d Use constants for common strings 2022-03-19 14:43:52 +00:00
tastybento bda56763a8 Replace peplaceAll with replace
It does the same thing if the first argument is not a regex.
2022-03-19 14:29:54 +00:00
BONNe 3ba6620e73
Add an option in SafeSpotTeleport to cancel if fail (#1952)
There was no option to cancel teleportation if SafeSpotTeleport could not find a valid spot. This option could be used to avoid creating "backup" blocks in situations when teleportation is avoidable, f.e. visiting an island.
2022-03-19 14:22:03 +00:00
tastybento 4e8ca6d22c Fix for kicking offline players
https://github.com/BentoBoxWorld/BentoBox/issues/1950
2022-03-18 13:59:41 +00:00
tastybento fd44e03b7b Fix Exception error reported by IDE
I am not sure why Eclipse is saying this is an error.
2022-03-18 13:59:29 +00:00
BONNe 6d59e79e78
Fixes bug with Safe Spot Teleport (#1951)
There was a bug that prevented finding a safe spot if all valid blocks were in height with the `startY` location.

Reported via discord.
2022-03-18 15:06:31 +02:00
BONNe 0cf1d43a29
Address unnecessary PVP reports on each teleport (#1948)
If a player is teleporting on the same island in the same dimension, it keeps spamming that PVP is enabled in dimension. 
It should be enough with sending messages when the player teleports to the island.

Fixes #1885
2022-03-16 09:51:22 +02:00
tastybento e7599ec805 Added 1.18.2 support 2022-03-12 19:20:53 -08:00
tastybento 546cf2c9b9 Fix for random test failures. 2022-03-12 19:12:13 -08:00
tastybento 945bfa66ee Adjusted test to try to avoid errors 2022-03-12 12:20:27 -08:00
BONNe 50b677f4c5
Fixes a bug when fallback could not use reusable
There was an issue in PanelItemTemplate that prevented fallback buttons to be "reusable" things.
The issue was that reusable items were not passed to the panel item reader.
2022-03-12 12:15:10 +02:00
tastybento 6a009946f5 Use world min-height for island bounding box. 2022-02-26 10:22:41 -08:00
tastybento 6c7d77f093 Added name of the addon causing the issue.
https://github.com/BentoBoxWorld/BentoBox/issues/1944
2022-02-24 08:02:20 -08:00
tastybento 4e3079b623
Merge branch 'master' into develop 2022-02-19 09:57:05 -08:00
BONNe d492539c51
Implement ACTION defining by ACTION TYPE (#1938)
This change implements a new way how to define actions via a custom panel template.

Previously there were 2 options how to define an action:
- by click-type
- as an array list

This adds the third type: by action type. It means that now developers could code that action is the main key for defining what happens when button is clicked:
```
    actions:
       visit:
          click-type: LEFT
          tooltip: Tooltip text for left click action
```
2022-02-11 18:07:14 -08:00
BONNe fa68f8f01c
Add missing templated panel builder method (#1935)
#1932 implemented a feature that allows reading multiple panels from a single file, however, there was a missing builder in TemplatedPanelBuilder class that would allow to use it.

This fixes it and adds the missing builder method.
2022-02-11 18:06:56 -08:00
tastybento cef31306ac Fix JoinLeaveListenerTest 2022-01-28 21:54:30 -08:00
tastybento ee94a49e85 Fix IslandInfoCommandTest 2022-01-28 21:40:45 -08:00
tastybento 78a3c49361 Fix AdminInfoCommandTest 2022-01-28 21:39:06 -08:00
tastybento 937e8bf614 Fix island test and max ever range bug 2022-01-28 21:33:39 -08:00
BONNe 09ab327551
Implement a flag that rules all flags. (#1927)
Add new Protection Flag: CHANGE_SETTINGS. This flag allows set which rank can change island settings. By default, it is set to OWNER rank and minimal value is MEMBER rank.

Fixes #1493
2022-01-28 18:45:50 -08:00
BONNe 90ebe103c4
Templated Panel Title Parameters (#1934)
* Implement parameter adding to the templated panel title.

There was an issue when templated panels were always static, and api did not have a way how to change it. This will allow passing parameters to the tile, and allow adding dynamic texts.

* Implement parameter adding to the templated panel title.

There was an issue when templated panels were always static, and api did not have a way how to change it. This will allow passing parameters to the tile, and allow adding dynamic texts.
2022-01-28 18:43:14 -08:00
Huynh Tien 178529adb1
Fix null in reject invite (#1933)
* remove debug

* fix null in reject invite
2022-01-28 18:42:56 -08:00
BONNe 52cc2a8593
Implement multiple panels in single file (#1932)
The existing template file reader could read a single configuration section from a file, and the section was required to start with the same name as the file.
This changes it and allows to read any configuration section from the panel.

This change is backward compatible and does not influence existing panels.
2022-01-28 18:42:23 -08:00
BONNe 3ecdda65b5
Fixed bug with running onLeave commands (#1929)
In discord, it was reported that running the admin delete command produces a null-pointer if `[player]` placeholder is used.

With fast checking I found out the issue: incorrect user was passed to the command.
Also, I moved runCommands below all resets, so commands could be used to give items, or xp or other stuff that is removed.
2022-01-28 18:42:02 -08:00
BONNe da98bbcf38
Extend ranked commands (#1928)
* Add CompositeCommand#defaultCommandRank variable.

This variable stores default rank for a command. This adds more flexibility to the Island#commandRanks object. This change allows specifying default rank for each command.

* Add more commands for users to configure on their islands.

Owners now can specify who can use:
- sethome command
- renamehome command
- deletehome command
- setname command
- resetname command
2022-01-28 18:41:20 -08:00
tastybento 7b94aa0ea2
Adds bonus range elements to Island object. (#1921)
* Adds bonus range elements to Island object.

Admin commands still need to be adjusted or added to support management
of the bonus ranges.

* Changed to mutable class

Fixed bugs.
2022-01-28 18:35:55 -08:00
BONNe 54869a400a
Implement duplicated actions click type (#1919)
Some addons may want to introduce two different actions with the same click type.
This change will allow to do it, as now actions may be defined as lists instead of configuration sections.

To use it, action must be defined a bit differently:
```
      actions:
        - click-type: <value of enum ClickType>  # required
          type: <value of String> # not required
          content: <value of String>  # not required
          tooltip: <value of String>  # not required
        - click-type: <value of enum ClickType>  # required
          type: <value of String> # not required
          content: <value of String>  # not required
          tooltip: <value of String>  # not required
```

Co-authored-by: tastybento <tastybento@users.noreply.github.com>
2022-01-28 18:35:27 -08:00
BONNe 56c9f5c28e
Fixes a bug with on-join commands not working when players join the team. #1925 (#1926) 2022-01-23 15:25:27 -08:00
tastybento 2f0869fd6e More voiding of event listeners
https://github.com/BentoBoxWorld/BentoBox/issues/1918
2022-01-22 18:04:00 -08:00
tastybento d14ad977ab Clean up imports. 2022-01-22 13:14:57 -08:00
tastybento 9062aab34b Change behavior of teleporting to default nether
If create-and-link-portals is true, then teleporting to the nether will
not go to a central portal point and instead create a portal in the
nether at the same coordinates as the portal in the overworld.
Teleporting back will not be affected.

https://github.com/BentoBoxWorld/BSkyBlock/issues/464
2022-01-22 13:14:34 -08:00
tastybento 94b982f644 Fix tests
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1918
2022-01-22 12:16:27 -08:00
tastybento 5573e9f329 Fix TNTListener tests 2022-01-22 11:57:11 -08:00
tastybento 823bc5ceed Fix Fire tests 2022-01-22 11:54:00 -08:00
tastybento f25e54f3c8 Return void for event listeners
https://github.com/BentoBoxWorld/BentoBox/issues/1918
2022-01-21 18:47:31 -08:00
tastybento 5ab89ac63d Fix tests 2022-01-15 16:20:12 -08:00
tastybento 046c4fff35 Fix for double chest protection.
Double chests could be viewed but not accessed even if chest access or
trapped chest access was allowed.

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1912
2022-01-09 20:53:47 -08:00
tastybento bea9f0e394 List must be mutable. Remove debug. 2022-01-09 20:41:20 -08:00
tastybento 721f0271aa Dynamically grab flags
https://github.com/BentoBoxWorld/BentoBox/issues/1915
2022-01-09 19:44:44 -08:00
tastybento b63df41082 Remove |+ block chunking marker
https://github.com/BentoBoxWorld/BentoBox/issues/1914
2022-01-09 14:14:04 -08:00
tastybento d06688ad45 Remove the |+ block code because it adds linefeeds
At least with the latest server it does.

https://github.com/BentoBoxWorld/BentoBox/issues/1914
2022-01-08 15:16:01 -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
BONNe eaf2236f7f
Fixes a bug that increased all button count by 1 (#1911)
This will fix an issue when the next button was not displayed when it was necessary.
2022-01-07 18:48:25 -08:00
gitlocalize-app[bot] ff4a7c9d61
Translate vi.yml via GitLocalize (#1910)
Co-authored-by: HSGamer <huynhqtienvtag@gmail.com>
2022-01-07 18:47:58 -08:00
gitlocalize-app[bot] 318d399a5b
Translate zh-CN.yml via GitLocalize (#1908)
Co-authored-by: DuckSoft <realducksoft@gmail.com>
2022-01-07 18:47:46 -08:00
tastybento 5c94f97e71 Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2022-01-02 12:27:09 -08:00
tastybento bfbeb7964b Fix tests 2022-01-02 12:25:35 -08:00
tastybento 5c8af0c1df Fix tests 2022-01-02 12:21:28 -08:00
tastybento 728c60d472 Fix failing tests. 2022-01-02 12:19:43 -08:00
gitlocalize-app[bot] 2d08e28a01
Translate zh-CN.yml via GitLocalize (#1907)
Co-authored-by: tastybento <tastybento@wasteofplastic.com>
2022-01-01 18:20:24 -08:00
gitlocalize-app[bot] c1f33ad1d4
Dutch translation (#1906)
* Translate nl.yml via GitLocalize

* Translate nl.yml via GitLocalize

* Translate nl.yml via GitLocalize

Co-authored-by: mt-gitlocalize <mt@gitlocalize.com>
Co-authored-by: tastybento <tastybento@wasteofplastic.com>
Co-authored-by: Dark_Ville <darkville13@gmail.com>
2022-01-01 18:16:50 -08:00
gitlocalize-app[bot] a5f093758c
Translate tr.yml via GitLocalize (#1905)
Co-authored-by: tastybento <tastybento@wasteofplastic.com>
2022-01-01 18:13:29 -08:00
tastybento 20a6846523 Remove deprecated methods 2022-01-01 18:05:40 -08:00
tastybento 796114eeef Fix tests 2022-01-01 18:01:50 -08:00
BONNe d1eb175e88
Change AbsolutePath to CanonicalPath (#1901)
I am not 100% sure if this would fix https://github.com/BentoBoxWorld/BSkyBlock/issues/451

However, searching google I found that others had a similar issue with the absolute path and they changed it to canonical. 

As I was not able to reproduce the main reported issue, I do not know if this fixes it.
2022-01-01 17:45:05 -08:00
Huynh Tien 7088a2736f
Flags for Block Explode (#1899)
* add Block Explosion support for TNT_DAMAGE flag

* prevent block explosion from damaging entities

* seperated flags for block explode

* invert and cancel

* pattern instanceof
2022-01-01 17:42:46 -08:00
Huynh Tien dffe8a811e
fix an exception when cleaning an offline player (#1898) 2022-01-01 17:39:25 -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
Huynh Tien c9c9ea0389
Fix Biome compatibility on 1.17 (#1895)
* Fix Biome compatibility on 1.17

* check if it's not 1.17.1
2022-01-01 17:34:51 -08:00
gitlocalize-app[bot] b6a739db00
German Translation (#1904)
* Translate de.yml via GitLocalize

* Translate de.yml via GitLocalize

Co-authored-by: tastybento <tastybento@wasteofplastic.com>
Co-authored-by: Rikamo045 <rik.amos.krajinovic@gmail.com>
2022-01-01 17:33:11 -08:00
tastybento 17ac4f688a Add an admin delete homes command
https://github.com/BentoBoxWorld/BentoBox/issues/1900

This admin command removes all homes from a specified island.
2021-12-31 10:51:16 -08:00
tastybento acba363523 Added why to VisitorKeepInventory and test class
why reports can now be made by subclasses of FlagListener
2021-12-21 10:12:20 -08:00
tastybento 7fbae58bb2 Make check an NPE check and failure 2021-12-20 15:30:29 -08:00
tastybento 3ece0d049a Added test for SafeSpotTeleport and removed old test 2021-12-20 09:50:45 -08:00
tastybento f049fc6941 Added SafeSpotTepeortTest 2021-12-20 09:46:04 -08:00
Huynh Tien e3b99195ca
Optimize safe location searching with configurable range limit (#1892)
* better safe spot finder

* this should be better

* limit how far the y-coordinate will be expanded

* load chunks passively
2021-12-20 09:44:34 -08:00
Huynh Tien 333c9a8272 load chunks passively 2021-12-20 19:37:50 +07:00
BONNe ed50765b98
Addres Biome's changes in Minecraft 1.18. (#1893)
Since Minecraft 1.18 renamed and removed a lot of biomes, some addons that stored them in the database may require migration.

This Adapter will fix that as now BentoBox itself will do migration for all Biome.class objects.
2021-12-19 08:49:29 -08:00
Huynh Tien 168de622ea limit how far the y-coordinate will be expanded 2021-12-19 20:40:01 +07:00
Huynh Tien f91ed4705a this should be better 2021-12-16 17:18:09 +07:00
Huynh Tien 6f01310f92 better safe spot finder 2021-12-16 08:58:41 +07:00
tastybento 2e6ef59040 Update dates in BentoBox console banner 2021-12-13 21:59:30 -08:00
tastybento 60cde5334d
Release 1.19.0 (#1890)
* Update to Minecraft 1.18 (#1887)

* Make BlockEndDragon support custom max world height (#1888)

Use max world height instead of magic 255 value.

* Send PVP toggle messages only to on-island players.

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

* Add 1.18.1

Co-authored-by: BONNe <bonne@bonne.id.lv>
2021-12-12 20:26:48 -08:00
tastybento 6567104f94 Add 1.18.1 2021-12-11 10:50:09 -08:00
tastybento 524cb46e27 Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2021-12-07 19:35:08 -08:00
tastybento 8a6cc39214 Send PVP toggle messages only to on-island players.
https://github.com/BentoBoxWorld/BentoBox/issues/1885
2021-12-07 19:34:58 -08:00
BONNe 3b64973c2b
Make BlockEndDragon support custom max world height (#1888)
Use max world height instead of magic 255 value.
2021-12-06 11:49:22 +01:00
tastybento 59de6a8efb
Update to Minecraft 1.18 (#1887) 2021-12-05 21:03:21 -08:00
tastybento 11a3bf9227
Release 1.18.1 (#1886)
* Version 1.18.1

* Added snapshot repo to Maven info.

* Fixes console teleporting.

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

* Address potential NPE's

* Preveent NPEs and other items.

* Remove dead paper forks (#1884)

Tuinity has since merged with Paper, and is now not a valid fork

Airplane is shutting down / not updating to 1.18.x

* Added toString to resolve issue with arrays

* Fix minor JavaDoc mistake

Co-authored-by: Fredthedoggy <45927799+Fredthedoggy@users.noreply.github.com>
2021-12-05 13:46:54 -08:00
tastybento 79abf965f3 Fix minor JavaDoc mistake 2021-12-05 12:01:27 -08:00
tastybento de951b6c4b Added toString to resolve issue with arrays 2021-12-05 11:58:20 -08:00
Fredthedoggy 2d032523c7
Remove dead paper forks (#1884)
Tuinity has since merged with Paper, and is now not a valid fork

Airplane is shutting down / not updating to 1.18.x
2021-12-05 11:33:42 -08:00
tastybento 7277432c41 Preveent NPEs and other items. 2021-11-12 15:39:52 -08:00
tastybento 7616f6aa2a Address potential NPE's 2021-11-12 13:19:19 -08:00
tastybento 6b6ab711e5 Fixes console teleporting.
https://github.com/BentoBoxWorld/BentoBox/issues/1877
2021-11-11 15:36:49 -08:00
tastybento 22c62c91b4 Merge branch 'master' into develop
Conflicts:
	src/main/java/world/bentobox/bentobox/api/events/team/TeamEvent.java
	src/main/java/world/bentobox/bentobox/api/panels/reader/TemplateReader.java
	src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintClipboardFormat.java
	src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintClipboardReader.java
	src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintClipboardWriter.java
	src/main/java/world/bentobox/bentobox/blueprints/worldedit/BlueprintSchematicConverter.java
	src/main/java/world/bentobox/bentobox/listeners/flags/settings/PVPListener.java
2021-11-11 10:40:17 -08:00
tastybento df2b445002
Release 1.18.0 (#1876)
## Change Log 

* Island range perms could be 2x island distance

This could allow protection ranges to be much greater than the island
range and therefore overflow into adjacent islands.

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

* Ensure maxEverProtectionRange is less than range.

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

* Added test class for Island.

* Added access to private fields for JUnit tests

* Added Sonar Properties to POM

* Changes to analyze using sonar.

* Remove zip reference

* Avoid zipSlip vulnerability.

* Removed the unused WorldEdit hook. (#1853)

If someone wants to add it back later they can, but this code does
nothing right now.

* Requires nonNull parameters for User.instanceOf (#1852)

* Requires nonNull parameters for User.instanceOf

The only reason why User.instanceOf was returning a potential null was
if the parameter was null. Further absolutely no null checking was being
done, so the assumption was that User.instanceOf should never return a
null. This corrects the annotations and requires non-Null parameters.

* Remove null player test

* Fix JavaDoc for GameModeAddon inWorld method

* Fix max-range bug

* Remove illegal tag as it's not needed

* Code smell reduction

* Add missing packages so tests can pass.

* Non null user methods (#1856)

* This makes some User methods non-null.

Instead of returning null, some methods will throw an error if they are
called on non-Players. This means code does not have to do null checks.

* Perform null check in method.

* Null check

* Fix test

* Fix test.

* Npe squashing (#1857)

* Fix hanging [uuid] in info.

* NPE checking

* Make getProtectionCenter nonNull

* More NPE fixes.

* Fix test

* Make getPlayer() and getOfflinePlayer() nonNull returns

This requires addons to not use null checks and instead us the isPlayer
or isOfflinePlayer methods.

* NPE blockers

* Deprecate CompositeCommand isPlayer method.

* Fix test

* Use isPlayer instead of null check.

Refactor code to be easier to understand.

* Fix

* Fix some code smells.

* Prevent NPE possibility.

* Fix "ugly" enchant name. (#1858)

Enchant names did not have a touch of Util#prettifyText code.

* Remove deprecated events.

* Fix IslandSethomeCommand test

* Fix tests - just counts of events.

* Added API to get a translation without color conversion

It may be necessary to read the translation without converting colors to
Bukkit colors.

* Fix tests.

* Fix test.

* Version NPE protections.

* 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

* Fix missing color conversion for translations.

* Fix mis-statement of island protection coordinates in info command.

* Fix tests

* Fix missing edge deletion of island.

The bounding box was erroneously being made smaller when it was not
required because the inBounds check does that already.

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

* Prevent rare NPE

* Ensure oldIsland is never null.

* Refactored setowner command and added test class

* API: Require getWorldSettings to be a game mode world

* Fix tests and refactor code

* Fix test

IWM inWworld needs to return true

* Fix test

IWM inWorld must return true

* Put default getHandlers back in for backwards compatibility

Without them, too many older addons break. They need updating to have
their own handlers. Once that is done, the default ones can be removed
maybe.

* Refactor code for clarity.

* NPE protections

* Prevent NPE

@Poslovich - you were right!

* Throw an error if player is null

* Prevent NPE

* Prevent NPE

* Do a null check

* World should never be null.

* Require non-null world

* Require owner to be non-null. It should never be null

* Prevent NPEs

* Clear the going home flag for edge cases

There were a few potential times when the flag may not have been
cleared. These were mostly teleport failure scenarios. Hopefully, this
is all of them.

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

* Shift priority of EntityPortalEnterEvent to HIGH

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

This will allow other plugins running at NORMAL to cancel the event
before BentoBox does something.

* Increase priority of EntityPortalEvent listener

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

* Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1868

* Code refactoring around User.getInstance(player)

Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: Fredthedoggy <45927799+Fredthedoggy@users.noreply.github.com>
Co-authored-by: Justin <jstnf@users.noreply.github.com>
Co-authored-by: gecko10000 <60494179+levtey@users.noreply.github.com>
2021-11-08 21:28:12 -08:00
tastybento 5e3cffbe11 Code refactoring around User.getInstance(player) 2021-10-30 14:02:30 -07:00
tastybento 1953caa7c5 Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1868 2021-10-30 13:44:34 -07:00
tastybento 8752e19e5d Increase priority of EntityPortalEvent listener
https://github.com/BentoBoxWorld/BentoBox/issues/1866
2021-10-26 20:49:38 -07:00
tastybento 6aa7869b17 Shift priority of EntityPortalEnterEvent to HIGH
https://github.com/BentoBoxWorld/BentoBox/issues/1866

This will allow other plugins running at NORMAL to cancel the event
before BentoBox does something.
2021-10-23 16:39:36 -07:00
tastybento 930433b64b Clear the going home flag for edge cases
There were a few potential times when the flag may not have been
cleared. These were mostly teleport failure scenarios. Hopefully, this
is all of them.

https://github.com/BentoBoxWorld/BentoBox/issues/1864
2021-10-16 20:44:18 -07:00
tastybento 731d902d98 Prevent NPEs 2021-10-11 18:02:23 -07:00
tastybento 1a802a7510 Require owner to be non-null. It should never be null 2021-10-11 17:56:06 -07:00
tastybento 37e7846908 Require non-null world 2021-10-11 17:55:04 -07:00
tastybento 28a2ecfcfa World should never be null. 2021-10-11 17:52:38 -07:00
tastybento 081f74544b Do a null check 2021-10-11 17:48:41 -07:00
tastybento 2ffa4c9874 Prevent NPE 2021-10-11 17:43:04 -07:00
tastybento 907c6b3534 Prevent NPE 2021-10-11 17:27:24 -07:00
tastybento 8852b9d660 Throw an error if player is null 2021-10-11 17:21:07 -07:00
tastybento 765f774652 Prevent NPE
@Poslovich - you were right!
2021-10-11 17:15:51 -07:00
tastybento db464d5c04 NPE protections 2021-10-09 11:40:15 -07:00
tastybento f37226b115 Refactor code for clarity. 2021-10-09 11:20:48 -07:00
tastybento 536d7ef1c3 Put default getHandlers back in for backwards compatibility
Without them, too many older addons break. They need updating to have
their own handlers. Once that is done, the default ones can be removed
maybe.
2021-10-09 09:29:52 -07:00
tastybento d3e7b55be5 Fix test
IWM inWorld must return true
2021-10-08 17:27:52 -07:00
tastybento 665724e825 Fix test
IWM inWworld needs to return true
2021-10-08 17:25:20 -07:00
tastybento fe2e9e1a9e Fix tests and refactor code 2021-10-08 17:15:41 -07:00
tastybento b5d9d2e52e API: Require getWorldSettings to be a game mode world 2021-10-03 20:33:50 -07:00
tastybento cfad9879a5 Refactored setowner command and added test class 2021-10-03 19:20:45 -07:00
tastybento 3a43c40634 Ensure oldIsland is never null. 2021-10-03 16:16:58 -07:00
tastybento 60c62a5967 Prevent rare NPE 2021-10-03 16:08:49 -07:00
tastybento 3c65194dfb Fix missing edge deletion of island.
The bounding box was erroneously being made smaller when it was not
required because the inBounds check does that already.

https://github.com/BentoBoxWorld/BentoBox/issues/1863
2021-10-03 15:50:18 -07:00
tastybento a1c3f78293 Fix tests 2021-10-03 15:46:11 -07:00
tastybento b5fd992fa7 Fix mis-statement of island protection coordinates in info command. 2021-10-03 15:29:57 -07:00
tastybento bc6ec36f87 Fix missing color conversion for translations. 2021-10-03 15:04:14 -07: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 f66eeed4a1 Version NPE protections. 2021-09-25 16:42:54 -07:00
tastybento 3236c68e5c Fix test. 2021-09-25 09:42:51 -07:00
tastybento 500f7292c6 Fix tests. 2021-09-25 09:34:02 -07:00
tastybento af3c0a874c Added API to get a translation without color conversion
It may be necessary to read the translation without converting colors to
Bukkit colors.
2021-09-25 08:47:14 -07:00
tastybento 0a4fc83218 Fix tests - just counts of events. 2021-09-25 08:33:07 -07:00
tastybento 8b474833e1 Fix IslandSethomeCommand test 2021-09-25 08:07:15 -07:00
tastybento bc737d4d66 Remove deprecated events. 2021-09-25 08:00:04 -07:00
tastybento 3d2a99c036 Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2021-09-25 07:51:13 -07:00
BONNe 16d5775c84
Fix "ugly" enchant name. (#1858)
Enchant names did not have a touch of Util#prettifyText code.
2021-09-22 19:35:22 -07:00
tastybento 690ea2f99e Prevent NPE possibility. 2021-09-19 18:36:37 -07:00
tastybento 29fa03976c Fix some code smells. 2021-09-19 18:29:19 -07:00
tastybento f6f5b63110 Fix 2021-09-19 08:45:19 -07:00
tastybento 110a282deb Use isPlayer instead of null check.
Refactor code to be easier to understand.
2021-09-19 08:42:37 -07:00
tastybento 53f02ae686
Npe squashing (#1857)
* Fix hanging [uuid] in info.

* NPE checking

* Make getProtectionCenter nonNull

* More NPE fixes.

* Fix test

* Make getPlayer() and getOfflinePlayer() nonNull returns

This requires addons to not use null checks and instead us the isPlayer
or isOfflinePlayer methods.

* NPE blockers

* Deprecate CompositeCommand isPlayer method.

* Fix test
2021-09-18 17:59:32 -07:00
tastybento b247b360bf Fix test. 2021-09-18 12:25:25 -07:00
tastybento 68890eba00 Fix test 2021-09-18 12:25:14 -07:00
tastybento 8eac5070f0 Null check 2021-09-18 11:37:33 -07:00
tastybento 25fe86d812
Non null user methods (#1856)
* This makes some User methods non-null.

Instead of returning null, some methods will throw an error if they are
called on non-Players. This means code does not have to do null checks.

* Perform null check in method.
2021-09-18 11:22:28 -07:00
tastybento 8eb45e817c Code smell reduction 2021-09-18 08:15:15 -07:00
tastybento 3282b1bd12 Fix max-range bug 2021-09-18 08:14:43 -07:00
tastybento d92632341d Fix JavaDoc for GameModeAddon inWorld method 2021-09-16 16:47:42 -07:00
tastybento 02a14cab6e
Requires nonNull parameters for User.instanceOf (#1852)
* Requires nonNull parameters for User.instanceOf

The only reason why User.instanceOf was returning a potential null was
if the parameter was null. Further absolutely no null checking was being
done, so the assumption was that User.instanceOf should never return a
null. This corrects the annotations and requires non-Null parameters.

* Remove null player test
2021-09-16 16:41:27 -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 bb7f124066 Avoid zipSlip vulnerability. 2021-09-12 21:53:26 -07:00
tastybento 0e744cae81 Added test class for Island. 2021-09-12 17:35:52 -07:00
tastybento 7271096ace Ensure maxEverProtectionRange is less than range.
https://github.com/BentoBoxWorld/BentoBox/issues/1851
2021-09-11 16:53:27 -07:00
tastybento 3dd9e973fb Island range perms could be 2x island distance
This could allow protection ranges to be much greater than the island
range and therefore overflow into adjacent islands.

https://github.com/BentoBoxWorld/BentoBox/issues/1851
2021-09-11 16:50:43 -07:00
tastybento a6d70d6e90
Release 1.17.3 (#1827)
* Version 1.17.1

* Add homes command to default player options.

* Implements better online player counter. (#1791)

Current one is based on online player count when bStats sends data to the server.
This one will send data about amount of players who logged in the server.

* Add Boxed Gamemode to the list. (#1793)

* Add Bank addon (#1792)

* Add Holographic Displays as SoftDepend for AOneBlock (#1794)

* Custom date time format support for /<admin> info <player> (#1783)

Fixes #1720

* Parent/sub-flag support, split up and designate CONTAINER flag as parent flag (#1784)

* Split CONTAINER flag into multiple flags

CONTAINER split into
- CONTAINER (Chest/Minecart Chest)
- BARREL (Barrel)
- COMPOSTER (Composter)
- FLOWER_POT (Flower Pot)
- SHULKER_BOX (Shulker Box)
- TRAPPED_CHEST (Trapped Chest)

Fixes #1777

* Add subflag support

* Create container parent flag, chest subflag

* Remove extra string from when CHEST was CONTAINER

* Fix incorrect flag specified on fired event in IslandToggleClick

* Add missing world subflag event firing

* Remove extra import

* Add world setting flag for island visitors keep inventory (#1785)

* Implement 3 bar charts: addons, gamemodes, hooks (#1790)

BStats supports sending Bar chart data, however, it does not display it via their site directly.
It can be called manually, to view.

PieChart does not work very well for addons and hooks. BarChart however allows viewing each addon separately. 

This change allows sending data to the server about bar charts.

* Update action versions

* Declare distribution - adopt

* Cache Java Maven files differently.

* Try dependency for shade snapshot

* Add support for Minecraft 1.17.1

* Fix test by incrementing listener value check

There is a new listener now.

* Spigot 1.17.1

* Fix test for InventoryListener

* Re-order repos.

* Downgrading to 1.17 Spigot for now to enable building.

* Try pluginRespositories tag in POM to enable Github actions

* Version 1.17.2

* Add alternative Addon#getIslandManager method (#1797)

We have already done this to the main BentoBox class. But add-ons missed it, and it still has this weird structure: Addon#getIslands().getIslands().

This will just add the same method as it is already in BentoBox class.

* Fix bucket dupe (#1806)

Fix https://discord.com/channels/272499714048524288/310623455462686720/867790395442462760

* Removes unneeded exploit protection code for skulls (#1810)

This no longer seems to be required with 1.17.1

https://github.com/BentoBoxWorld/BSkyBlock/issues/430

* Quote filename of addon that cannot be loaded.

Provides a better understanding of which addon failed.

* Remove update when pasting chest.

* Version 1.17.3

* Java upgrade (#1814)

* Version 1.17.3

* Use Map.of and List.of instead of Immutable collections

* Replace explicit type argument.

* Replace lamba with method reference

* Replace condition with Objects.requireNonNullElseGet

* Use String.repeat

* Use new switch expressions

* Use instanceof patten variables which are more compact

* Fuse toUnmodifiableList into stream and return it.

* Remove unnecessary toString() calls.

* Remove unnecessary public

* Extracted common part from if

* Simplify conditional expressions

* Remove unused IOExceptions

* Cast to long

* Use Map.putAll

* Use primitives

* Clarify what is null or not

* Addedd @Serial annotation introduced with Java 14.

* Use Optional.isEmpty instead of !isPresent

* Use flatMap then ifPresent

* Just use Arrays.stream

* Swap map and filter for null with Objects::nonNull

* Use expression lambda

* Update JavaDoc version to 16

* Make spawn protection area square instead of circle.

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

* Improve ItemParser code. (#1821)

* Improve ItemParser code.

Add ability to parse text if Material is just a single string.
Add ability to parse player heads.

Add comments to the code.

* Fixes failing test.

* Added deprecation suppression.

* Added Pladdon to loadbefore.

* Prevent bucket duping when scooping obsidian Part 35

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

* Warns visitors that PVP is active if they teleport to an island

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

* Prevents repeated portaling when nether is disabled. (#1826)

* Prevents repeated portaling when nether is disabled.

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

* Fix test

* Hex pr 1820 (#1822)

* Fix @since for subflags. (#1831)

* Add Citizens to Softdepend list for NPC support (#1834)

* Fix color test.

* Set the default game mode when player makes island.

* Corrects JavaDocs link

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1838

* Update to 3.3.1-SNAPSHOT for shade plugin.

* Package info files for better JavaDocs (#1839)

* Added package info files for better JavaDocs

* Implement Flag icon changing via Locales file. (#1829)

This commit contains 2 changes:
- An option for Flag to use icon that is defined in locales after "icon" string.
- An option for ItemParser to parse icon or return given value, if parsing was not successful.

The flag option is not ideal, but it is simpler and easier to maintain then adding new config section where icons can be changed, as the locales file already contains a lot of info about each flag.

* Support glowing ink in blueprints (#1842)

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1837

* Panel template (#1841)

* Implement basic functionality to read data from template panels.

Create TemplateReader class that has static method which generates a PanelTemplateRecord. This record contains every necessary information from user created template file so everyone could use it to generate a functional panel.
These classes are just for reading templates and do not create actual panel.

* Add template clearing via bentobox reload command.

* Fix version command to show addon state.

* Fix German flag banner description.

Added more debug around error reporting.

* 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.

* 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.

* Prevent home teleport when already home teleporting

Home teleporting is async so it's possible to issue the command multiple
times. This puts a flag in so that if a playeer is mid-teleport, then
issuing the go command will just repeat the text that the player is
teleporting home.

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

* Extracted island info from the Island object.

This is in preparation to have a different info for players than admins.

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

* Slimmer trimmer island info for players.

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

* Fixes coop and trust invites when team invites are not allowed

If a member or sub-owner has coop or trust invite capability and not
team invite rank, and confirm invites is on, then the invites were not
working.

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1452

* Remove invulnerable visitor protection if island is in PVP mode

We now have alerts if a player teleports to a PVP island.

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

* Fixes NPE in admin tp if nether or end worlds don't exist.

* Adds arrow sound when teleporting into a PVP island.

* Fix PVPListenerTest

Visitors are no longer invincible when on a PVP island.

* Fix test failure in InvincibleVisitorsListenerTest

* Minor JavaDoc correction.

* Go command was not working second time.

* Prevents console errors for missing icons in locale files.

* Fixes PlAddon disabling issue. (#1847)

There was a bug that did not unload PlAddon classes from JVM.
This change should fix it, as it will unload PlAddons via pluginLoader.

* Clear code - set worlds once on construction.

* Fixes a bug when Potion metadata was not applied (#1849)

There was missing potion meta data applying after creating an item. 
This affects both: Potions and Tipped arrows.

* Adds force-shown lines to the template. (#1850)

* Adds force-shown lines to the template.
Fixes a bug when template type was not selected correctly.
Changes "name" to "title" for border and background icons.

* Create TemplatedPanel and TemplatedPanelBuilder.

TemplatedPanel uses PanelTemplateRecord to create a functional panel.
Builder contains button builder callbacks that are used to create buttons with custom data.

* Use final vars for lambdas to avoid them changing async

The processes could run async, especially when chunk loading took a
while, so using fields that could change would result in blocks being
missed, especially in the nether or end. Switching to final vars avoids
this.

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1840

* Remove travis.

Co-authored-by: BONNe <bonne@bonne.id.lv>
Co-authored-by: Fredthedoggy <45927799+Fredthedoggy@users.noreply.github.com>
Co-authored-by: Justin <jstnf@users.noreply.github.com>
Co-authored-by: gecko10000 <60494179+levtey@users.noreply.github.com>
2021-09-10 18:39:16 -07:00
tastybento b24c1fdc86 Use final vars for lambdas to avoid them changing async
The processes could run async, especially when chunk loading took a
while, so using fields that could change would result in blocks being
missed, especially in the nether or end. Switching to final vars avoids
this.

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1840
2021-09-08 21:08:15 -07:00
tastybento 6bff4c8132 Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2021-09-08 20:26:56 -07:00
BONNe 9da329356a
Adds force-shown lines to the template. (#1850)
* Adds force-shown lines to the template.
Fixes a bug when template type was not selected correctly.
Changes "name" to "title" for border and background icons.

* Create TemplatedPanel and TemplatedPanelBuilder.

TemplatedPanel uses PanelTemplateRecord to create a functional panel.
Builder contains button builder callbacks that are used to create buttons with custom data.
2021-09-08 19:58:26 -07:00
BONNe 6bf3264ab5
Fixes a bug when Potion metadata was not applied (#1849)
There was missing potion meta data applying after creating an item. 
This affects both: Potions and Tipped arrows.
2021-09-08 19:57:27 -07:00
tastybento 3650863fa1 Clear code - set worlds once on construction. 2021-09-08 19:50:23 -07:00
BONNe 23e3554c4d
Fixes PlAddon disabling issue. (#1847)
There was a bug that did not unload PlAddon classes from JVM.
This change should fix it, as it will unload PlAddons via pluginLoader.
2021-09-05 17:28:49 -07:00
tastybento 938940199d Prevents console errors for missing icons in locale files. 2021-09-04 17:21:45 -07:00
tastybento 184c86bafe Go command was not working second time. 2021-09-04 17:21:25 -07:00
tastybento 0844e97530 Minor JavaDoc correction. 2021-09-04 15:43:51 -07:00
tastybento 28cecc2658 Fix test failure in InvincibleVisitorsListenerTest 2021-09-04 15:43:41 -07:00
tastybento e77a40f0cb Fix PVPListenerTest
Visitors are no longer invincible when on a PVP island.
2021-09-04 15:12:26 -07:00
tastybento 7d7882c309 Adds arrow sound when teleporting into a PVP island. 2021-09-04 14:46:41 -07:00
tastybento 74ded5a187 Fixes NPE in admin tp if nether or end worlds don't exist. 2021-09-04 14:46:26 -07:00
tastybento 7621677c93 Remove invulnerable visitor protection if island is in PVP mode
We now have alerts if a player teleports to a PVP island.

https://github.com/BentoBoxWorld/BentoBox/issues/668
2021-09-04 14:36:47 -07:00
tastybento 23522a297f Fixes coop and trust invites when team invites are not allowed
If a member or sub-owner has coop or trust invite capability and not
team invite rank, and confirm invites is on, then the invites were not
working.

Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1452
2021-09-04 13:47:44 -07:00
tastybento 0f7ca6ac60 Slimmer trimmer island info for players.
https://github.com/BentoBoxWorld/BentoBox/issues/1501
2021-09-04 10:02:37 -07:00
tastybento 547c266975 Extracted island info from the Island object.
This is in preparation to have a different info for players than admins.

https://github.com/BentoBoxWorld/BentoBox/issues/1501
2021-09-04 09:46:28 -07:00
tastybento 5bb12d53bd Prevent home teleport when already home teleporting
Home teleporting is async so it's possible to issue the command multiple
times. This puts a flag in so that if a playeer is mid-teleport, then
issuing the go command will just repeat the text that the player is
teleporting home.

https://github.com/BentoBoxWorld/BentoBox/issues/1637
2021-09-03 15:39:08 -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
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 a9a7673ce8 Fix German flag banner description.
Added more debug around error reporting.
2021-08-29 15:04:20 -07:00
tastybento 44f06f2911 Fix version command to show addon state. 2021-08-29 14:56:54 -07:00
BONNe 2607256c06
Panel template (#1841)
* Implement basic functionality to read data from template panels.

Create TemplateReader class that has static method which generates a PanelTemplateRecord. This record contains every necessary information from user created template file so everyone could use it to generate a functional panel.
These classes are just for reading templates and do not create actual panel.

* Add template clearing via bentobox reload command.
2021-08-29 14:34:05 -07:00
tastybento faf351fd59
Support glowing ink in blueprints (#1842)
Fixes https://github.com/BentoBoxWorld/BentoBox/issues/1837
2021-08-29 14:17:42 -07:00
BONNe fa41abc062
Implement Flag icon changing via Locales file. (#1829)
This commit contains 2 changes:
- An option for Flag to use icon that is defined in locales after "icon" string.
- An option for ItemParser to parse icon or return given value, if parsing was not successful.

The flag option is not ideal, but it is simpler and easier to maintain then adding new config section where icons can be changed, as the locales file already contains a lot of info about each flag.
2021-08-29 13:30:45 -07:00
tastybento 0341515fc8
Package info files for better JavaDocs (#1839)
* Added package info files for better JavaDocs
2021-08-29 13:28:16 -07:00
tastybento 876ba91837 Set the default game mode when player makes island. 2021-08-23 19:40:46 -07:00
tastybento 6c75733417 Fix color test. 2021-08-21 09:23:18 -07:00
Fredthedoggy 705693f904
Add Citizens to Softdepend list for NPC support (#1834) 2021-08-21 11:43:42 +02:00
BONNe c635647f85
Fix @since for subflags. (#1831) 2021-08-19 12:10:44 -07:00
tastybento b906f5561a
Hex pr 1820 (#1822) 2021-08-19 12:09:23 -07:00
tastybento e0d6e4df30
Merge branch 'master' into develop 2021-08-15 17:08:52 -07:00
tastybento 32638e7a87
Prevents repeated portaling when nether is disabled. (#1826)
* Prevents repeated portaling when nether is disabled.

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

* Fix test
2021-08-15 17:05:20 -07:00
tastybento 233c058bfe Warns visitors that PVP is active if they teleport to an island
https://github.com/BentoBoxWorld/BentoBox/issues/1780
2021-08-14 21:02:53 -07:00
tastybento 6b839d9c69 Prevent bucket duping when scooping obsidian Part 35
https://github.com/BentoBoxWorld/BentoBox/issues/1825
2021-08-14 16:23:13 -07:00
tastybento 7cadebc792 Added Pladdon to loadbefore. 2021-08-12 18:23:00 -07:00