From e2b7f6849ad4a8a560b4f2cc98f486f7c1ba81e7 Mon Sep 17 00:00:00 2001 From: Frank Date: Sat, 4 Jun 2022 02:52:18 +0200 Subject: [PATCH] Migrated SoulPlains, MagmaLand and GravelDesert to new Feature style --- .../bclib/api/features/FastFeatures.java | 33 +++++++++++++++---- 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/betterx/bclib/api/features/FastFeatures.java b/src/main/java/org/betterx/bclib/api/features/FastFeatures.java index 407dc243..334aabe4 100644 --- a/src/main/java/org/betterx/bclib/api/features/FastFeatures.java +++ b/src/main/java/org/betterx/bclib/api/features/FastFeatures.java @@ -26,7 +26,8 @@ public class FastFeatures { boolean onFloor, boolean sparse, ScatterFeatureConfig.Builder builder, - Feature scatterFeature) { + Feature scatterFeature + ) { BCLFeatureBuilder fBuilder = BCLFeatureBuilder.start(location, scatterFeature); if (onFloor) { fBuilder.findSolidFloor(3).isEmptyAbove2(); @@ -58,6 +59,30 @@ public class FastFeatures { new SimpleBlockConfiguration(BlockStateProvider.simple(block))); } + public static BCLFeature + simple(ResourceLocation location, + int searchDist, + boolean rare, + Feature feature) { + return simple(location, searchDist, rare, feature, NoneFeatureConfiguration.NONE); + } + + public static BCLFeature + simple(ResourceLocation location, + int searchDist, + boolean rare, + Feature feature, + FC config) { + BCLFeatureBuilder builder = BCLFeatureBuilder + .start(location, feature) + .findSolidFloor(Math.min(12, searchDist)) + .is(BlockPredicate.ONLY_IN_AIR_PREDICATE); + if (rare) { + builder.onceEvery(4); + } + return builder.buildAndRegister(config); + } + public static BCLFeature patch(ResourceLocation location, Feature feature) { return patch(location, 96, 7, 3, feature, FeatureConfiguration.NONE); @@ -80,11 +105,7 @@ public class FastFeatures { Feature feature, FC config) { ResourceLocation patchLocation = new ResourceLocation(location.getNamespace(), location.getPath() + "_patch"); - final BCLFeature SINGLE = BCLFeatureBuilder - .start(location, feature) - .findSolidFloor(Math.min(12, ySpread)) - .is(BlockPredicate.ONLY_IN_AIR_PREDICATE) - .buildAndRegister(config); + final BCLFeature SINGLE = simple(location, ySpread, false, feature, config); return BCLFeatureBuilder .start(patchLocation, Feature.RANDOM_PATCH)