Crash with Destroy
Alcates opened this issue ยท 2 comments
Crash report: https://pastebin.com/34PGrPSq
Minecraft 1.20.1
Forge 47.4.0
TFMG 0.9.3
Destroy 0.1.1
The game crashes upon trying to place a fluid pipe. This includes TFMG pipe variants. Interestingly enough, what I assume is the same issue triggers immediately on world join if Apotheosis is also installed. Steps to reproduce are to install these mods and try to place a pipe, and expected behavior is a placed pipe. Here's the crash with Apotheosis if it helps: https://pastebin.com/VL2mwXiU
Destroy mixins into Create's FluidPropagator and uses @Redirect to allow propagateChangedPipe to check for its pipe block as well.
TFMG also mixins into that class, but uses @Overwrite to replace the entire method, despite only changing the one check that Destroy adds on to... this is very bad practice.
The entirety of TFMG's FluidPropagatorMixin.class should be replaced with something like this:
@Mixin(value = FluidPropagator.class, remap = false)
public class FluidPropagatorMixin {
@WrapOperation(method = "propagateChangedPipe(Lnet/minecraft/world/level/LevelAccessor;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;)V", at = @At(value = "INVOKE", target = "Lcom/tterrag/registrate/util/entry/BlockEntry;has(Lnet/minecraft/world/level/block/state/BlockState;)Z"))
private static boolean propagateChangedPipe$checkTFMGPumps(BlockEntry<PumpBlock> instance, BlockState targetState, Operation<Boolean> original) {
return original.call(instance, targetState) || TFMGPipes.ALUMINUM_MECHANICAL_PUMP.has(targetState) || TFMGPipes.BRASS_MECHANICAL_PUMP.has(targetState) || TFMGPipes.CAST_IRON_MECHANICAL_PUMP.has(targetState) || TFMGPipes.PLASTIC_MECHANICAL_PUMP.has(targetState) || TFMGPipes.STEEL_MECHANICAL_PUMP.has(targetState);
}
}@Redirect might also be an option if MixinExtras isn't available (as Destroy uses), but it's less compatible with other mods when used improperly.