More Placement Balancing
This commit is contained in:
parent
7b9936af05
commit
35ce65674b
3 changed files with 18 additions and 2 deletions
|
@ -91,6 +91,10 @@ public class BCLFeatureBuilder<FC extends FeatureConfiguration, F extends Featur
|
|||
return modifier(CountPlacement.of(UniformInt.of(0, count)));
|
||||
}
|
||||
|
||||
public BCLFeatureBuilder countRange(int min, int max) {
|
||||
return modifier(CountPlacement.of(UniformInt.of(min, max)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate feature in certain iterations (per chunk).
|
||||
* Feature will be generated on all layers (example - Nether plants).
|
||||
|
|
|
@ -14,10 +14,20 @@ import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfigur
|
|||
import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
||||
import net.minecraft.world.level.levelgen.placement.PlacementModifier;
|
||||
|
||||
import org.betterx.bclib.BCLib;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Optional;
|
||||
|
||||
public class BCLFeature {
|
||||
public static final Feature<ScatterFeatureConfig.OnSolid> SCATTER_ON_SOLID = register(
|
||||
BCLib.makeID("scatter_on_solid"),
|
||||
new ScatterFeature<>(ScatterFeatureConfig.OnSolid.CODEC)
|
||||
);
|
||||
public static final Feature<BlockPlaceFeatureConfig> PLACE_BLOCK = register(
|
||||
BCLib.makeID("place_block"),
|
||||
new BlockPlaceFeature<>(BlockPlaceFeatureConfig.CODEC)
|
||||
);
|
||||
private final Holder<PlacedFeature> placedFeature;
|
||||
private final Decoration featureStep;
|
||||
private final Feature<?> feature;
|
||||
|
@ -81,7 +91,8 @@ public class BCLFeature {
|
|||
return optional.isPresent();
|
||||
}
|
||||
|
||||
public static <C extends FeatureConfiguration, F extends Feature<C>> F register(String string, F feature) {
|
||||
public static <C extends FeatureConfiguration, F extends Feature<C>> F register(ResourceLocation string,
|
||||
F feature) {
|
||||
return Registry.register(Registry.FEATURE, string, feature);
|
||||
}
|
||||
|
||||
|
|
|
@ -7,12 +7,13 @@ import net.minecraft.world.level.levelgen.feature.Feature;
|
|||
import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import org.betterx.bclib.BCLib;
|
||||
import org.betterx.bclib.api.features.BCLFeatureBuilder;
|
||||
import org.betterx.bclib.world.structures.StructureNBT;
|
||||
import org.betterx.bclib.world.structures.StructureWorldNBT;
|
||||
|
||||
public class TemplateFeature<FC extends TemplateFeatureConfig> extends Feature<FC> {
|
||||
public static final Feature<TemplateFeatureConfig> INSTANCE = BCLFeature.register("template",
|
||||
public static final Feature<TemplateFeatureConfig> INSTANCE = BCLFeature.register(BCLib.makeID("template"),
|
||||
new TemplateFeature(
|
||||
TemplateFeatureConfig.CODEC));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue