Commit Graph

651 Commits

Author SHA1 Message Date
Christian Koop
f0d8aaffc7
chore!: Delete deprecated NmsManager class
Acording to the GitHub search this class is still used in some projects but there was enough
time to switch over to the Nms class + it's very easy to upgrade the usages to the new Nms class
2024-03-26 22:33:40 +01:00
Christian Koop
dce7adf81f
refactor: Refactors a couple of classes by applying our code style 2024-03-26 22:32:40 +01:00
Christian Koop
8c06a740d5
fix: Remove unused boolean variable related to the old license system 2024-03-26 22:18:19 +01:00
Christian Koop
c241224b64
chore!: Delete deprecated RotationUtils class
Judging by the GitHub search none of the plugins is using it anymore
2024-03-26 22:18:13 +01:00
Christian Koop
2add5b642f
refactor(test): Refactor DatabaseTest 2024-03-26 21:24:22 +01:00
Christian Koop
519194e414
refactor: Optimize imports in all classes 2024-03-26 21:00:36 +01:00
Christian Koop
c68c419f4f
feat: Remove Craftaro as an alias for the Songoda-Command 2024-03-26 20:55:10 +01:00
Christian Koop
69c4628c63
text: Update references to Craftaro with Songoda in strings 2024-03-26 20:54:03 +01:00
Christian Koop
9b9c8fb087
feat: Remove Craftaro's plugin license check
In a way, this can be considered an performance improvement
2024-03-26 20:53:08 +01:00
Christian Koop
156aa628af
docs: Update files to reflect repository rename to 'SongodaCore' 2024-03-26 20:41:28 +01:00
Brianna O'Keefe
a507cffbca Float support for StoredData. 2024-03-23 18:56:58 -05:00
Brianna OKeefe
e7340bbc89 version 3.0.3 2024-03-21 17:09:19 -05:00
Brianna OKeefe
5d9afba0b2 Monitored Threads. 2024-03-21 17:09:07 -05:00
Brianna OKeefe
60931f0ba3 Furnace gui type. 2024-03-21 17:08:56 -05:00
Brianna OKeefe
fc232fa8b1 New data system. 2024-03-21 17:08:38 -05:00
Brianna O'Keefe
9f6f8fb660 version 3.0.1 2024-03-12 14:19:08 -05:00
Brianna O'Keefe
ef36c58e0b TaskScheduler 2024-03-12 14:18:45 -05:00
Christian Koop
0592bf4abf
Fix DependencyLoader if the ClassLoader is URLClassLoader 2024-02-21 21:54:42 +01:00
ceze88
8289dae0f8 Fix DependencyLoader if ClassLoader is a AppClassLoader 2024-02-20 11:44:59 +01:00
ceze88
b2e842c805 Revert "Remove unnecessary cast"
This reverts commit bc1b613983.
2024-02-20 11:18:58 +01:00
ceze88
bc1b613983 Remove unnecessary cast 2024-02-19 11:23:46 +01:00
Christian Koop
4b738fdf78
fix: Prevent data loss on server shutdown in DataManager
We should wait for the async pool to cleanly exit and finish all running tasks.
30 seconds is a lot but we don't want any data loss – If 30 seconds are exceeded there might just be something
fundamentally broken in the (plugin) implementation (or a huge bulk action?)
2024-02-10 19:26:44 +01:00
ceze88
c59884b87c Update Adveture releated methods
- Fix incompatible types when setting item name and lore.
- Fix replaceLegacy method replacing characters that should not be replaced.
- Add methods to convert shaded Adventure library to the non shaded form if the server is above 1.18.2
2024-02-09 12:32:33 +01:00
ceze88
cc59a825be Fix dependency loading, use a ClassLoader instance which shared among all the plugins 2024-02-07 14:46:51 +01:00
Christian Koop
66a2abda32
feat: Adds support for CMI and Sainttx's Holograms plugin in new hooks 2024-02-02 23:12:08 +01:00
Christian Koop
c9a93d3a08
fix: Relocation path for reactivestreams contains . instead of ; 2024-02-02 23:09:43 +01:00
Christian Koop
fcb613e3d6
refactor: Slight refactoring of DependencyLoader class
I am too scared on touching too much logic and breaking something as I didn't work on this class
or with that library much yet.

So I'm just refactoring it a bit not changing a lot of logic
2024-02-02 18:54:34 +01:00
Christian Koop
193af915e9
Don't catch and log exceptions in DependencyLoader
This way whatever uses the DependencyLoader actually knows if something fails and can react to it
instead of just the JVM erroring because something is unexpectedly missing in the class path
2024-02-02 18:26:26 +01:00
Christian Koop
c027ab8b4c
fix: Diag-Command throws exception because of invalid String#format
The dependencyVersion accidentally got put as an arg into Player#sendMessage instead of the String#format
2024-02-02 18:16:40 +01:00
Christian Koop
f7e46be0d9
Make DependencyLoader implementations non-static and use #getDataFolder
The data directory location for plugins might be configured to another path, so instead we the
plugin's *DataFolder* as a basis for our Core's data directory
2024-02-02 18:16:40 +01:00
Christian Koop
92ff9cebd5
feat: Rework how the Core-Logger works and is used
Implement own logger to prefix message with plugin name (if available) and CraftaroCore.

We prefix with both because the Core is shaded and this way it is clearly logged "which" Core is logging what.

This is also the reason why the Logger's name is now `CoreLogger.class.getCanonicalName()`
instead of CraftaroCore to uniquely identify each logger. (similar to what Bukkit's PluginLogger does).
2024-02-02 18:10:03 +01:00
Christian Koop
e0dd19e91a
style: Reformat/Auto-format DependencyLoader class
Also gets rid of some unused imports
2024-02-02 17:02:09 +01:00
ceze88
1ec750cacf Move dependency folder, add dependency version info 2024-02-02 16:27:52 +01:00
ceze88
eeb2724e04 Update dependencies 2024-02-02 16:04:14 +01:00
ceze88
3233c92679 Update AdventureUtils.java 2024-02-01 13:03:31 +01:00
Christian Koop
638b793040
Introduce a new hook system (right now only with Hologram support)
My plans with this hook system are to make it easier to understand and maintain – Hopefully it is also more flexible

Hooks now have a dedicated activation-life-cycle – I think this allows it to contain all the logic to do what
it needs to do but also provide some helper methods like `#canBeActivated`.
The activation should be used by the hooks to reduce the memory and performancec impact when not used.
The de-activation also allows hooks to clean up themselves and not rely on the plugins used by the hook or
the plugin using the hook to clean up.

For example:
You can see that the `DecentHologramsHook` has few class variables and they are kept as
small as possible and reasonable when not activated.
In `#deactivate` I call `#removeAll` to remove all holograms that still exist and I call `ArrayList#trimToSize` to reduce it's size again.
This has a similar effect to setting the class varaible null or to a new List but with this I can make that field *final*.

The exact implementation details and capabilities vary on the third-party plugins being supported by hooks,
so it needs to be flexible and easy to understand, so we can easily add support for more plugins and especially
new plugin categories like Maps (dynmap, BlueMap, PlexMap, ...).
2024-01-30 19:43:30 +01:00
Christian Koop
d8564d1c1c
docs: Deprecates all current/soon old hook classes 2024-01-30 17:51:22 +01:00
Christian Koop
50dfbf8dad
! Renames Hook Interface to OutdatedHookInterface for the new hooks
The interface is used/imported in two other Craftaro plugins (FabledSkyBlock and UltimateStacker).

I've worked on a new hook system which is easier to understand and maintain and hopefully also
allows for some more flexibility.

To introduce the new hooks without breaking changes (or as little as possible), this interface had to move.
2024-01-30 17:51:22 +01:00
Christian Koop
29f2d0b643
Disables the update checker of the nbt-api library 2024-01-30 17:51:22 +01:00
ceze88
a4b7e2d28d Add minimessage and utility class for it 2024-01-30 17:14:58 +01:00
ceze88
b610b98547 Fix java 8 support for dependency loader 2024-01-29 16:31:03 +01:00
ceze88
82c7c49e41 Remove removed method 2024-01-24 19:05:06 +01:00
ceze88
52b93e873c Fix LinkageError in rare cases 2024-01-23 19:17:29 +01:00
Christian Koop
5850e1a0ec
Downgrade HikariCP to v4.0.3 to properly support Java 8 2024-01-15 21:08:45 +01:00
Christian Koop
0e8f52b1be
Implement workaround for migrated SQLite databases applying migrations
The migration version -1 is already written into the new database before the old one has been converted.
This causes the migration to be run on the converted database because in addition to the migrated
version (e.g. 8) the -1 is already written to the table.
And now you just need to be kind of lucky to not retrieve that wrong version.

Just a hacky workaround (I know)
2024-01-15 21:07:54 +01:00
Christian Koop
adcf8619ec
Slight refactoring of dependency/Dependency.java class
* Re-uses constructors to reduce duplicate code
* Makes sure the constructor with relocate-argument actually sets `this.relocate`
* Use `this.` for accessing class variables
2024-01-13 18:43:01 +01:00
Christian Koop
21bf900448
Make SongodaPlugin#getDependencies non-abstract and return empty Set
Most plugins don't have additional dependencies so this should make migrating existing plugins a bit easier.
2024-01-13 18:40:22 +01:00
ceze88
d4de86f6a5 Fix asm version again 2024-01-13 18:25:45 +01:00
Christian Koop
2f1f814d43
Do not directly modify dependency Set provided by the plugin
Modifying the Set directory makes assumptions about the created Set.
About it's type/implementation (maybe it is immutable/read-only?) and about
it's usage/way-of-use that does not break the plugin by adding stuff a Set that might be used differently too etc.
2024-01-13 17:36:42 +01:00
ceze88
3f62b36b26 Fix asm dependency 2024-01-12 17:01:40 +01:00