All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.lukebemish.biomesquisher.surface.CheckFinder Maven / Gradle / Ivy

Go to download

Allows for injection of new biomes into Minecraft's biome parameter space by "squishing" existing biomes

The newest version!
package dev.lukebemish.biomesquisher.surface;

import com.mojang.serialization.MapCodec;
import dev.lukebemish.biomesquisher.impl.Utils;

public record CheckFinder(RulePredicate predicate) implements RuleFinder {
    public static final MapCodec CODEC = RulePredicate.CODEC.fieldOf("predicate").xmap(CheckFinder::new, CheckFinder::predicate);

    @Override
    public ModificationView find() {
        return (c, m, source) -> {
            if (predicate.matches(c, source)) {
                return m.apply(c, source);
            } else {
                Utils.LOGGER.warn("In surface rule modifier {} did not match predicate {}", c.modifierKey(), predicate);
            }
            return source;
        };
    }

    @Override
    public MapCodec codec() {
        return CODEC;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy