Interface RandomFeatureConfiguration
- All Superinterfaces:
FeatureConfiguration, Wrapper
A configuration for a random feature.
- Since:
- 3.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classBuilder forRandomFeatureConfiguration.static final recordA weighted placed feature, which consists of a placed feature and a chance of being placed. -
Field Summary
Fields inherited from interface FeatureConfiguration
NONE -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a new builder.Gets the default placed feature.features()Gets the list of weighted placed features.static RandomFeatureConfigurationof(List<RandomFeatureConfiguration.WeightedPlacedFeature> features, PlacedFeature defaultFeature) Creates a new random feature configuration.Converts this configuration to a builder.weighted(PlacedFeature feature, float chance) Creates a new weighted placed feature.Methods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
Method Details
-
features
Gets the list of weighted placed features.- Returns:
- the list of weighted placed features
- Since:
- 3.0.0
-
defaultFeature
Gets the default placed feature.- Returns:
- the default placed feature
- Since:
- 3.0.0
-
toBuilder
Converts this configuration to a builder.- Returns:
- a new builder with the same values as this configuration
- Since:
- 3.0.0
-
of
@AsOf("3.0.0") static RandomFeatureConfiguration of(List<RandomFeatureConfiguration.WeightedPlacedFeature> features, PlacedFeature defaultFeature) Creates a new random feature configuration.- Parameters:
features- the list of weighted placed featuresdefaultFeature- the default placed feature- Returns:
- a new random feature configuration
- Since:
- 3.0.0
-
weighted
@AsOf("3.0.0") static RandomFeatureConfiguration.WeightedPlacedFeature weighted(PlacedFeature feature, float chance) Creates a new weighted placed feature.- Parameters:
feature- the placed featurechance- the chance of the feature being placed (between 0.0 and 1.0)- Returns:
- a new weighted placed feature
- Since:
- 3.0.0
-
builder
Creates a new builder.- Returns:
- a new builder
- Since:
- 3.0.0
-