dev.lukebemish.biomesquisher.surface.NotPredicate Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of biomesquisher Show documentation
Show all versions of biomesquisher Show documentation
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 net.minecraft.world.level.levelgen.SurfaceRules;
public record NotPredicate(RulePredicate predicate) implements RulePredicate {
public static final MapCodec CODEC = RulePredicate.CODEC.fieldOf("predicate").xmap(NotPredicate::new, NotPredicate::predicate);
@Override
public MapCodec codec() {
return CODEC;
}
@Override
public boolean matches(RuleModifier.Context context, SurfaceRules.RuleSource ruleSource) {
return !predicate.matches(context, ruleSource);
}
}