com.yungnickyoung.minecraft.yungsapi.world.structure.terrainadaptation.CustomAdaptation Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of YungsApi-1.21-Fabric Show documentation
Show all versions of YungsApi-1.21-Fabric Show documentation
A common API for YUNG's Minecraft mods
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;
}
}