WiIIiam278 / HuskHomes

The powerful & intuitive homes, warps, and teleportation suite
https://william278.net/project/huskhomes
Apache License 2.0
127 stars 77 forks source link

HuskHomes overwrites server's Kyori Adventure implementation. #673

Closed SzczurekYT closed 2 months ago

SzczurekYT commented 2 months ago

It seems that by shading the adventure api and legacy bukkit adapter HuskHomes "overwrites" the paper's adventure implementation for other plugins. This causes other plugins to use HuskHomes implementation instead of the native one. This obviously isn't good, and in my case this breaks another library I use for my plugins, which uses adventure under the hood. I'm not sure what's the proper fix here as it's kind of a complex situation, however it would be nice if HuskHomes didn't break my plugins 😄

Here is an example stacktrace of error that only happens with HuskHomes installed. Blacksmith is my plugin, and CommandAPI is - you guess it, a command library that dispatches the error causing code, which tries to open a gui, but fails when setting an item's name which invokes adventure.

Stacktrace ``` [14:52:09 ERROR]: [CommandAPI] Unhandled exception executing '/blacksmith' java.lang.ExceptionInInitializerError: null at Blacksmith-1.0.2.jar/yt.szczurek.blacksmith.BlacksmithCommand.lambda$register$1(BlacksmithCommand.java:31) ~[Blacksmith-1.0.2.jar:?] at CommandAPI-9.5.1-Mojang-Mapped.jar/dev.jorel.commandapi.executors.PlayerCommandExecutor.run(PlayerCommandExecutor.java:48) ~[CommandAPI-9.5.1-Mojang-Mapped.jar:?] at CommandAPI-9.5.1-Mojang-Mapped.jar/dev.jorel.commandapi.executors.NormalExecutor.executeWith(NormalExecutor.java:44) ~[CommandAPI-9.5.1-Mojang-Mapped.jar:?] at CommandAPI-9.5.1-Mojang-Mapped.jar/dev.jorel.commandapi.CommandAPIExecutor.execute(CommandAPIExecutor.java:137) ~[CommandAPI-9.5.1-Mojang-Mapped.jar:?] at CommandAPI-9.5.1-Mojang-Mapped.jar/dev.jorel.commandapi.CommandAPIExecutor.execute(CommandAPIExecutor.java:110) ~[CommandAPI-9.5.1-Mojang-Mapped.jar:?] at CommandAPI-9.5.1-Mojang-Mapped.jar/dev.jorel.commandapi.CommandAPIExecutor.execute(CommandAPIExecutor.java:91) ~[CommandAPI-9.5.1-Mojang-Mapped.jar:?] at CommandAPI-9.5.1-Mojang-Mapped.jar/dev.jorel.commandapi.CommandAPIHandler.lambda$generateCommand$0(CommandAPIHandler.java:261) ~[CommandAPI-9.5.1-Mojang-Mapped.jar:?] at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.2.9.jar:?] at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:31) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:19) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.execution.CommandQueueEntry.execute(CommandQueueEntry.java:5) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:103) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.Commands.executeCommandInContext(Commands.java:448) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.Commands.performCommand(Commands.java:355) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.Commands.performCommand(Commands.java:342) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.Commands.performCommand(Commands.java:337) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.network.ServerGamePacketListenerImpl.performUnsignedChatCommand(ServerGamePacketListenerImpl.java:2202) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$14(ServerGamePacketListenerImpl.java:2176) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1511) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:195) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1488) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1411) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1377) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1238) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] Caused by: java.lang.UnsupportedOperationException at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.MinecraftComponentSerializer.(MinecraftComponentSerializer.java:101) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.CraftBukkitFacet.(CraftBukkitFacet.java:186) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudience.lambda$static$1(BukkitAudience.java:48) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.facet.Facet.of(Facet.java:71) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudience.(BukkitAudience.java:44) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudiencesImpl.createAudience(BukkitAudiencesImpl.java:132) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudiencesImpl.createAudience(BukkitAudiencesImpl.java:74) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.facet.FacetAudienceProvider.lambda$addViewer$0(FacetAudienceProvider.java:112) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[?:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.facet.FacetAudienceProvider.addViewer(FacetAudienceProvider.java:110) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudiencesImpl.(BukkitAudiencesImpl.java:99) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudiencesImpl$Builder.lambda$build$1(BukkitAudiencesImpl.java:171) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1228) ~[?:?] at java.base/java.util.Collections$SynchronizedMap.computeIfAbsent(Collections.java:2980) ~[?:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudiencesImpl$Builder.build(BukkitAudiencesImpl.java:169) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudiencesImpl.instanceFor(BukkitAudiencesImpl.java:89) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudiences.create(BukkitAudiences.java:53) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.william278.huskhomes.BukkitHuskHomes.onEnable(BukkitHuskHomes.java:134) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.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-148-20f5165] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[paper-1.20.6.jar:1.20.6-148-20f5165] 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-148-20f5165] at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:575) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:675) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:437) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:323) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1136) ~[paper-1.20.6.jar:1.20.6-148-20f5165] ... 2 more at CommandAPI-9.5.1-Mojang-Mapped.jar/dev.jorel.commandapi.CommandAPIExecutor.execute(CommandAPIExecutor.java:91) ~[CommandAPI-9.5.1-Mojang-Mapped.jar:?] ... 26 more Caused by: java.lang.UnsupportedOperationException at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.MinecraftComponentSerializer.(MinecraftComponentSerializer.java:101) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.CraftBukkitFacet.(CraftBukkitFacet.java:186) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudience.lambda$static$1(BukkitAudience.java:48) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.facet.Facet.of(Facet.java:71) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudience.(BukkitAudience.java:44) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudiencesImpl.createAudience(BukkitAudiencesImpl.java:132) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudiencesImpl.createAudience(BukkitAudiencesImpl.java:74) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.facet.FacetAudienceProvider.lambda$addViewer$0(FacetAudienceProvider.java:112) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[?:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.facet.FacetAudienceProvider.addViewer(FacetAudienceProvider.java:110) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudiencesImpl.(BukkitAudiencesImpl.java:99) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudiencesImpl$Builder.lambda$build$1(BukkitAudiencesImpl.java:171) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at java.base/java.util.HashMap.computeIfAbsent(HashMap.java:1228) ~[?:?] at java.base/java.util.Collections$SynchronizedMap.computeIfAbsent(Collections.java:2980) ~[?:?] [14:52:09 ERROR]: Command exception: /blacksmith java.lang.RuntimeException: java.lang.ExceptionInInitializerError at CommandAPI-9.5.1-Mojang-Mapped.jar/dev.jorel.commandapi.CommandAPIExecutor.execute(CommandAPIExecutor.java:99) ~[CommandAPI-9.5.1-Mojang-Mapped.jar:?] at CommandAPI-9.5.1-Mojang-Mapped.jar/dev.jorel.commandapi.CommandAPIHandler.lambda$generateCommand$0(CommandAPIHandler.java:261) ~[CommandAPI-9.5.1-Mojang-Mapped.jar:?] at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.2.9.jar:?] at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:31) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:19) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.execution.CommandQueueEntry.execute(CommandQueueEntry.java:5) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:103) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.Commands.executeCommandInContext(Commands.java:448) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.Commands.performCommand(Commands.java:355) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.Commands.performCommand(Commands.java:342) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.commands.Commands.performCommand(Commands.java:337) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.network.ServerGamePacketListenerImpl.performUnsignedChatCommand(ServerGamePacketListenerImpl.java:2202) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$14(ServerGamePacketListenerImpl.java:2176) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:151) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1511) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:195) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:125) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1488) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1411) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:135) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1377) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1238) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] Caused by: java.lang.ExceptionInInitializerError at Blacksmith-1.0.2.jar/yt.szczurek.blacksmith.BlacksmithCommand.lambda$register$1(BlacksmithCommand.java:31) ~[Blacksmith-1.0.2.jar:?] at CommandAPI-9.5.1-Mojang-Mapped.jar/dev.jorel.commandapi.executors.PlayerCommandExecutor.run(PlayerCommandExecutor.java:48) ~[CommandAPI-9.5.1-Mojang-Mapped.jar:?] at CommandAPI-9.5.1-Mojang-Mapped.jar/dev.jorel.commandapi.executors.NormalExecutor.executeWith(NormalExecutor.java:44) ~[CommandAPI-9.5.1-Mojang-Mapped.jar:?] at CommandAPI-9.5.1-Mojang-Mapped.jar/dev.jorel.commandapi.CommandAPIExecutor.execute(CommandAPIExecutor.java:137) ~[CommandAPI-9.5.1-Mojang-Mapped.jar:?] at CommandAPI-9.5.1-Mojang-Mapped.jar/dev.jorel.commandapi.CommandAPIExecutor.execute(CommandAPIExecutor.java:110) ~[CommandAPI-9.5.1-Mojang-Mapped.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudiencesImpl$Builder.build(BukkitAudiencesImpl.java:169) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudiencesImpl.instanceFor(BukkitAudiencesImpl.java:89) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.kyori.adventure.platform.bukkit.BukkitAudiences.create(BukkitAudiences.java:53) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.jar:?] at HuskHomes-Paper-4.7.1-a90ff0a-indev.jar/net.william278.huskhomes.BukkitHuskHomes.onEnable(BukkitHuskHomes.java:134) ~[HuskHomes-Paper-4.7.1-a90ff0a-indev.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-148-20f5165] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.enablePlugin(PaperPluginManagerImpl.java:109) ~[paper-1.20.6.jar:1.20.6-148-20f5165] 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-148-20f5165] at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:575) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:675) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:437) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:323) ~[paper-1.20.6.jar:1.20.6-148-20f5165] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1136) ~[paper-1.20.6.jar:1.20.6-148-20f5165] ... 2 more ```
WiIIiam278 commented 2 months ago

We need to shade - but not relocate - the bukkit adventure adapter to support spigot (or else we're not allowed to list the plugin on SpigotMC.org). We simultaneously support Paper by using a paper plugin as an entry point and abstracting audience getter methods in the main plugin class. There is no scenario where this setup should break other plugins. Assuming CommandAPI targets paper, it should use native methods targeting paper; else shade the adapter itself. The adventure adapter shouldn't be relocated as this causes conflicts with paper's native unrelocated classes.

I suggest contacting the CommandAPI devs to enquire why this is rather than me. This isn't something I've heard reports of - and i certainly would have as I believe CommandAPI is popular - so make sure you're confident it's not a "you" problem first.

SzczurekYT commented 2 months ago

CommandAPI is just a man in the middle, and I added a comment about it so you know why there are other things in the stacktrace. What actually invokes adventure is ThriumpGui, a really nice gui library. What made me think it's a HuskHomes problem is the fact that the issue doesn't appear without HuskHomes and I saw HuskHomes in the stacktrace. I will try to dig some more, this time around the gui library, and I will let you know if I will find something.

SzczurekYT commented 2 months ago

So far I have found that, if I don't exclude kyori in my plugin and shadow it everything works correctly. Probably because the shadowed version takes priority. However why would I make my plugin jar almost 1mb bigger by doing that, when it works completely fine on vanilla paper without shadowing? But then if I drop in HuskHomes the non shadow version breaks, because hoskhomes kyori takes over. So I wouldn't say it's a "me" problem.

WiIIiam278 commented 2 months ago

If you're deploying a non-paper plugin that depends on adventure (native to paper) to a Paper server, it will be a "you" problem as the plugin is loaded as a spigot plugin which does not have an isolated class loader.

Either release a spigot plugin (plugin.yml) and shade adventure-platform-bukkit, or release as a paper plugin with a paper-plugin.yml.

SzczurekYT commented 2 months ago

If you're deploying a non-paper plugin that depends on adventure (native to paper) to a Paper server, it will be a "you" problem as the plugin is loaded as a spigot plugin which does not have an isolated class loader.

Either release a spigot plugin (plugin.yml) and shade adventure-platform-bukkit, or release as a paper plugin with a paper-plugin.yml.

Paper plugins are still marked as experimental and only supported from a certain version, so I used the normal plugin.yml while developing against paper. When using paper-plugin.yml I get no class found errors, so it's not an option for me as of now. But that's an issue in the gui library itself, not huskhomes. This is a complicated situation with no simple "best" solution I think, however now with yours comment I finally understand it properly, so thanks for that and sorry for taking your time.