tanyaofei / minecraft-fakeplayer

A plugin for minecraft server to spawn fake players, inspired by Carpet Mod
Apache License 2.0
103 stars 13 forks source link

IllegalArgumentException: Unsupported class file major version 65 #68

Closed IllTamer closed 3 months ago

IllTamer commented 3 months ago

Describe the bug / 描述你的 bug 情况 当使用 1.20.1 版本核心并使用 jre 21 加载插件时,插件初始化时报错。经查阅,疑似asm版本问题

https://stackoverflow.com/questions/77165413/parboiled-under-java-21-unsupported-class-file-major-version-65

[21:27:31 ERROR]: Fatal error trying to convert fakeplayer v0.3.7:io/github/hello09x/fakeplayer/core/Main.class
java.lang.IllegalArgumentException: Unsupported class file major version 65
        at org.objectweb.asm.ClassReader.<init>(ClassReader.java:199) ~[asm-9.4.jar:9.4]
        at org.objectweb.asm.ClassReader.<init>(ClassReader.java:180) ~[asm-9.4.jar:9.4]
        at org.objectweb.asm.ClassReader.<init>(ClassReader.java:166) ~[asm-9.4.jar:9.4]
        at org.bukkit.craftbukkit.v1_20_R1.util.Commodore.convert(Commodore.java:171) ~[pufferfish-1.20.1.jar:git-Pufferfish-19]
        at org.bukkit.craftbukkit.v1_20_R1.util.CraftMagicNumbers.processClass(CraftMagicNumbers.java:403) ~[pufferfish-1.20.1.jar:git-Pufferfish-19]
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:209) ~[pufferfish-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:592) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:157) ~[pufferfish-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:152) ~[pufferfish-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?]
        at java.lang.Class.forName0(Native Method) ~[?:?]
        at java.lang.Class.forName(Class.java:529) ~[?:?]
        at java.lang.Class.forName(Class.java:508) ~[?:?]
        at org.bukkit.plugin.java.PluginClassLoader.<init>(PluginClassLoader.java:78) ~[pufferfish-api-1.20.1-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:123) ~[pufferfish-1.20.1.jar:git-Pufferfish-19]
        at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[pufferfish-1.20.1.jar:git-Pufferfish-19]
        at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[pufferfish-1.20.1.jar:git-Pufferfish-19]
        at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:39) ~[pufferfish-1.20.1.jar:git-Pufferfish-19]
        at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[pufferfish-1.20.1.jar:git-Pufferfish-19]
        at org.bukkit.craftbukkit.v1_20_R1.CraftServer.loadPlugins(CraftServer.java:507) ~[pufferfish-1.20.1.jar:git-Pufferfish-19]
        at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:275) ~[pufferfish-1.20.1.jar:git-Pufferfish-19]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1103) ~[pufferfish-1.20.1.jar:git-Pufferfish-19]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[pufferfish-1.20.1.jar:git-Pufferfish-19]
        at java.lang.Thread.run(Thread.java:1570) ~[?:?]

Server information / 服务器信息

IllTamer commented 3 months ago

已确认是 9.4 版本 asm 依赖问题, 与插件无关 https://github.com/spotbugs/spotbugs/issues/2567

tanyaofei commented 3 months ago

已确认是 9.4 版本 asm 依赖问题, 与插件无关 spotbugs/spotbugs#2567

试一下升级到 0.3.8-rc.1 ,我用 jdk 17 来编译 1.20.x 版本的相关模块了