NamelessMC / Nameless-Plugin

Official NamelessMC server plugin
https://spigotmc.org/resources/nameless-plugin-for-v2.59032/
GNU General Public License v3.0
42 stars 27 forks source link

Fails to register commands on server implementations other than CraftBukkit #338

Open jakesullyneytiri opened 1 year ago

jakesullyneytiri commented 1 year ago

Hi

I'm having trouble with version 3.4.0 it keeps throwing following error on loading:

[21:31:10] [Server thread/FATAL]: Error occurred while enabling NamelessMC v3.4.0 (Is it up to date?) java.lang.NoClassDefFoundError: net/kyori/adventure/text/minimessage/MiniMessage at com.namelessmc.plugin.common.LanguageHandler.get(LanguageHandler.java:228) ~[?:?] at com.namelessmc.plugin.common.command.CommonCommand.description(CommonCommand.java:53) ~[?:?] at com.namelessmc.plugin.bukkit.BukkitCommandProxy.lambda$registerCommands$0(BukkitCommandProxy.java:34) ~[?:?] at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] at com.namelessmc.plugin.bukkit.BukkitCommandProxy.registerCommands(BukkitCommandProxy.java:27) ~[?:?] at com.namelessmc.plugin.bukkit.BukkitNamelessPlugin.onEnable(BukkitNamelessPlugin.java:54) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:257) ~[Cardboard-1.19.2.jar:?] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:309) ~[Cardboard-1.19.2.jar:?] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[paper-api-1.17-dev.jar:?] at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:492) ~[Cardboard-1.19.2.jar:?] at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:422) ~[Cardboard-1.19.2.jar:?] at net.minecraft.server.MinecraftServer.handler$zep000$cardboard$afterWorldLoad(MinecraftServer.java:2933) ~[server-intermediary.jar:?] at net.minecraft.server.MinecraftServer.method_3735(MinecraftServer.java:330) ~[server-intermediary.jar:?] at net.minecraft.class_3176.method_3823(class_3176.java:172) ~[server-intermediary.jar:?] at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:636) ~[server-intermediary.jar:?] at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:257) ~[server-intermediary.jar:?] at java.lang.Thread.run(Thread.java:833) [?:?]

I have tried paper, spigot, but none of them works.

I'm currently running fabric minecraft version 1.19.2 with https://www.curseforge.com/minecraft/mc-mods/cardboard so i can run mods with plugins from bukkit, spigot and paper.

acording to the debug plugin seems to ping to the API and getting response but when i try typing any commands in the server i get that commands are unknown. So it seems plugin hasn't loaded properly and i hope you have a fix for this!

Derkades commented 1 year ago

I assume the error you posted here occurred when using the paper jar? Can you send the error that occurs with the spigot jar?

jakesullyneytiri commented 1 year ago

Yes error above waas from paper plugin.

Here is error code from spigot plugin

[13:10:19] [Server thread/FATAL]: Error occurred while enabling NamelessMC v3.4.0 (Is it up to date?) java.lang.NoSuchMethodError: 'org.bukkit.plugin.java.JavaPlugin org.bukkit.plugin.java.PluginClassLoader.getPlugin()' at co.aikar.timings.TimingsManager.getPluginByClassloader(TimingsManager.java:184) ~[paper-api-1.17-dev.jar:?] at co.aikar.timings.TimingsManager.getCommandTiming(TimingsManager.java:160) ~[paper-api-1.17-dev.jar:?] at org.bukkit.command.SimpleCommandMap.register(SimpleCommandMap.java:73) ~[paper-api-1.17-dev.jar:?] at org.bukkit.command.SimpleCommandMap.register(SimpleCommandMap.java:65) ~[paper-api-1.17-dev.jar:?] at com.namelessmc.plugin.lib.derkutils.bukkit.reflection.ReflectionUtil.registerCommand(ReflectionUtil.java:105) ~[?:?] at com.namelessmc.plugin.bukkit.BukkitCommandProxy.lambda$registerCommands$0(BukkitCommandProxy.java:39) ~[?:?] at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] at com.namelessmc.plugin.bukkit.BukkitCommandProxy.registerCommands(BukkitCommandProxy.java:27) ~[?:?] at com.namelessmc.plugin.bukkit.BukkitNamelessPlugin.onEnable(BukkitNamelessPlugin.java:54) ~[?:?] at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:257) ~[Cardboard-1.19.2.jar:?] at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:309) ~[Cardboard-1.19.2.jar:?] at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:500) ~[paper-api-1.17-dev.jar:?] at org.bukkit.craftbukkit.CraftServer.enablePlugin(CraftServer.java:492) ~[Cardboard-1.19.2.jar:?] at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:422) ~[Cardboard-1.19.2.jar:?] at net.minecraft.server.MinecraftServer.handler$zep000$cardboard$afterWorldLoad(MinecraftServer.java:2933) ~[server-intermediary.jar:?] at net.minecraft.server.MinecraftServer.method_3735(MinecraftServer.java:330) ~[server-intermediary.jar:?] at net.minecraft.class_3176.method_3823(class_3176.java:172) ~[server-intermediary.jar:?] at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:636) ~[server-intermediary.jar:?] at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:257) ~[server-intermediary.jar:?] at java.lang.Thread.run(Thread.java:833) [?:?]

But i think i just found out cause of error just now, i noticed i'm using paper-api for mc 1.17 apparently, there i one that is 1.19.4 so i will see if i can find one for 1.19.2 and try with that and if that fixes it then there was no problem with nameless plugin after all, just me using wrong plugin version of the paper-api.

Well i couldn't get any newer api so i will see if this actually is cause of it or plugin itself is cause.

Derkades commented 1 year ago

It appears that Cardboard does not support our way of registering commands. To be fair, we don't use the proper API (declaring commands in plugin.yml) but access a hidden field (commandMap in CraftServer). This is not Bukkit API but a CraftBukkit implementation detail, so it makes sense that Cardboard breaks in this case. You can ask if the developers want to "fix" this, but I totally understand if they don't.

The reason for using the unofficial way of registering commands is so commands can be changed or disabled in commands.yaml.