Hi! I'm trying to patch a mod im using for a game (not actually minecraft) to fix a crash. I dont really have any previous java experience, so I am not comfortable figuring out how to patch it from the outside at runtime (as in with a different .jar), so im using recaf to decompile the original mod, make changes, and recompile it.
It works fine, but there's a method that i need to change that doesnt get recompiled right, and i am not sure if there is a way to fix it or if its a limitation of the recompiling workflow. any help would be wondeful.
details:
The original mod imports ~.core.AbstractCreature and ~.character.AbstractPlayer from the vanilla game. Using the same decompiler on the game files itself, it seems that AbstractPlayer extends AbstractCreature
the line in question is
if (resourceDirectoryUrl != null && (__instance instanceof AbstractPlayer)) {
and the __instance in question is an argument of AbstractCreature; so by all accounts it should not be causing any problems
As far as i get it, my guess is that the recompiler, having no context for the imports, does not see the code as valid and fails with incompatible types, .AbstractCreature cannot be converted to .AbstractPlayer
Are there any realistic solutions to this? The tooling gives me the option to mess with the compiled java bytecode, but even if that's doable, seems like a poor idea.
I can remove the check in my patch entirely, and that seems to work without causing anything to break (maybe it wasnt necessary to begin with), but i would prefer to keep the original code without changes in the parts that dont need fixing.
are there any options i might be missing?
feel free to ask for more info (unless im asleep)