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

com.yungnickyoung.minecraft.yungsapi.world.structure.terrainadaptation.CustomAdaptation Maven / Gradle / Ivy

The newest version!
package com.yungnickyoung.minecraft.yungsapi.world.structure.terrainadaptation;

import com.mojang.serialization.Codec;
import com.mojang.serialization.MapCodec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
import net.minecraft.class_5699;

public class CustomAdaptation extends EnhancedTerrainAdaptation {
    public static final MapCodec CODEC = RecordCodecBuilder.mapCodec((builder) -> builder
            .group(
                    Codec.BOOL.optionalFieldOf("carves", true).forGetter(EnhancedTerrainAdaptation::carves),
                    Codec.BOOL.optionalFieldOf("beards", true).forGetter(EnhancedTerrainAdaptation::beards),
                    class_5699.field_33441.fieldOf("kernel_size").forGetter(EnhancedTerrainAdaptation::getKernelSize),
                    class_5699.field_33441.fieldOf("kernel_distance").forGetter(EnhancedTerrainAdaptation::getKernelDistance))
            .apply(builder, CustomAdaptation::new));

    CustomAdaptation(boolean doCarving, boolean doBearding, int kernelSize, int kernelDistance) {
        super(kernelSize, kernelDistance, doCarving, doBearding);
    }

    @Override
    public EnhancedTerrainAdaptationType type() {
        return EnhancedTerrainAdaptationType.CUSTOM;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy