Lithium 0.9.0 hopper optimization may cause NPE with other mods
Fallen-Breath opened this issue ยท 1 comments
Instructions
The following @ModifyVariable
sets the booleanSupplier
variable to null, causing mods accessing this variable throwing NPE after this @ModifyVariable
And the variable being null is only used in the following injection
Example
Example compatibility issue with Carpet-TIS-Addition mod
TISUnion/Carpet-TIS-Addition#81
Reproduced by
- Minecraft version:
1.19.2
- Fabric Carpet version:
1.4.83
- Carpet TIS Addition version:
1.40.1
- Lithium version:
0.9.1
Mixined classes:
// net.minecraft.block.entity.HopperBlockEntity#insertAndExtract
// ....
booleanSupplier = localvar$bod000$rememberBranch(booleanSupplier); // <-- lithium sets booleanSupplier to null
if (bl) {
blockEntity.setTransferCooldown(8);
handler$bdd000$doHopperCountersUnlimitedSpeed(world, pos, state, blockEntity, booleanSupplier, (CallbackInfoReturnable)null); // <-- NPE
markDirty(world, pos, state);
return true;
}
}
handler$bod000$sleepIfBranchNotRemembered(world, pos, state, blockEntity, booleanSupplier, (CallbackInfoReturnable)null);
return false;
64078c5 should fix this