TerraformersMC / Terrestria

A Fabric mod enhancing the detail of Minecraft with unique and vibrant biomes. Inspired by ExtrabiomesXL.
https://www.curseforge.com/minecraft/mc-mods/terrestria
GNU Lesser General Public License v3.0
199 stars 43 forks source link

Incomptability with Paradise Lost. #289

Closed Baconbacon123 closed 1 year ago

Baconbacon123 commented 1 year ago

Fails to launch when used with https://github.com/devs-immortal/Paradise-Lost. This is the error message: image

gniftygnome commented 1 year ago

Paradise Lost uses MoreTags and MoreTags does this:

@Mixin(CropBlock.class)
public abstract class CropBlockMixin {
    @Redirect(
        method = "getAvailableMoisture",
        at = @At(
            value = "INVOKE",
            target = "Lnet/minecraft/block/BlockState;isOf(Lnet/minecraft/block/Block;)Z"
        ),
        slice = @Slice(
            from = @At("HEAD"),
            to = @At(
                value = "INVOKE",
                target = "Lnet/minecraft/block/BlockState;get(Lnet/minecraft/state/property/Property;)Ljava/lang/Comparable;"
            )
        )
    )
    private static boolean isBlockFarmland(BlockState blockState, Block block) {
        return blockState.isIn(MoreBlockTags.FARMLAND);
    }

This is probably actually a conflict with Terraform API.

gniftygnome commented 1 year ago

Yes, definitely. Terraform API does this:

@Mixin(CropBlock.class)
public class MixinCropBlock {
    @Redirect(method = "Lnet/minecraft/block/CropBlock;getAvailableMoisture(Lnet/minecraft/block/Block;Lnet/minecraft/world/BlockView;Lnet/minecraft/util/math/BlockPos;)F", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;isOf(Lnet/minecraft/block/Block;)Z"))
    private static boolean onGetAvailableMoisture(BlockState state, Block block) {
        return state.isOf(block) || (block == Blocks.FARMLAND && state.isIn(TerraformDirtBlockTags.FARMLAND));
    }
}
gniftygnome commented 1 year ago

Resolved in our 1.19.4 versions, in the sense it will no longer crash. If Paradise Lost's mixin is not compatible with ours, Terrestria's Andisol Farmland may fail to work correctly when both mods are loaded.