Allow usage of BCLStructureFeature to add Structures

This commit is contained in:
Frank 2021-12-01 08:53:14 +01:00
parent e7b66af02e
commit 1365339c1e

View file

@ -497,14 +497,17 @@ public class BiomeAPI {
BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE.getResourceKey(structure) BuiltinRegistries.CONFIGURED_STRUCTURE_FEATURE.getResourceKey(structure)
.ifPresent((key)-> .ifPresent((key)->
BiomeModifications.addStructure( BiomeModifications.addStructure(
(ctx)-> ctx.getBiomeKey().location() (ctx)-> ctx.getBiomeKey().location().equals(BuiltinRegistries.BIOME.getKey(biome)),
.equals(BuiltinRegistries.BIOME.getKey(biome)),
key key
)); ));
// BiomeGenerationSettingsAccessor accessor = (BiomeGenerationSettingsAccessor) biome.getGenerationSettings(); }
// List<Supplier<ConfiguredStructureFeature<?, ?>>> biomeStructures = getMutableList(accessor.fabric_getStructureFeatures()); /**
// biomeStructures.add(() -> structure); * Adds new structure feature to existing biome.
// accessor.fabric_setStructureFeatures(biomeStructures); * @param biome {@link Biome} to add structure feature in.
* @param structure {@link BCLStructureFeature} to add.
*/
public static void addBiomeStructure(Biome biome, BCLStructureFeature structure) {
addBiomeStructure(biome, structure.getFeatureConfigured());
} }
/** /**