dumbo-the-developer / Duels

12 stars 10 forks source link

1.20.6 Cannot invoke "java.lang.Class.getName()" because "clazz" is null #56

Open scorninpc opened 2 days ago

scorninpc commented 2 days ago

Server version

Paper 1.20.6 build 151

Duels version

dev buiild

Plugin list

Duels-Optimised-1.9, PlugManX-2.4.1

Describe the bug

Cannot start plugin, with error:

[16:47:55 INFO]: [Duels] org.bukkit.craftbukkit.craftbukkit.inventory.CraftInventory
[16:47:55 ERROR]: Error occurred while enabling Duels v1.9 (Is it up to date?)
java.lang.ExceptionInInitializerError: null
    at Duels-Optimised-1.9.jar/com.meteordevelopments.duels.util.gui.MultiPageGui$PageNode.setTitle(MultiPageGui.java:229) ~[Duels-Optimised-1.9.jar:?]
    at Duels-Optimised-1.9.jar/com.meteordevelopments.duels.util.gui.MultiPageGui.calculatePages(MultiPageGui.java:102) ~[Duels-Optimised-1.9.jar:?]
    at Duels-Optimised-1.9.jar/com.meteordevelopments.duels.kit.KitManagerImpl.handleLoad(KitManagerImpl.java:85) ~[Duels-Optimised-1.9.jar:?]
    at Duels-Optimised-1.9.jar/com.meteordevelopments.duels.DuelsPlugin.load(DuelsPlugin.java:230) ~[Duels-Optimised-1.9.jar:?]
    at Duels-Optimised-1.9.jar/com.meteordevelopments.duels.DuelsPlugin.onEnable(DuelsPlugin.java:165) ~[Duels-Optimised-1.9.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:288) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
    at io.papermc.paper.plugin.manager.PaperPluginInstanceManager.enablePlugin(PaperPluginInstanceManager.java:202) ~[paper-1.20.6.jar:1.20.6-151-a4f0f5c]
    at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[paper-1.20.6.jar:1.20.6-151-a4f0f5c]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:520) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:626) ~[paper-1.20.6.jar:1.20.6-151-a4f0f5c]
    at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:575) ~[paper-1.20.6.jar:1.20.6-151-a4f0f5c]
    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:675) ~[paper-1.20.6.jar:1.20.6-151-a4f0f5c]
    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:437) ~[paper-1.20.6.jar:1.20.6-151-a4f0f5c]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:323) ~[paper-1.20.6.jar:1.20.6-151-a4f0f5c]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1136) ~[paper-1.20.6.jar:1.20.6-151-a4f0f5c]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[paper-1.20.6.jar:1.20.6-151-a4f0f5c]
    at java.base/java.lang.Thread.run(Thread.java:1570) ~[?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Class.getName()" because "clazz" is null
    at io.papermc.paper.pluginremap.reflect.PaperReflection.mapDeclaredFieldName(PaperReflection.java:77) ~[paper-1.20.6.jar:1.20.6-151-a4f0f5c]
    at io.papermc.reflectionrewriter.runtime.AbstractDefaultRulesReflectionProxy.getDeclaredField(AbstractDefaultRulesReflectionProxy.java:90) ~[reflection-rewriter-runtime-0.0.1.jar:?]
    at io.papermc.paper.pluginremap.reflect.PaperReflectionHolder.getDeclaredField(Unknown Source) ~[paper-1.20.6.jar:1.20.6-151-a4f0f5c]
    at Duels-Optimised-1.9.jar/com.meteordevelopments.duels.util.reflect.ReflectionUtil.getDeclaredField(ReflectionUtil.java:125) ~[Duels-Optimised-1.9.jar:?]
    at Duels-Optimised-1.9.jar/com.meteordevelopments.duels.util.compat.Inventories.<clinit>(Inventories.java:17) ~[Duels-Optimised-1.9.jar:?]
    ... 17 more
[16:47:55 INFO]: [Duels] Disabling Duels v1.9
[16:47:55 INFO]: [DuelsOptimised] Disable process took 3ms.

Expected behavior

server start

Steps to reproduce

Just start server only with Duels

Additional info

I know this is a old version, but slimefun can only run this version. Any info/advice wiill work, not problem with create my fork if break version. Start breaks on 1.20.6 build 67, 66 works fine

Checklist

scorninpc commented 1 day ago

Debuging i found the problem here https://github.com/dumbo-the-developer/Duels/blob/master/duels-plugin/src/main/java/com/meteordevelopments/duels/util/reflect/ReflectionUtil.java#L68:

image

I dont pull request, because I dont know how to verify the build of paper

For 1.20.6 build 66 or less, works fine. For 67 upper, need to pass to the IF