API init
This commit is contained in:
parent
cb16ea86b3
commit
9ebc7e906f
2 changed files with 15 additions and 9 deletions
|
@ -6,6 +6,7 @@ import net.fabricmc.loader.api.FabricLoader;
|
||||||
import net.minecraft.resources.ResourceLocation;
|
import net.minecraft.resources.ResourceLocation;
|
||||||
import ru.bclib.api.TagAPI;
|
import ru.bclib.api.TagAPI;
|
||||||
import ru.bclib.api.WorldDataAPI;
|
import ru.bclib.api.WorldDataAPI;
|
||||||
|
import ru.bclib.api.biomes.BiomeAPI;
|
||||||
import ru.bclib.api.dataexchange.DataExchangeAPI;
|
import ru.bclib.api.dataexchange.DataExchangeAPI;
|
||||||
import ru.bclib.api.dataexchange.handler.autosync.Chunker;
|
import ru.bclib.api.dataexchange.handler.autosync.Chunker;
|
||||||
import ru.bclib.api.dataexchange.handler.autosync.HelloClient;
|
import ru.bclib.api.dataexchange.handler.autosync.HelloClient;
|
||||||
|
@ -48,6 +49,7 @@ public class BCLib implements ModInitializer {
|
||||||
));
|
));
|
||||||
|
|
||||||
BCLibPatch.register();
|
BCLibPatch.register();
|
||||||
|
BiomeAPI.init();
|
||||||
Configs.save();
|
Configs.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,17 +105,21 @@ public class BiomeAPI {
|
||||||
|
|
||||||
public static void init() {
|
public static void init() {
|
||||||
MutableInt integer = new MutableInt(0);
|
MutableInt integer = new MutableInt(0);
|
||||||
BuiltinRegistries.BIOME.entrySet().forEach(entry -> {
|
BuiltinRegistries.BIOME
|
||||||
Biome biome = entry.getValue();
|
.entrySet()
|
||||||
BiomeGenerationSettingsAccessor accessor = BiomeGenerationSettingsAccessor.class.cast(biome.getGenerationSettings());
|
.stream()
|
||||||
List<List<Supplier<PlacedFeature>>> features = accessor.bclib_getFeatures();
|
.filter(entry -> entry.getKey().location().getNamespace().equals("minecraft"))
|
||||||
features.forEach(step -> {
|
.map(entry -> entry.getValue())
|
||||||
step.forEach(provider -> {
|
.forEach(biome -> {
|
||||||
PlacedFeature feature = provider.get();
|
BiomeGenerationSettingsAccessor accessor = BiomeGenerationSettingsAccessor.class.cast(biome.getGenerationSettings());
|
||||||
FEATURE_ORDER.computeIfAbsent(feature, f -> integer.getAndIncrement());
|
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());
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue