Additional builder functions
This commit is contained in:
parent
6d279852f0
commit
fe8b20dcba
1 changed files with 22 additions and 0 deletions
|
@ -2,6 +2,8 @@ package ru.bclib.api.features;
|
||||||
|
|
||||||
import net.minecraft.data.worldgen.placement.PlacementUtils;
|
import net.minecraft.data.worldgen.placement.PlacementUtils;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
|
import net.minecraft.util.valueproviders.IntProvider;
|
||||||
|
import net.minecraft.util.valueproviders.UniformInt;
|
||||||
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
import net.minecraft.world.level.levelgen.GenerationStep.Decoration;
|
||||||
import net.minecraft.world.level.levelgen.feature.Feature;
|
import net.minecraft.world.level.levelgen.feature.Feature;
|
||||||
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
|
import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration;
|
||||||
|
@ -69,6 +71,15 @@ public class BCLFeatureBuilder {
|
||||||
return modifier(CountPlacement.of(count));
|
return modifier(CountPlacement.of(count));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate feature in certain iterations (per chunk). Count can be between 0 and max value.
|
||||||
|
* @param count maximum amount of iterations per chunk.
|
||||||
|
* @return same {@link BCLFeatureBuilder} instance.
|
||||||
|
*/
|
||||||
|
public BCLFeatureBuilder countMax(int count) {
|
||||||
|
return modifier(CountPlacement.of(UniformInt.of(0, count)));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate feature in certain iterations (per chunk), count can be different in different chunks.
|
* Generate feature in certain iterations (per chunk), count can be different in different chunks.
|
||||||
* @param average how many times feature will be generated in chunk (in average).
|
* @param average how many times feature will be generated in chunk (in average).
|
||||||
|
@ -89,6 +100,17 @@ public class BCLFeatureBuilder {
|
||||||
return modifier(CountOnEveryLayerPlacement.of(count));
|
return modifier(CountOnEveryLayerPlacement.of(count));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generate feature in certain iterations (per chunk). Count can be between 0 and max value.
|
||||||
|
* Feature will be generated on all layers (example - Nether plants).
|
||||||
|
* @param count maximum amount of iterations per chunk layers.
|
||||||
|
* @return same {@link BCLFeatureBuilder} instance.
|
||||||
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public BCLFeatureBuilder countLayersMax(int count) {
|
||||||
|
return modifier(CountOnEveryLayerPlacement.of(UniformInt.of(0, count)));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will place feature once in certain amount of chunks (in average).
|
* Will place feature once in certain amount of chunks (in average).
|
||||||
* @param chunks amount of chunks.
|
* @param chunks amount of chunks.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue