Closed KryptonCaptain closed 7 years ago
Looks like CubesEdge is completely overwriting all of ItemRenderer.renderItemFirstPerson
's instructions, which is not something that AppleCore can handle.
One thing you could try is changing this line in CE to:
mn.instructions.insertBefore(findFirstInstruction(mn), newList);
and add this method to the ItemRendererTransformer class:
private AbstractInsnNode findFirstInstruction(MethodNode method)
{
for (AbstractInsnNode instruction = method.instructions.getFirst(); instruction != null; instruction = instruction.getNext())
{
if (instruction.getType() != AbstractInsnNode.LABEL && instruction.getType() != AbstractInsnNode.LINE)
return instruction;
}
return null;
}
That will make it so that CE only adds its hook to the top of the method and then returns early, while still leaving the (now unused) original instructions in place for AppleCore to modify (but note that AppleCore's modifications won't have any affect, so the eating speed animation will be a little weird if you have any mods that modify that [The Spice of Life/Hunger Overhaul]).
There is the possibility of this messing up the frames/maxes, so if you get any errors related to that, you can try also changing this line to:
ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
First two suggestions worked as probably intended. Testing it with HO, I noticed that food will vanish for a couple of frames when player initially begin eating it, then reappear for the rest of the animation, to presumably conclude at the same time as the event. Didn't seem to affect any animations in CE.
So I subbed in the third line to see if that would fix it, but that just produced the same initial crash
In that case, you should just go with the first two. That's as good as it's going to get without much more complicated integration.
Thanks for the help with this, much appreciated.
So, after getting a custom build of Cube's Edge running, I dropped it into my test instance only to find that it (not my code) and this mod are both doing an ASM on the vanilla ItemRenderer, and that's causing problems. Any ideas or suggestions? I wouldn't even know where to start trying to fix this on CE's end, and it hasn't really seen any activity in a while - so I'm hoping you can help.