Package net.fabricmc.fabric.api.biome.v1
Interface BiomeSelectionContext
public interface BiomeSelectionContext
Context given to a biome selector for deciding whether it applies to a biome or not.
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canGenerateIn
(RegistryKey<DimensionOptions> dimensionKey) Tries to determine whether this biome generates in a specific dimension, based on theGeneratorOptions
used by the current world-save.getBiome()
Returns the biome with modifications by biome modifiers of higher priority already applied.Optional<RegistryKey<ConfiguredFeature<?,
?>>> getFeatureKey
(ConfiguredFeature<?, ?> configuredFeature) Tries to retrieve the registry key for the given configured feature, which should be from this biomes current feature list.getPlacedFeatureKey
(PlacedFeature placedFeature) Tries to retrieve the registry key for the given placed feature, which should be from this biomes current feature list.getStructureKey
(Structure structureFeature) Tries to retrieve the registry key for the given configured feature, which should be from this biomes current structure list.default boolean
hasBuiltInFeature
(ConfiguredFeature<?, ?> configuredFeature) Returns true if this biome has the given configured feature, which must be registered in theBuiltinRegistries
.default boolean
hasBuiltInPlacedFeature
(PlacedFeature placedFeature) Returns true if this biome has the given placed feature, which must be registered in theBuiltinRegistries
.default boolean
hasFeature
(RegistryKey<ConfiguredFeature<?, ?>> key) Returns true if this biome contains a placed feature referencing a configured feature with the given key.default boolean
Returns true if this biome contains a placed feature with the given key.boolean
Returns true if this biome is in the givenTagKey
.default boolean
validForBuiltInStructure
(Structure structureFeature) Returns true if the given built-in configured structure fromBuiltinRegistries
can start in this biome in any of the chunk generators used by the current world-save.boolean
Returns true if the configured structure with the given key can start in this biome in any chunk generator used by the current world-save.
-
Method Details
-
getBiomeKey
RegistryKey<Biome> getBiomeKey() -
getBiome
Biome getBiome()Returns the biome with modifications by biome modifiers of higher priority already applied. -
getBiomeRegistryEntry
RegistryEntry<Biome> getBiomeRegistryEntry() -
hasBuiltInFeature
Returns true if this biome has the given configured feature, which must be registered in theBuiltinRegistries
.This method is intended for use with the Vanilla configured features found in classes such as
OreConfiguredFeatures
. -
hasBuiltInPlacedFeature
Returns true if this biome has the given placed feature, which must be registered in theBuiltinRegistries
.This method is intended for use with the Vanilla placed features found in classes such as
OrePlacedFeatures
. -
hasFeature
Returns true if this biome contains a placed feature referencing a configured feature with the given key. -
hasPlacedFeature
Returns true if this biome contains a placed feature with the given key. -
getFeatureKey
Optional<RegistryKey<ConfiguredFeature<?,?>>> getFeatureKey(ConfiguredFeature<?, ?> configuredFeature) Tries to retrieve the registry key for the given configured feature, which should be from this biomes current feature list. May be empty if the configured feature is not registered, or does not come from this biomes feature list. -
getPlacedFeatureKey
Tries to retrieve the registry key for the given placed feature, which should be from this biomes current feature list. May be empty if the placed feature is not registered, or does not come from this biomes feature list. -
validForBuiltInStructure
Returns true if the given built-in configured structure fromBuiltinRegistries
can start in this biome in any of the chunk generators used by the current world-save.This method is intended for use with the Vanilla configured structures found in
Structures
. -
validForStructure
Returns true if the configured structure with the given key can start in this biome in any chunk generator used by the current world-save. -
getStructureKey
Tries to retrieve the registry key for the given configured feature, which should be from this biomes current structure list. May be empty if the configured feature is not registered, or does not come from this biomes feature list. -
canGenerateIn
Tries to determine whether this biome generates in a specific dimension, based on theGeneratorOptions
used by the current world-save.If no dimension options exist for the given dimension key,
false
is returned. -
hasTag
Returns true if this biome is in the givenTagKey
..- Returns:
- true if this biome is in the given
TagKey
-