From b07aec8bb6664178a83ab8af891eedd526ccf03d Mon Sep 17 00:00:00 2001 From: Frank Date: Mon, 6 Jun 2022 14:55:37 +0200 Subject: [PATCH] Mor COnverted Biomes --- .../features/config/ScatterFeatureConfig.java | 18 +++++++++++++++--- .../betterx/bclib/blocks/BlockProperties.java | 3 ++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/betterx/bclib/api/features/config/ScatterFeatureConfig.java b/src/main/java/org/betterx/bclib/api/features/config/ScatterFeatureConfig.java index e07065c4..fa21ca6a 100644 --- a/src/main/java/org/betterx/bclib/api/features/config/ScatterFeatureConfig.java +++ b/src/main/java/org/betterx/bclib/api/features/config/ScatterFeatureConfig.java @@ -14,6 +14,7 @@ import com.mojang.datafixers.util.Function15; import com.mojang.serialization.Codec; import com.mojang.serialization.codecs.RecordCodecBuilder; import org.betterx.bclib.BCLib; +import org.betterx.bclib.blocks.BlockProperties; import org.betterx.bclib.util.BlocksHelper; import java.util.Optional; @@ -122,17 +123,17 @@ public abstract class ScatterFeatureConfig implements FeatureConfiguration { .orElse(0.5F) .forGetter((T cfg) -> cfg.chanceOfSpreadRadius3), Codec - .intRange(1, 20) + .intRange(1, 64) .fieldOf("min_height") .orElse(2) .forGetter((T cfg) -> cfg.minHeight), Codec - .intRange(1, 20) + .intRange(1, 64) .fieldOf("max_height") .orElse(7) .forGetter((T cfg) -> cfg.maxHeight), Codec - .floatRange(0, 10) + .floatRange(0, 16) .fieldOf("max_spread") .orElse(2f) .forGetter((T cfg) -> cfg.maxSpread), @@ -211,6 +212,17 @@ public abstract class ScatterFeatureConfig implements FeatureConfiguration { return this; } + public Builder tripleShape(Block s) { + return tripleShape(s.defaultBlockState()); + } + + public Builder 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 block(BlockStateProvider s) { this.clusterBlock = s; if (tipBlock == null) tipBlock = s; diff --git a/src/main/java/org/betterx/bclib/blocks/BlockProperties.java b/src/main/java/org/betterx/bclib/blocks/BlockProperties.java index 115259b8..bc9f423a 100644 --- a/src/main/java/org/betterx/bclib/blocks/BlockProperties.java +++ b/src/main/java/org/betterx/bclib/blocks/BlockProperties.java @@ -1,6 +1,7 @@ package org.betterx.bclib.blocks; 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.EnumProperty; 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 COLOR = IntegerProperty.create("color", 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 { TOP("top", 0), MIDDLE("middle", 1), BOTTOM("bottom", 2);