The Deprecations need to be taken care of at a later point in time.
Most methods do have a strong use-case in relation to commands and should be placed
in a more appropriate class.
This a modified version of the original commit b2180b0c73.
I changed/removed:
* project version bump (a lot of unrealated file changes, wrong version in regards to breaking changes)
* Hacky changes to the NMS class
* Reverted changes to SSpawner (We want to keep the class variables final
and there doesn't seem to be a big advantage in overwriting basically the whole classe's content
when you could just create a new instance instead, as intended)
* Commit name (old name was `(changes will be in next commit)`)
It is used for mutation testing but realistically we don't even write that many tests.
Just adds complexity and because it is not often used, causes trouble when it hasn't been touched for months/years
The goal here is to keep the plugin enabled and initialize the Core.
This is needed for the `/craftaro license` command to work etc.
Sadly this also means other plugins checking for the plugin being the
(including the `/plugins` command), report the plugin as enabled
and seemingly ready (Although the plugin's API is not).
I'm creating this release to push the GitHub Actions and Dependabot changes to the main branch.
Dependabot should find at least 2 outdated actions dependencies and create a PR for them.
Please check #47 for a list of *most* changes.
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.
The implementation broke in 1.19.4 mid-version.
Fixes `java.lang.NoSuchMethodException: org.bukkit.craftbukkit.v1_19_R3.CraftChunk.getHandle()`
Related commit: a3e73be1aa
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
This should make reading the version information displayed easier.
No more confusing the plugin version vs. the core version.
Additionally fixed `Mb` to `MiB`.
+ 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.
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.
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).
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.
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
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
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.
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
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.
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.
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
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.
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.
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.
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.
A lot is happening in this release!
tl;dr: GitHub Actions runs tests, compiles the project, signs the jar files, deploys them to the Maven repo; Pushing a git tag issues a release instead of snapshot deployment; -SNAPSHOT is always added to the version otherwise; Core Version is now injected by maven instead of manually updating it in one of the classes
We now use GitHub Actions to run automated tests, compile the project, sign the resulting jar files, and always deploy a version to the Maven repo.
By default, a snapshot release is published but by creating a git tag, a release deploy can be triggered.
Additionally the Core version is not manually updated in one of the classes but injected after compiling it.
I think I found the most stable and easiest way to do this in maven,
although I'd have wished for it to be easier and maybe not after the class file has already been created.
Level.FINER is currently not logged anthough the Logger is set to ALL and isLoggable returns true for FINER.
There's an bug existing bug report at Spigot: https://hub.spigotmc.org/jira/browse/SPIGOT-7018
Escept for #getExtraConfigs which got renamed, the other methods are no longer required and have been removed.
Additionally the config methods defined by Bukkit's JavaPlugin class
have been overwritten with empty bodies.
This prevents the default behaviour trying to access stuff that's not there
or should not be considered a valid config to use.