OrderedChaos-Dev / ProjectVibrantJourneys

Minecraft mod that expands in all directions
37 stars 15 forks source link

Rocks replacing log #203

Closed KostromDan closed 4 months ago

KostromDan commented 1 year ago

image This looks ugly.

KostromDan commented 1 year ago

image

OrderedChaos-Dev commented 4 months ago

At one point I fixed this, no idea what version though. But closing as stale

KostromDan commented 1 week ago

@OrderedChaos-Dev On 1.19.2, it is still not fixed. I assume it's because 1.19.2 has been abandoned. Can you specify which commit fixed it, so I can backport the patch via datapack, mixins, or a PR? This is an important issue for my modpack.

KostromDan commented 6 days ago

Done:

@Mixin(RocksGroundcoverFeature.class)
public class RocksGroundcoverFeatureMixin {
    @Inject(
            at = @At("HEAD"),
            method = "place",
            cancellable = true
    )
    private void beforePlace(FeaturePlaceContext<RandomPatchConfiguration> context, CallbackInfoReturnable<Boolean> cir) {
        BlockPos origin = context.origin();
        WorldGenLevel level = context.level();
        BlockState originState = level.getBlockState(origin);
        if (!originState.getMaterial().isReplaceable() && !level.isEmptyBlock(origin)) {
            cir.setReturnValue(false);
            cir.cancel();
        }
    }
}