Commit Graph

964 Commits

Author SHA1 Message Date
Christian Koop
7975f9088d
Heavily refactor PlotSquaredProtection.class
Moved code into private methods to make the Location#at call more readable
and to reduce duplicate code.

`PlotSquared.get()` is marked as `@NotNull` and is never null
if `PlotSquaredProtection#isEnabled` returns true.
That's why I removed the `null` check on the *API* with a check if PlotSquared is enabled.

I replaced the usage of Java StreamAPI with a simple for loop for better potential performance.
The loop is so simple and we don't know the plugins that might be using this class,
thus greater performance for a small loss on readability is probably worth it

+ Removed some unused imports
2022-12-30 16:14:08 +01:00
Christian Koop
3a95b13419
Removes commented-out test-dependency MockBukkit
More details can be found in 404a94c307
2022-12-30 15:28:25 +01:00
Christian Koop
0a7b24c0ce
Updates dev dependency org.jetbrains:annotations to v23.1.0 2022-12-30 15:24:08 +01:00
Christian Koop
88e28689f7
Adds ConfigEntry#withDefaultValue for easier chaining
This allows to chain the default value instead of using the setter or constructor.
Long keys/values can be put into individual lines which improves readability.

In the future, we might want to have a Builder class that contains all thise #with methods
2022-12-30 15:21:07 +01:00
Christian Koop
7eff3c86ec
Code cleanup (rename e->ex in catch; better type for #withUpgradeStep) 2022-12-30 15:21:07 +01:00
Christian Koop
c728c5fcc7
GitHub Actions: Adds Spigot 1.19.3 to the setup-action to compile it 2022-12-29 11:25:54 +01:00
Christian Koop
396f3aefb8
Merge branch 'development' into development-v3 2022-12-26 21:03:31 +01:00
Christian Koop
1a911ee085
Release v2.6.17 2022-12-26 19:59:02 +01:00
Christian Koop
6d28fce312
Updates dependency de.tr7zw:item-nbt-api to support Minecraft 1.19.3 2022-12-26 19:58:33 +01:00
Christian Koop
64865873f9
Adds NMS module for Spigot 1.19.3 (v1_19_R2) support 2022-12-26 13:44:58 +01:00
Christian Koop
296f82f50e
Restore functionality of deprecated SQLite connection acquisition
If the connection is closed, no new SQLite connection is created in plugins still using the
deprecated method.


Introduced in 0ae9c6fcdb
2022-12-26 13:44:58 +01:00
Christian Koop
c3fb050444
Updates dependency UltimateStacker to v2.3.2 2022-12-26 13:44:49 +01:00
Christian Koop
d939489861
Use 1.18-R0.1-SNAPSHOT instead of 1.18 in NMS-v1_18_R1 module 2022-12-25 22:49:39 +01:00
Christian Koop
4d194ed92b
Rename constant into upper case to match code conventions 2022-11-26 20:40:57 +01:00
Christian Koop
0b2a253014
Fix typo in JavaDoc 2022-11-26 20:40:28 +01:00
Christian Koop
00789921a3
Revert "GitHub Actions: Skip automated tests when running SonarCloud"
This reverts commit 59f4adfc6f.

We need the tests to generate the test coverage report. Didn't think of that.
2022-11-26 20:27:20 +01:00
Christian Koop
e2194e0dec
GitHub Actions: Adds missing empty line between steps in sonarcloud.yml 2022-11-26 20:26:01 +01:00
Christian Koop
8e91cc18eb
Makes SongodaYamlConfig#cannotCreateBackupCopyExceptionPrefix static
It already is `final`.
By making it static we reduce the memory required by each instance of the class.
2022-11-26 20:25:11 +01:00
Christian Koop
bba5fa5f3e
Adds additional information for deprecations as JavaDocs 2022-11-26 20:24:14 +01:00
Christian Koop
bc56347727
Fix order of modifiers in SongodaCore-class 2022-11-26 20:23:45 +01:00
Christian Koop
75b497a163
Add private constructor to SongodaCoreConstants to hide implicit one
The utility class only has static members - Nothing to gain from instantiating it other than confusion
2022-11-26 20:23:08 +01:00
Christian Koop
59f4adfc6f
GitHub Actions: Skip automated tests when running SonarCloud
The build pipeline already runs the tests. I think it makes sense to run SonarCloud's static
code analysis when the project can be compiled without errors.
2022-11-26 15:36:29 +01:00
Christian Koop
67a69e34e8
Make unit tests in LocaleFileManagerTest deterministic
The order in which files inside of a given directory are listed is not guaranteed in any way.
This causes tests to work on my machine but fail on out GitHub Actions CI/CD pipeline.
2022-11-26 15:31:43 +01:00
Christian Koop
6c6c3e950c
GitHub Actions: Enable build and sonarcloud workflow for v3-dev-branch 2022-11-26 00:01:00 +01:00
Christian Koop
5a7a3d052d
Cleanup YAML in .github/dependabot.yml 2022-11-25 23:59:56 +01:00
Christian Koop
d710b2d2d5
Add unit test for SongodaYamlConfig persisting comments on key-upgrades 2022-11-16 02:29:41 +01:00
Christian Koop
02330b5ca7
Improve temporary file deletion in YamlConfig and FileManager tests
The SongodaYamlConfig might create a backup config file when upgrading a
configuration into a newer version.
This file would not get deleted in the old implementation
2022-11-16 02:14:45 +01:00
Christian Koop
f8b3942de2
Adds hyphen before timestamp in file name, when creating backup YamlCfg 2022-11-16 02:03:41 +01:00
Christian Koop
daa601688d
Updates SnakeYaml dependency from 1.30 to 1.33 2022-11-16 02:03:03 +01:00
Christian Koop
e7da328dc6
Fix YamlConfiguration not dumping comments
Not sure when it broke, but now it's fixed.
2022-11-16 02:02:09 +01:00
Christian Koop
404a94c307
Move from MockBukkit to Mockito in automated tests
MockBukkit is not able to mock all of Bukkit's API
and broke with a change in PaperMC causing all our
current tests to fail. It is also version dependant.

But with Mockito you have to do everything manually right now.
No helping functionality (like creating a new mock player which automatically
will be returned in `Bukkit#getOnlinePlayers()`)

I took this opportunity to learn a bit about Mocking in Bukkit
and decided on Mockito.
It looks like we could easily write our own MockBukkit
alternative in the future.

I am not really happy how `Mockito#verify` works tho.
I find it annoying not to be able to directly assert
on the calls made to a method.
You have to create an InOrder instance first for the
mock and in the end verify with `Mockito#times(0)`/`Mockito#never()`
and `Mockito#any()` for each argument a method takes, to assert a total of n calls.
2022-11-15 22:49:09 +01:00
Christian Koop
ceebf211b3
Change maven repository IDs in pom.xml
I've setup proxy repositories at https://songoda.sprax.dev/repo/
for all current Core v3 dependencies (except maven-central).
These updated IDs can now be used in `~/.m2/settings.xml`
to configure mirrors: https://maven.apache.org/guides/mini/guide-mirror-settings.html
2022-11-15 18:57:10 +01:00
Christian Koop
6aa9178321
Fix ItemUtils#applyRandomEnchants in Minecraft 1.19
The method needs a `RandomSource` instead of a normal Java `Random`.
The method reference has been updated but updating
its usage has been forgotten.

Sadly I do not really know where to properly
get an `RandomSource` instance without instanciating it myself.
2022-11-07 22:29:40 +01:00
Christian Koop
aff3ea92f3
Fix wrong coreVersion in SongodaCore class 2022-11-07 22:19:19 +01:00
ceze88
e8c0e21ac2 Adds suppoert for PlotSquared and MariaDB for SQL 2022-11-04 12:28:20 +01:00
Christian Koop
31fde88c33
Fix ConcurrentModificationException in DropUtils for UltimateStacker
Related to 92c653d9be
2022-10-26 22:59:00 +02:00
Christian Koop
500ac98f84
Release 2.6.17-SNAPSHOT 2022-10-26 21:59:06 +02:00
Christian Koop
5f43578869
Fix NoSuchFieldError on Paper-Spigot 1.19.2 for SWorld#getLivingEntities
The field does not exist on Spigot (located in another class?).
But `#getEntities()` does exactly what we need and Paper-Spigot still has it.


SD-9374
SD-9377
SD-9392
SD-9401
2022-10-26 21:58:34 +02:00
Christian Koop
b168ad0738
Provisional first implementation of the new localization system
It it not done yet. A lot of usability features are still missing.
Including a proper interface to interact with the whole
new system in the plugins.
2022-09-29 21:55:57 +02:00
Christian Koop
2e15ed5d28
Adds a simple http client
This is intended to standardize how we do these request in the core.
It doesn't do much but it will sufice for now to be used
in the new localization system.
2022-09-29 21:52:59 +02:00
Christian Koop
2860dffb83
Update Dependencies: Spigot, MockBukkit, JUnit, pitest-maven 2022-09-29 21:39:07 +02:00
ceze88
92c653d9be Add max stack size check when pre-stack items with US 2022-09-19 21:04:52 +02:00
ceze88
30d070cade Drop items stacked when UltimateStacker is present 2022-09-19 20:37:34 +02:00
ceze88
d11b32d8ea Update UltimateStacker version 2022-09-19 20:36:38 +02:00
Christian Koop
954c5024a9
Reverts 'GitHub-Actions: Force Spigot 1.19.2 recompilation'
d51f72977b
2022-09-04 19:43:28 +02:00
Christian Koop
e3b275b40d
Release v2.6.16 2022-09-04 19:31:58 +02:00
Christian Koop
d51f72977b
GitHub-Actions: Force Spigot 1.19.2 recompilation
The non-mapped version is currently cached and thus not getting
recompiled. This is a temporary *fix* for that
2022-09-04 19:24:50 +02:00
l3st4tDevelopment
4800d69829
Add 1.19.2 to workflow 2022-09-03 03:01:17 -04:00
BuildTools
9c47056b46 Version 2.6.16-DEV - Support for 1.19.1/2 spawners. 2022-09-03 01:03:27 -04:00
Christian Koop
1cd96b10c5
Remove overloading WorldCore#getSpawner(CreatureSpawner) 2022-08-28 19:19:48 +02:00