InfernalSuite / AdvancedSlimePaper

Advanced Slime World Manager as a Paper Fork
GNU General Public License v3.0
248 stars 85 forks source link

Fix the CLI tool #102

Closed davidmayr closed 5 months ago

davidmayr commented 7 months ago

Describe the issue The CLI tool was broken by the release of SWF 12 since it now relies on the bukkit persistant data. The CLI tool is very handy to quickly convert worlds and I use it quite often, so it would be nice if this were to be fixed

Spigot version not applicable Plugin version Up to date with dc112775adc988eac54444a215ab055a41a538f9

How to reproduce Run the CLI tool

Possible fix Shading the PersistantDataHolder and PersistantDataContainer interfaces from spigot in the CLI. These two should probably be enough for the error to disappear

Crash reports (if available) NOTE: Line numbers might not be accurate since the version this exception was created from contains my own improvements to the CLI experience. The error however is exactly the same on the vanilla CLI as this error stems from changes in the SlimeWorld interface and not the CLI. I just don't have a compiled version at hand atm.

Exception in thread "main" java.lang.NoClassDefFoundError: org/bukkit/persistence/PersistentDataHolder
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1012)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
        at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
        at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        at com.infernalsuite.aswm.importer.SWMImporter.importWorld(SWMImporter.java:99)
        at com.infernalsuite.aswm.importer.SWMImporter.main(SWMImporter.java:93)
Caused by: java.lang.ClassNotFoundException: org.bukkit.persistence.PersistentDataHolder
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
        ... 11 more
kyngs commented 5 months ago

Unfortunately, (as of SRF 12) ASWM internals depend on both the Bukkit API and NMS internals to read worlds. In theory, it is possible to fix it. However, it's probably not going to happen soon.

I understand that the CLI tool was very convenient for you, and I'll try to think something out in the future.

I'll keep this issue open in case I (or someone else) comes to this in the future.

kyngs commented 5 months ago

Sorry for the misinformation I spread yesterday. Upon further inspection, it appears that the CLI is only dependent on the Bukkit API, not NMS. It should be a pretty easy fix then. I'll try to push it soon

davidmayr commented 5 months ago

Sorry for the misinformation I spread yesterday. Upon further inspection, it appears that the CLI is only dependent on the Bukkit API, not NMS. It should be a pretty easy fix then. I'll try to push it soon

That would be awesome, thank you

kyngs commented 5 months ago

Can you build the importer from develop and try it out? It should work, however, it's now 12.8MB which is suboptimal, but I can't really do anything about it. I'm closing this issue, reopen if needed.