
Spamming Error while using optimized fork
PanHaskins opened this issue ยท 2 comments
I've tried the CanvasMC fork, and everything works properly only this little error that spams. The author referred me to you not to use this method, it is deprecated and to use something else instead. I didn't really understand it. I know that nothing besides Bukkit and Spigot is supported but I don't think this is somehow hard to modify.
[19:53:37] [WARN]: [Shopkeepers] Task #318 for Shopkeepers v2.23.3 generated an exception
java.lang.NoSuchMethodError: 'void net.minecraft.world.entity.ai.goal.GoalSelector.a()'
at Shopkeepers-2.23.3-1742151145070.jar/com.nisovin.shopkeepers.compat.v1_21_R4.NMSHandler.tickAI(NMSHandler.java:111) ~[Shopkeepers-2.23.3-1742151145070.jar:?]
at Shopkeepers-2.23.3-1742151145070.jar/com.nisovin.shopkeepers.shopobjects.living.SKLivingShopObject.tickAI(SKLivingShopObject.java:772) ~[Shopkeepers-2.23.3-1742151145070.jar:?]
at Shopkeepers-2.23.3-1742151145070.jar/com.nisovin.shopkeepers.shopobjects.living.LivingEntityAI.processAI(LivingEntityAI.java:720) ~[Shopkeepers-2.23.3-1742151145070.jar:?]
at Shopkeepers-2.23.3-1742151145070.jar/com.nisovin.shopkeepers.shopobjects.living.LivingEntityAI.processEntity(LivingEntityAI.java:612) ~[Shopkeepers-2.23.3-1742151145070.jar:?]
at java.base/java.util.ArrayList.forEach(ArrayList.java:1597) ~[?:?]
at Shopkeepers-2.23.3-1742151145070.jar/com.nisovin.shopkeepers.shopobjects.living.LivingEntityAI.processEntities(LivingEntityAI.java:573) ~[Shopkeepers-2.23.3-1742151145070.jar:?]
at java.base/java.util.LinkedHashMap$LinkedValues.forEach(LinkedHashMap.java:833) ~[?:?]
at Shopkeepers-2.23.3-1742151145070.jar/com.nisovin.shopkeepers.shopobjects.living.LivingEntityAI.processEntities(LivingEntityAI.java:563) ~[Shopkeepers-2.23.3-1742151145070.jar:?]
at Shopkeepers-2.23.3-1742151145070.jar/com.nisovin.shopkeepers.shopobjects.living.LivingEntityAI$TickTask.run(LivingEntityAI.java:419) ~[Shopkeepers-2.23.3-1742151145070.jar:?]
at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:78) ~[canvas-1.21.4.jar:1.21.4-230-a9bb099]
at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:474) ~[canvas-1.21.4.jar:1.21.4-230-a9bb099]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1968) ~[canvas-1.21.4.jar:1.21.4-230-a9bb099]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1825) ~[canvas-1.21.4.jar:1.21.4-230-a9bb099]
at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:1522) ~[canvas-1.21.4.jar:1.21.4-230-a9bb099]
at io.canvasmc.canvas.server.ThreadedServer.spin(ThreadedServer.java:138) ~[canvas-1.21.4.jar:1.21.4-230-a9bb099]
at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:356) ~[canvas-1.21.4.jar:1.21.4-230-a9bb099]
at java.base/java.lang.Thread.run(Thread.java:1570) ~[?:?]
was just informed abt this, ill work on fixing the incompatibility later. i was just thinking since it was an obfuscated name that it may not work. my mistake, ill fix this in a few hours (for context, im the canvas dev)
I am not sure what they are referring to, but ticking the AI goal selector to update its active goals and then tick those is also what the standard Minecraft mobs themselves invoke during their AI ticking step. Hence why the shopkeepers plugin is also using this, because I want to simulate this particular AI ticking step, while still having the entities be tagged and behave as "no-ai" otherwise. I am basically disabling the default AI and running only this particular function in the same way the mobs would usually do it.
Regarding this not working on this particular server fork: The Shopkeepers plugin only supports Spigot and the respective Spigot mappings of the Minecraft server. So if this fork is removing or renaming Minecraft server methods that exist on a Spigot server and are required by the Shopkeepers plugin, the plugin will not work and you are out of luck: I will only look into issues affecting the Spigot server, and to some degree the Paper server since it is the most popular fork.
In this particular case, it seems like the CanvasMC fork has intentionally decided to change the method signature of the tick function to accept a new parameter: https://github.com/CraftCanvasMC/Canvas/blob/master/canvas-server/minecraft-patches/sources/net/minecraft/world/entity/ai/goal/GoalSelector.java.patch#L37
Maybe one option, if they were to desire compatibility with the Shopkeepers plugin, would be to preserve the original method signature in addition to their new one. Actually, I am not even sure why they have changed this method signature, since they are not using the tickCount
argument inside the method.
And neither Purpur nor the Paper server that this fork is based on contain this change to the method signature.