Commit Graph

3556 Commits

Author SHA1 Message Date
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
0e5db0f41f Quiet excessive warnings from JavaDoc plugin 2023-01-01 09:19:20 -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
d541e7054c Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2022-12-30 11:20:31 -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
a7869832f1 Merge branch 'develop' of https://github.com/BentoBoxWorld/BentoBox.git into develop 2022-12-29 11:31: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
ebd9215c56 Cast operands to (double) 2022-12-28 12:56:05 -08:00
tastybento
70262be896 Update to latest AuthLib 2022-12-28 12:42:58 -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
4792ff3f62 Init version 1.22 - Customizable GUI's version. 2022-10-04 12:11:17 +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