This commit is contained in:
paulevsGitch 2021-12-07 21:15:40 +03:00
parent cb16ea86b3
commit 9ebc7e906f
2 changed files with 15 additions and 9 deletions

View file

@ -6,6 +6,7 @@ import net.fabricmc.loader.api.FabricLoader;
import net.minecraft.resources.ResourceLocation;
import ru.bclib.api.TagAPI;
import ru.bclib.api.WorldDataAPI;
import ru.bclib.api.biomes.BiomeAPI;
import ru.bclib.api.dataexchange.DataExchangeAPI;
import ru.bclib.api.dataexchange.handler.autosync.Chunker;
import ru.bclib.api.dataexchange.handler.autosync.HelloClient;
@ -48,6 +49,7 @@ public class BCLib implements ModInitializer {
));
BCLibPatch.register();
BiomeAPI.init();
Configs.save();
}

View file

@ -105,17 +105,21 @@ public class BiomeAPI {
public static void init() {
MutableInt integer = new MutableInt(0);
BuiltinRegistries.BIOME.entrySet().forEach(entry -> {
Biome biome = entry.getValue();
BiomeGenerationSettingsAccessor accessor = BiomeGenerationSettingsAccessor.class.cast(biome.getGenerationSettings());
List<List<Supplier<PlacedFeature>>> features = accessor.bclib_getFeatures();
features.forEach(step -> {
step.forEach(provider -> {
PlacedFeature feature = provider.get();
FEATURE_ORDER.computeIfAbsent(feature, f -> integer.getAndIncrement());
BuiltinRegistries.BIOME
.entrySet()
.stream()
.filter(entry -> entry.getKey().location().getNamespace().equals("minecraft"))
.map(entry -> entry.getValue())
.forEach(biome -> {
BiomeGenerationSettingsAccessor accessor = BiomeGenerationSettingsAccessor.class.cast(biome.getGenerationSettings());
List<List<Supplier<PlacedFeature>>> features = accessor.bclib_getFeatures();
features.forEach(step -> {
step.forEach(provider -> {
PlacedFeature feature = provider.get();
FEATURE_ORDER.computeIfAbsent(feature, f -> integer.getAndIncrement());
});
});
});
});
}
/**