[bug] NullPointerException when calling ItemStack#areTagsEqual
deirn opened this issue ยท 1 comments
Version
Minecraft: 1.16.5
NBT Crafting: 2.0.4
Describe the bug
It appears that your injects to ItemStack has wrong ordinal value
It looks like it's correct in code, but the bytecode says otherwise :P.
You can see it get injected on wrong place when you export the mixin
public static boolean areTagsEqual(ItemStack left, ItemStack right) {
if (left.isEmpty() && right.isEmpty()) {
return true;
} else if (!left.isEmpty() && !right.isEmpty()) {
if (left.tag == null && right.tag != null) {
CallbackInfoReturnable callbackInfo3 = false;
CallbackInfoReturnable callbackInfo3 = new CallbackInfoReturnable("areTagsEqual", true, callbackInfo3);
handler$zbc000$areTagsEqualReturn2(left, right, callbackInfo3);
return callbackInfo3.isCancelled() ? callbackInfo3.getReturnValueZ() : false;
} else {
return left.tag == null || left.tag.equals(right.tag);
}
} else {
CallbackInfoReturnable callbackInfo2 = false;
CallbackInfoReturnable callbackInfo2 = new CallbackInfoReturnable("areTagsEqual", true, callbackInfo2);
handler$zbc000$areTagsEqualReturn1(left, right, callbackInfo2);
return callbackInfo2.isCancelled() ? callbackInfo2.getReturnValueZ() : false;
}
}
This can cause a NullPointerException
when it hits areTagsEqualReturn1
.
Additional context
Related: badasintended/slotlink#71