NiklasEi / gamebox

Minecraft plugin with a vast selection of inventory games
http://gamebox.nikl.me
GNU General Public License v3.0
15 stars 13 forks source link

Version 3.4.1 refused to load in 1.20.1 #94

Open CloudeLecaw opened 1 year ago

CloudeLecaw commented 1 year ago

Greetings. is there any change to get Support or at least a running version for 1.19.4? The last here announced one was working fine for 1.19.2 (we skilled 1.19.3) and in 1.19.4 it refused to load. At the moment in 1.19.4 we just see this one :(

[00:57:26 INFO]: [GameBox] Loading server plugin GameBox v3.4.1
[00:57:26 INFO]: [GameBox] Enabling GameBox v3.4.1
[00:57:26 INFO]: + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
[00:57:26 INFO]:  Your server version is not compatible with this plugin!
[00:57:26 INFO]:    Please make sure that you have the newest version:
[00:57:26 INFO]:    https://www.spigotmc.org/resources/37273/
[00:57:26 INFO]: + - + - + - + - + - + - + - + - + - + - + - + - + - + - +
[00:57:26 INFO]: [GameBox] Disabling GameBox v3.4.1
CloudeLecaw commented 1 year ago

Well the latested Version found on Discord was working in 1.19.4 (except the multiplayer part) https://cdn.discordapp.com/attachments/404605581261799425/1023602458632663050/GameBox.jar

Now in 1.20.1 it refused to load aggain with this message. :( Well i hope you can update it aggain :3

Hunter99011 commented 11 months ago

any update? 👍

NiklasEi commented 10 months ago

No, I haven't had the time and motivation to get back to GameBox. For 1.20 the build is currently failing because of a snakeyml update in Bukkit/Spigot. I would be very happy about any help on this. It would be nice to have a build that works with all current MC versions again, so I could upload it to Spigot. The official build there still only supports MC up to 1.16.

CloudeLecaw commented 9 months ago

hmm the compiles github version just giving me this

[13:26:10] [Server thread/INFO]: [GameBox] Loading server plugin GameBox v3.4.0
[13:26:10] [Server thread/INFO]: [GameBox] Enabling GameBox v3.4.0
[13:26:10] [Server thread/ERROR]: Error occurred while enabling GameBox v3.4.0 (Is it up to date?)
java.lang.NoSuchMethodError: 'void org.yaml.snakeyaml.constructor.CustomClassLoaderConstructor.<init>(java.lang.ClassLoader)'
    at me.nikl.gamebox.utility.GameBoxYmlBuilder.buildLocalModuleDataYml(GameBoxYmlBuilder.java:28) ~[GameBox_3.4.0.jar:?]
    at me.nikl.gamebox.module.local.LocalModule.<clinit>(LocalModule.java:44) ~[GameBox_3.4.0.jar:?]
    at me.nikl.gamebox.GameBoxSettings.defineGameBoxData(GameBoxSettings.java:192) ~[GameBox_3.4.0.jar:?]
    at me.nikl.gamebox.GameBox.onEnable(GameBox.java:77) ~[GameBox_3.4.0.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:281) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:189) ~[paper-1.20.1.jar:git-Paper-196]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
    at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
    at com.rylinaux.plugman.util.PaperPluginUtil.load(PaperPluginUtil.java:421) ~[PlugManX_2.3.5.jar:?]
    at com.rylinaux.plugman.command.LoadCommand.execute(LoadCommand.java:116) ~[PlugManX_2.3.5.jar:?]
    at com.rylinaux.plugman.PlugManCommandHandler.onCommand(PlugManCommandHandler.java:97) ~[PlugManX_2.3.5.jar:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.20.1-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:987) ~[paper-1.20.1.jar:git-Paper-196]
    at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchServerCommand(CraftServer.java:972) ~[paper-1.20.1.jar:git-Paper-196]
    at net.minecraft.server.dedicated.DedicatedServer.handleConsoleInputs(DedicatedServer.java:500) ~[paper-1.20.1.jar:git-Paper-196]
    at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:447) ~[paper-1.20.1.jar:git-Paper-196]
    at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1393) ~[paper-1.20.1.jar:git-Paper-196]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1170) ~[paper-1.20.1.jar:git-Paper-196]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:317) ~[paper-1.20.1.jar:git-Paper-196]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
[13:26:10] [Server thread/INFO]: [GameBox] Disabling GameBox v3.4.0

hm so might 1.20.1 (1.20.2) support will never come :3

InjectedPie commented 8 months ago

I think it breaks due to snakeyaml upgrade to 2.0 in spigot 1.20.x More specific the ModulesManager -> loadLocalModules and dumpModuleSettings maybe at other places

NiklasEi commented 8 months ago

I think it breaks due to snakeyaml upgrade to 2.0 in spigot 1.20.x

Yes it does. I am using some reflection to load yaml files and that no longer works. Last time I looked into this I was unable to find a migration guide or any other docs on how to do this with snakeyaml 2.0.

InjectedPie commented 8 months ago

I actually fixed all your class loading issues + made a work around for your missing nmsutil class - I've made a local port of that one. But I'm struggling with java ssl errors

InjectedPie commented 8 months ago

https://github.com/NiklasEi/gamebox/compare/master...InjectedPie:gamebox:master

loadModuleSettings: CustomClassLoaderConstructor constructor = new CustomClassLoaderConstructor(ModulesSettings.class.getClassLoader(), new LoaderOptions()); Representer representer = new Representer(new DumperOptions()); dumpModuleSettings: CustomClassLoaderConstructor constructor = new CustomClassLoaderConstructor(ModulesSettings.class.getClassLoader(), new LoaderOptions());

GameboxYmlBuilder: CustomClassLoaderConstructor constructor = new CustomClassLoaderConstructor(LocalModuleData.class.getClassLoader(), new LoaderOptions()); Representer representer = new Representer(new DumperOptions());

NiklasEi commented 8 months ago

Thanks for looking into it!

I actually fixed all your class loading issues

Does that build and run for you? I get a bunch of errors including some like this:

[ERROR] /home/niklas/code/gamebox/src/main/java/me/nikl/gamebox/module/ModulesManager.java:[136,35] constructor Representer in class org.yaml.snakeyaml.representer.Representer cannot be applied to given types;
[ERROR]   required: no arguments
[ERROR]   found:    org.yaml.snakeyaml.DumperOptions
[ERROR]   reason: actual and formal argument lists differ in length

made a work around for your missing nmsutil class - I've made a local port of that one.

The nmsutilities are hosted here: https://repo.repsy.io/mvn/nikl/minecraft/me/nikl/nmsutilities/

KyreusR commented 8 months ago

Did you downgrade snakeyaml again? The older version didn't expect any arguments on that call. The newer one wants the DumperOptions. - I actually didn't look much into it, just gave it empty "LoadOptions" and "DumperOptions" where asked for. Not sure if this will work with the running plugin, but I can't test it due to ssl errors. Are your .pem files still up to date? Or are newer ones available?

Regarding your nmsutilities - I've created a PR for 1.20.2

InjectedPie commented 8 months ago

did you update your pom ? forgot to upload them sorry https://github.com/InjectedPie/gamebox/commit/1b5eb4c9a1158ae23cf6fd6ea325c3105f72beca

NiklasEi commented 8 months ago

Ah, you depend on the newest spigot now, then snakeyaml V2 makes sense. I tried to install it manually to stay compatible with older versions, but didn't manage to get that to work.