Merge branch 'main' of github.com-quiqueck:paulevsGitch/BCLib
This commit is contained in:
commit
cf9072cb79
1 changed files with 8 additions and 11 deletions
|
@ -85,6 +85,7 @@ public class BiomeAPI {
|
|||
private static Registry<Biome> biomeRegistry;
|
||||
|
||||
private static final Map<PlacedFeature, Integer> FEATURE_ORDER = Maps.newHashMap();
|
||||
private static final MutableInt FEATURE_ORDER_ID = new MutableInt(0);
|
||||
|
||||
private static final Map<ResourceKey, List<BiConsumer<ResourceLocation, Biome>>> MODIFICATIONS = Maps.newHashMap();
|
||||
private static final Map<ResourceLocation, SurfaceRules.RuleSource> SURFACE_RULES = Maps.newHashMap();
|
||||
|
@ -104,14 +105,6 @@ public class BiomeAPI {
|
|||
public static final BCLBiome SMALL_END_ISLANDS = registerEndVoidBiome(getFromRegistry(new ResourceLocation("small_end_islands")));
|
||||
|
||||
public static void init() {
|
||||
|
||||
}
|
||||
|
||||
private static boolean didInitFeatureOrder = false;
|
||||
public static void initFeatureOrder() {
|
||||
didInitFeatureOrder = true;
|
||||
|
||||
MutableInt integer = new MutableInt(0);
|
||||
BuiltinRegistries.BIOME
|
||||
.entrySet()
|
||||
.stream()
|
||||
|
@ -123,7 +116,7 @@ public class BiomeAPI {
|
|||
features.forEach(step -> {
|
||||
step.forEach(provider -> {
|
||||
PlacedFeature feature = provider.get();
|
||||
FEATURE_ORDER.computeIfAbsent(feature, f -> integer.getAndIncrement());
|
||||
FEATURE_ORDER.computeIfAbsent(feature, f -> FEATURE_ORDER_ID.getAndIncrement());
|
||||
});
|
||||
});
|
||||
});
|
||||
|
@ -721,9 +714,13 @@ public class BiomeAPI {
|
|||
if (!didInitFeatureOrder){
|
||||
initFeatureOrder();
|
||||
}
|
||||
features.forEach(provider -> {
|
||||
PlacedFeature feature = provider.get();
|
||||
FEATURE_ORDER.computeIfAbsent(feature, f -> FEATURE_ORDER_ID.getAndIncrement());
|
||||
});
|
||||
features.sort((f1, f2) -> {
|
||||
int v1 = FEATURE_ORDER.getOrDefault(f1.get(), FEATURE_ORDER.size());
|
||||
int v2 = FEATURE_ORDER.getOrDefault(f2.get(), FEATURE_ORDER.size());
|
||||
int v1 = FEATURE_ORDER.getOrDefault(f1.get(), 70000);
|
||||
int v2 = FEATURE_ORDER.getOrDefault(f2.get(), 70000);
|
||||
return Integer.compare(v1, v2);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue