Mor COnverted Biomes

This commit is contained in:
Frank 2022-06-06 14:55:37 +02:00
parent e52230e7e3
commit b07aec8bb6
2 changed files with 17 additions and 4 deletions

View file

@ -14,6 +14,7 @@ import com.mojang.datafixers.util.Function15;
import com.mojang.serialization.Codec; import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder; import com.mojang.serialization.codecs.RecordCodecBuilder;
import org.betterx.bclib.BCLib; import org.betterx.bclib.BCLib;
import org.betterx.bclib.blocks.BlockProperties;
import org.betterx.bclib.util.BlocksHelper; import org.betterx.bclib.util.BlocksHelper;
import java.util.Optional; import java.util.Optional;
@ -122,17 +123,17 @@ public abstract class ScatterFeatureConfig implements FeatureConfiguration {
.orElse(0.5F) .orElse(0.5F)
.forGetter((T cfg) -> cfg.chanceOfSpreadRadius3), .forGetter((T cfg) -> cfg.chanceOfSpreadRadius3),
Codec Codec
.intRange(1, 20) .intRange(1, 64)
.fieldOf("min_height") .fieldOf("min_height")
.orElse(2) .orElse(2)
.forGetter((T cfg) -> cfg.minHeight), .forGetter((T cfg) -> cfg.minHeight),
Codec Codec
.intRange(1, 20) .intRange(1, 64)
.fieldOf("max_height") .fieldOf("max_height")
.orElse(7) .orElse(7)
.forGetter((T cfg) -> cfg.maxHeight), .forGetter((T cfg) -> cfg.maxHeight),
Codec Codec
.floatRange(0, 10) .floatRange(0, 16)
.fieldOf("max_spread") .fieldOf("max_spread")
.orElse(2f) .orElse(2f)
.forGetter((T cfg) -> cfg.maxSpread), .forGetter((T cfg) -> cfg.maxSpread),
@ -211,6 +212,17 @@ public abstract class ScatterFeatureConfig implements FeatureConfiguration {
return this; return this;
} }
public Builder<T> tripleShape(Block s) {
return tripleShape(s.defaultBlockState());
}
public Builder<T> tripleShape(BlockState s) {
block(s.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.MIDDLE));
tipBlock(s.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.TOP));
bottomBlock(s.setValue(BlockProperties.TRIPLE_SHAPE, BlockProperties.TripleShape.BOTTOM));
return this;
}
public Builder<T> block(BlockStateProvider s) { public Builder<T> block(BlockStateProvider s) {
this.clusterBlock = s; this.clusterBlock = s;
if (tipBlock == null) tipBlock = s; if (tipBlock == null) tipBlock = s;

View file

@ -1,6 +1,7 @@
package org.betterx.bclib.blocks; package org.betterx.bclib.blocks;
import net.minecraft.util.StringRepresentable; import net.minecraft.util.StringRepresentable;
import net.minecraft.world.level.block.state.properties.BlockStateProperties;
import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.BooleanProperty;
import net.minecraft.world.level.block.state.properties.EnumProperty; import net.minecraft.world.level.block.state.properties.EnumProperty;
import net.minecraft.world.level.block.state.properties.IntegerProperty; import net.minecraft.world.level.block.state.properties.IntegerProperty;
@ -22,7 +23,7 @@ public class BlockProperties {
public static final IntegerProperty FULLNESS = IntegerProperty.create("fullness", 0, 3); public static final IntegerProperty FULLNESS = IntegerProperty.create("fullness", 0, 3);
public static final IntegerProperty COLOR = IntegerProperty.create("color", 0, 7); public static final IntegerProperty COLOR = IntegerProperty.create("color", 0, 7);
public static final IntegerProperty SIZE = IntegerProperty.create("size", 0, 7); public static final IntegerProperty SIZE = IntegerProperty.create("size", 0, 7);
public static final IntegerProperty AGE = IntegerProperty.create("age", 0, 3); public static final IntegerProperty AGE = BlockStateProperties.AGE_3;
public enum TripleShape implements StringRepresentable { public enum TripleShape implements StringRepresentable {
TOP("top", 0), MIDDLE("middle", 1), BOTTOM("bottom", 2); TOP("top", 0), MIDDLE("middle", 1), BOTTOM("bottom", 2);