OldCombatMechanics

OldCombatMechanics

46.1k Downloads

Recipe error running on 1.16.1

DerLinkman opened this issue · 14 comments

commented

Hello there,

this Error occures when i start the 1.16.1 server with the latest version of your plugin.

[17:15:27] [Server thread/INFO]: [OldCombatMechanics] Enabling OldCombatMechanics v1.8.0,
[17:15:27] [Server thread/INFO]: [OldCombatMechanics] Config file config.yml generated,
[17:15:27] [Server thread/ERROR]: Error occurred while enabling OldCombatMechanics v1.8.0 (Is it up to date?),
java.lang.AbstractMethodError: Method net/minecraft/server/v1_16_R1/RecipeSmithing.toBukkitRecipe()Lorg/bukkit/inventory/Recipe; is abstract,
	at org.bukkit.craftbukkit.v1_16_R1.inventory.RecipeIterator.next(RecipeIterator.java:1) ~[spigot_server-1.16.1.jar:git-Spigot-758abbe-2b00831],
	at org.bukkit.craftbukkit.v1_16_R1.inventory.RecipeIterator.next(RecipeIterator.java:31) ~[spigot_server-1.16.1.jar:git-Spigot-758abbe-2b00831],
	at net.minecraft.server.v1_16_R1.RecipeSmithing.toBukkitRecipe(SourceFile) ~[spigot_server-1.16.1.jar:git-Spigot-758abbe-2b00831],
	at org.bukkit.craftbukkit.v1_16_R1.CraftServer.getRecipesFor(CraftServer.java:1200) ~[spigot_server-1.16.1.jar:git-Spigot-758abbe-2b00831],
	at org.bukkit.Bukkit.getRecipesFor(Bukkit.java:695) ~[spigot_server-1.16.1.jar:git-Spigot-758abbe-2b00831],
	at kernitus.plugin.OldCombatMechanics.module.ModuleGoldenApple.registerCrafting(ModuleGoldenApple.java:72) ~[?:?],
	at kernitus.plugin.OldCombatMechanics.module.ModuleGoldenApple.reload(ModuleGoldenApple.java:67) ~[?:?],
	at kernitus.plugin.OldCombatMechanics.utilities.Config.lambda$reload$0(Config.java:83) ~[?:?],
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184) ~[?:1.8.0_212],
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175) ~[?:1.8.0_212],
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1382) ~[?:1.8.0_212],
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) ~[?:1.8.0_212],
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) ~[?:1.8.0_212],
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) ~[?:1.8.0_212],
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472) ~[?:1.8.0_212],
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482) ~[?:1.8.0_212],
	at kernitus.plugin.OldCombatMechanics.utilities.Config.initialise(Config.java:33) ~[?:?],
	at kernitus.plugin.OldCombatMechanics.utilities.Config.reload(Config.java:81) ~[?:?],
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) ~[?:1.8.0_212],
	at kernitus.plugin.OldCombatMechanics.OCMMain.onEnable(OCMMain.java:70) ~[?:?],
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot_server-1.16.1.jar:git-Spigot-758abbe-2b00831],
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot_server-1.16.1.jar:git-Spigot-758abbe-2b00831],
	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:351) ~[spigot_server-1.16.1.jar:git-Spigot-758abbe-2b00831],
	at org.bukkit.craftbukkit.v1_16_R1.CraftServer.enablePlugin(CraftServer.java:488) ~[spigot_server-1.16.1.jar:git-Spigot-758abbe-2b00831],
	at org.bukkit.craftbukkit.v1_16_R1.CraftServer.enablePlugins(CraftServer.java:402) ~[spigot_server-1.16.1.jar:git-Spigot-758abbe-2b00831],
	at net.minecraft.server.v1_16_R1.MinecraftServer.loadWorld(MinecraftServer.java:436) ~[spigot_server-1.16.1.jar:git-Spigot-758abbe-2b00831],
	at net.minecraft.server.v1_16_R1.DedicatedServer.init(DedicatedServer.java:219) ~[spigot_server-1.16.1.jar:git-Spigot-758abbe-2b00831],
	at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:808) ~[spigot_server-1.16.1.jar:git-Spigot-758abbe-2b00831],
	at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot_server-1.16.1.jar:git-Spigot-758abbe-2b00831],
	at java.lang.Thread.run(Thread.java:748) [?:1.8.0_212]
commented

Please try dev build 27 and see if you still have the issue. I am currently running that locally with just Spigot 1.16.1 + latest dev build of OCM, and cannot reproduce the issue.

commented

On a side note, if it continues to not work after using the latest dev build (27), my suspicion is that one of your plugins might have actually been compiled with the Bukkit API bundled with it (sometimes this happens if people forget to set <scope>provided</scope> on the Bukkit API in their pom.xml file), which is causing an issue where one loaded Recipe class is an abstract class, while another loaded Recipe class is an interface.

Would be hard to prove this if it were the case, though. Probably would involve removing all plugins and adding back one at a time or cutting them out in halves to determine which plugin(s) have this issue.

commented

If you have find and zipinfo installed and are on linux, running

find -type f -iname "*.jar" -exec sh -c 'zipinfo "{}" | grep -E "org/bukkit/inventory/Recipe.class|Archive:"' \;

in the plugins dir should be enough to confirm that hypothesis.

commented

#409 Seems to be the same error.

commented

How should we fix it if this still happens with OCM being the only plugin aside from spigot?

commented

Oh, yes you are right! The error is gone after i used the latest Spigot Version. Strange

commented

Well, the new Netherite Weapons still have the damage from the cooldown (if i spam them)

commented

@DerLinkman just to clarify, was upgrading to the latest spigot version or the latest OCM version the fix? also I'm not sure what you mean by their "original" values, there are no old damage values to change them to since they are brand new in 1.16 lol

commented

@spoduminister you are able to reproduce this error with just Spigot 1.16 and the latest OCM? what about with OCM dev build 27, linked in the first comment on this issue?

commented

@rayzr522 Yes, when running it with just Spigot 1.16.1 and OCM dev build 27, it gives the same error

commented

@rayzr522 Yes exactly!

commented

@rayzr522 First, yes for me the spigot upgrade removed the error.
Secondly, the netherite weapons don´t make the full damage when i hit an enemy (they make the same damage if i spam on a mob without the Plugin)

commented

@spoduminister make sure you are not using Spigot 1.16.1 from GetBukkit, build the latest Spigot 1.16.1 JAR yourself using BuildTools: instructions here

@DerLinkman I see. so just to make sure I understand, they are doing the same amount of damage as they normally would if you spammed faster than the attack cooldown allows? e.g. reduced damage?

commented

@DerLinkman if you believe there is an actual issue with Netherite weapons, please open a new bug report for that.