Oh The Biomes You'll Go Refabricated

Oh The Biomes You'll Go Refabricated

11M Downloads

[Fabric 1.16.x] BYG prevents trees from growing on vanilla dirt

coderbot16 opened this issue ยท 4 comments

commented

Since FeatureMixin always sets the return value, this means that when block == Blocks.DIRT, isSoil will end up returning false. Instead, It should check if the block is an instance of a BYG dirt block, and if so, set the return value to true. This avoids inadvertently changing an existing return value of true to false.

@Mixin(Feature.class)
public class FeatureMixin {
    @Inject(at = @At("RETURN"), method = "isSoil(Lnet/minecraft/block/Block;)Z", cancellable = true)
    private static void isDirt(Block block, CallbackInfoReturnable<Boolean> cir) {
-       cir.setReturnValue(block == BYGBlockList.GLOWCELIUM || block == BYGBlockList.PEAT ||
+       if (block == BYGBlockList.GLOWCELIUM || block == BYGBlockList.PEAT ||
               block == BYGBlockList.MEADOW_GRASSBLOCK || block == BYGBlockList.OVERGROWN_DACITE || block == BYGBlockList.OVERGROWN_STONE ||
               block == BYGBlockList.PODZOL_DACITE || block == BYGBlockList.OVERGROWN_NETHERRACK || block == BYGBlockList.SYTHIAN_NYLIUM ||
-               block == BYGBlockList.IVIS_PHYLIUM);
+               block == BYGBlockList.IVIS_PHYLIUM) {
+               cir.setReturnValue(true);
+       }
    }
}

The effect of this is most notable with Terrestria installed:

image

commented
commented

Ah good, thanks! I noticed that you committed the fix mere minutes before I finished my issue report :)