Commit Graph

552 Commits

Author SHA1 Message Date
Christian Koop
c725ea69d6
Revert all the SongodaYamlConfig related commits
Revert "Ensures usage of UTF-8 in SongodaYamlConfig"

This reverts commit 339a4d6f6c.

Revert "Improve test coverage + stability of configuration.yaml/songoda classes"

This reverts commit ef6c37b80c.

Revert "Adds ConfigEntry#withDefaultValue for easier chaining"

This reverts commit 88e28689f7.

Revert "Code cleanup (rename e->ex in catch; better type for #withUpgradeStep)"

This reverts commit 7eff3c86ec.

Revert "Rename constant into upper case to match code conventions"

This reverts commit 4d194ed92b.

Revert "Fix typo in JavaDoc"

This reverts commit 0b2a253014.

Revert "Makes SongodaYamlConfig#cannotCreateBackupCopyExceptionPrefix static"

This reverts commit 8e91cc18eb.

Revert "Make unit tests in LocaleFileManagerTest deterministic"

This reverts commit 67a69e34e8.

Revert "Add unit test for SongodaYamlConfig persisting comments on key-upgrades"

This reverts commit d710b2d2d5.

Revert "Improve temporary file deletion in YamlConfig and FileManager tests"

This reverts commit 02330b5ca7.

Revert "Adds hyphen before timestamp in file name, when creating backup YamlCfg"

This reverts commit f8b3942de2.

Revert "Fix YamlConfiguration not dumping comments"

This reverts commit e7da328dc6.

Revert "Provisional first implementation of the new localization system"

This reverts commit b168ad0738.

Revert "Fix error handling of SongodaYamlConfig#load(Reader)"

This reverts commit 163e4d9eaf.

Partially reverts "Adds some deprecation notices to configuration.editor classes"

This partially reverts commit eea951ecc6.

Revert "Redo ConfigEntry abstraction"

This reverts commit 20b44327e0.

Revert "Migrate CustomizableGui from old Config to SongodaYamlConfig"

This reverts commit d5ddde3e08.

Revert "Adds SongodaYamlConfig#getAsEntry(String) for convenience"

This reverts commit 20b7a353b8.

Revert "Add contract to `ConfigEntry#getString(String)` for non-null-argument"

This reverts commit 78b6039d39.

Revert "Adds getter to ConfigEntry for List<String>"

This reverts commit 3a09c19dbb.

Revert "Remove usage of Locale classes"

This reverts commit da3c89450e.

Revert "Mark overwritten and empty config methods in SongodaPlugin as deprecated"

This reverts commit 73685b62dd.

Revert "Adjust log levels in SongodaYamlConfig"

This reverts commit 7ef00bb8f9.

Revert "Fix SongodaYamlConfig not creating parent directory when saving"

This reverts commit b0f006aed0.

Revert "Fix SongodaYamlConfigTest leaving created backup files in tmp dir"

This reverts commit c9a48387de.

Revert "Remove Config related methods in SongodaPlugin"

This reverts commit fce5c5c6a1.

Revert "Introduce new SongodaYamlConfig and ConfigEntry classes"

This reverts commit eb10b3f70a.

Revert "Fix YamlConfiguration dumping null values and empty tree nodes"

This reverts commit 02ab8d4bb2.

Revert "Fix `YamlConfiruration#getKeys("")` not returning root node keys"

This reverts commit 885cc9a87e.

Revert "Fix exception on loading empty file in YamlConfiguration"

This reverts commit 2683bc12c0.

Revert "Make YamlConfiguration insertion-sorted"

This reverts commit 2262652577.

Revert "Rename `IConfiguration#getOrDefault` to `#getOr`"

This reverts commit f6e207cdda.

Revert "Adds Enum support to YamlConfiguration class (#41)"

This reverts commit 41bd5c633a.

Revert "Removes the default implementations for #save(File) and #load(File)"

This reverts commit 8f15df3601.

Revert "Replace Songoda's YAML Configuration wrapper with an own implementation"

This reverts commit 6d6fa7210a.
2023-05-06 22:44:38 +02:00
Christian Koop
748f10b77b
Merge branch 'development' into development-v3 2023-05-06 20:17:35 +02:00
Christian Koop
0a0848c857
Release v2.6.21 2023-04-29 12:37:40 +02:00
Christian Koop
06761c001c
Fix plugin cmd list displayed in Action Bar instead of the chat 1.19.3+
The boolean flag determines 'whether the message is an actionbar or chat message'.
We want to have it set to `false` here.

Reference:
https://wiki.vg/index.php?title=Protocol&oldid=18120#System_Chat_Message
2023-04-29 11:56:04 +02:00
Christian Koop
7a7d2e8b97
Release v2.6.20 2023-04-22 16:13:07 +02:00
Christian Koop
9361fad0bf
Deprecate BlockUtils and BlockUtilsModern classes 2023-04-22 15:18:33 +02:00
Christian Koop
e21db58a67
Reimplement BlockUtils#updateAdjacentComparators in WorldCore
The implementation broke in 1.19.4 mid-version.
Fixes `java.lang.NoSuchMethodException: org.bukkit.craftbukkit.v1_19_R3.CraftChunk.getHandle()`


Related commit: a3e73be1aa
2023-04-19 21:59:13 +02:00
Christian Koop
57f9f1f911
Fix coreVersion in SongodaCore class not being the correct release 2023-04-13 11:51:14 +02:00
Christian Koop
177ecb36e5
Release v2.6.19 2023-04-13 11:48:55 +02:00
Christian Koop
37a9ee8868
Adds missing commands to list when console is running songoda command 2023-04-13 11:35:19 +02:00
Christian Koop
c34c8faa9c
Fix wrong permission configured for SongodaCoreUUIDCommand 2023-04-13 11:23:05 +02:00
Christian Koop
b9293079e0
Fix broken Wiki-URL in CustomizableGui
The Wiki has moved/changed and is not redirecting properly sadly
2023-04-13 11:22:43 +02:00
Christian Koop
2730b91598
Have songoda-Command have 'craftaro' as alias and change wording to that
Not having the actuall command change allows of other plugins *finding* that command
in that way means not introducing a breaking change by accident ^^

+ It's very hacky the way I did it but tbh... Core v3 is somewhat around the corner anyways
2023-04-13 11:22:04 +02:00
Christian Koop
7c4e967dd8
Changes *some* Songoda wording to Craftaro
I don't want to introduce too much confusion or breaking changes
2023-04-13 11:18:12 +02:00
ceze88
1455cf2d1c Fix enchant book loot 2023-04-11 19:23:05 +02:00
ceze88
3dd3a31f25 Add coordinate placeholders to loot commands 2023-04-07 20:46:14 +02:00
Christian Koop
824f674dcd
Change order of IP and UUID in 'license not found' message to match GUI
The marketplace first asks for the UUID - I changed the order in the message to match that order.
2023-04-06 10:06:58 +02:00
Christian Koop
e33848adc5
Release v2.6.19-DEV 2023-03-29 21:16:28 +02:00
Christian Koop
65f606ee83
Refactor /songoda diag command and change output formatting a bit
This should make reading the version information displayed easier.
No more confusing the plugin version vs. the core version.

Additionally fixed `Mb` to `MiB`.
2023-03-29 19:22:09 +02:00
Christian Koop
140c59ffa2
Merge branch 'development' into development-v3 2023-03-29 18:49:25 +02:00
Christian Koop
07374fdbfd
Configures the new v1_19_R3 NMS module in the NmsManager class 2023-03-29 18:22:13 +02:00
Christian Koop
fafcf28e0b
Updates dependency item-nbt-api to v2.11.2 for Spigot 1.19.4 support
From the changelog:
>Add 1.19.4 as officially supported (2.11.1 will work fine on 1.19.4, but show a warning that it doesn't know about this version)
2023-03-29 18:21:41 +02:00
Christian Koop
6d8c3beeb3
Merge branch 'development' into development-v3 2023-03-16 19:07:54 +01:00
Christian Koop
52f6c42266
Adds NMS Module v1_19_R3 for Spigot 1.19.4 compatibility 2023-03-16 09:46:40 +01:00
Christian Koop
a79677d261
Updates Lands-ProtectionHook to use v6 of the API
The API changed and we are 2 major versions behind
This drops support for outdated version of *Lands* and re-adds support for the latest version.
2023-03-09 15:53:21 +01:00
Christian Koop
5199043a4b
Minor code refractoring on SongodaAuth
Just trying to make it a bit more readable and easier to understand at a glance.
2023-03-04 13:08:16 +01:00
Christian Koop
6145021ecb
Remove unused imports in SongodaAuth and apply code formatting 2023-03-04 12:47:53 +01:00
Christian Koop
d9586cfe86
Slightly changes wording of 'missing-license' message
+ small refactoring – Putting the *expesive* method calls outside the string into variables
to easier see them, when trying to understand the code and the need
for its own thread for just printing some messages to  the console.
2023-03-04 12:38:33 +01:00
Christian Koop
ca13e8b26e
Prints 'missing-license' message in the console as one long message
This prevents fragmentation of the idividual lines. `#getIP()` can take a couple of seconds
and because it is executed outside of the main-thread, other message can be printed bevore
the IP address and UUID are ready to be printed.
2023-03-04 12:36:20 +01:00
ceze88
386ff209a7 Release v2.6.18 2023-01-25 16:02:44 +01:00
ceze88
7c02457108 Ignore self compiled plugins 2023-01-15 12:23:56 +01:00
Christian Koop
c29c4a5b09
Release v2.6.18-DEV 2023-01-11 22:00:36 +01:00
ceze88
ad6b52ca4a Add license stuff 2023-01-11 21:41:04 +01:00
Christian Koop
dc64c29da7
Ensures UTF-8 usage in LootManager
Probably doesn't affect anything as this file should only contain english letters
but just in case for the sake of tidyness
2023-01-08 12:47:27 +01:00
Christian Koop
339a4d6f6c
Ensures usage of UTF-8 in SongodaYamlConfig
Depending on the environment the default system charset might not be UTF-8 beaking
messages files using non-english language etc.

I'm not sure but Spigot might even set it to ASCII? The tests succeed locally because I am
using Manjaro Linux which uses UTF-8 by default in the JVM. But testing a plugin and logging
the default charset returns ASCII instead (on the same machine).
2023-01-08 12:46:42 +01:00
ceze88
336c5c49f3
Revert "License system"
This reverts commit 10aac8c10f.
2023-01-06 14:02:32 +01:00
ceze88
10aac8c10f License system 2023-01-02 13:39:54 +01:00
ceze88
bd187c7512 Fix max stack size for drops 2022-12-31 20:42:03 +01:00
Christian Koop
842841cd74
Fixes NMS for Spigot 1.19.0 / 1.19.1 / 1.19.2 detection
Purpur-Spigot and plain Spigot do not end with `.0`. Not sure if Paper does or Spigot 1.19.1 does?

I just added the plain `1.19` check.
This is not an issue in the Core v3 branch as the check is more stable there.
2022-12-30 20:09:01 +01:00
Christian Koop
e44e161c89
Adds some additional test cases for MathUtilsTest 2022-12-30 18:23:02 +01:00
Christian Koop
ef6c37b80c
Improve test coverage + stability of configuration.yaml/songoda classes 2022-12-30 18:22:11 +01:00
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
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
ceze88
a554934bfa Remove deprecated constructor 2022-12-29 13:49:34 +01:00
ceze88
8f95056e31 A little database utility 2022-12-29 13:49:04 +01:00
ceze88
17fb03f073 Fix pre stacking items 2022-12-29 11:50:51 +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
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
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
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
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
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
e3b275b40d
Release v2.6.16 2022-09-04 19:31:58 +02: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
Christian Koop
b07f67e0d6
Unify and cleanup all pom.xml-files
This also moves all the dependency declarations of the NMS modules
from the Core-Module to its own NMS-Module.
This module might get merged with the NMS-API module in the future.
2022-08-28 19:13:59 +02:00
Christian Koop
b3426a6a1a
Load NMS modules via Reflections instead of defining everything manually
This probably needs some additonal work but my idea
is that every NMS module has only one entry point.
This hopefully allows for as much freedom in version-specific
implementations as possible and allows for easily  loading them via Reflections.
2022-08-28 18:20:22 +02:00
Christian Koop
e18db1d775
Removes depenency on NMSPlayerImpl for NmsWorldBorderImpl 2022-08-28 16:54:29 +02:00
Christian Koop
9d7026ec27
Replace SWorldBorder implementation and move it into NMS modules 2022-08-28 16:54:29 +02:00
Christian Koop
43148032a2
Replace #setBlockFast implementation and move into NMS modules
We need to check if FabledSkyBlock actually needs this and if it can be removed from the Core.
I added a TODO-Comment for that.
2022-08-27 22:42:07 +02:00
Christian Koop
3d20f439e1
Replace #updateAdjacentComparators implementation(+ move to NMS modules) 2022-08-27 22:35:37 +02:00
Christian Koop
b779194e3e
Adds SongodaCore#getVersion and deprecate #getCoreLibraryVersion 2022-08-25 08:37:46 +02:00
Christian Koop
163e4d9eaf
Fix error handling of SongodaYamlConfig#load(Reader) 2022-08-21 20:44:41 +02:00
Christian Koop
eea951ecc6
Adds some deprecation notices to configuration.editor classes 2022-08-21 20:44:19 +02:00
Christian Koop
20b44327e0
Redo ConfigEntry abstraction 2022-08-21 20:42:16 +02:00
Christian Koop
a06d27ab90
Version v3.0.0-SNAPSHOT 2022-08-19 10:06:58 +02:00
Christian Koop
d5ddde3e08
Migrate CustomizableGui from old Config to SongodaYamlConfig 2022-08-18 23:09:21 +02:00
Christian Koop
20b7a353b8
Adds SongodaYamlConfig#getAsEntry(String) for convenience
If you are reading a config dynamically instead of fully creating it
with all the entries beforehand, this method can be used
to easily access the *converted/casted* values.
2022-08-18 23:08:58 +02:00
Christian Koop
78b6039d39
Add contract to ConfigEntry#getString(String) for non-null-argument
The contract basically says that if you provide a
non-null argument to the method, it cannot return
a null value.
2022-08-18 23:07:18 +02:00
Christian Koop
3a09c19dbb
Adds getter to ConfigEntry for List<String> 2022-08-18 23:06:22 +02:00
Christian Koop
da3c89450e
Remove usage of Locale classes 2022-08-18 23:05:21 +02:00
Christian Koop
61b784b3e8
Merge branch 'development' into development-v3 2022-08-18 22:57:46 +02:00
ceze88
430e203a65 Fix connection with MySQL 2022-08-09 16:27:28 +02:00
Christian Koop
b568d51151
Release v2.6.15-DEV 2022-08-08 23:12:06 +02:00