Removed biome hashmap
This commit is contained in:
parent
63946e049d
commit
03968ccda3
1 changed files with 12 additions and 24 deletions
|
@ -109,7 +109,6 @@ public class BiomeAPI {
|
|||
private static final Map<ResourceKey, List<BiConsumer<ResourceLocation, Biome>>> MODIFICATIONS = Maps.newHashMap();
|
||||
private static final Map<ResourceLocation, SurfaceRules.RuleSource> SURFACE_RULES = Maps.newHashMap();
|
||||
private static final Set<NoiseGeneratorSettings> NOISE_GENERATOR_SETTINGS = new HashSet<>();
|
||||
private static final Set<ResourceLocation> MODIFIED_BIOMES = Sets.newHashSet();
|
||||
|
||||
public static final BCLBiome NETHER_WASTES_BIOME = registerNetherBiome(getFromRegistry(Biomes.NETHER_WASTES));
|
||||
public static final BCLBiome CRIMSON_FOREST_BIOME = registerNetherBiome(getFromRegistry(Biomes.CRIMSON_FOREST));
|
||||
|
@ -374,9 +373,9 @@ public class BiomeAPI {
|
|||
*/
|
||||
@Nullable
|
||||
public static ResourceKey getBiomeKey(Biome biome) {
|
||||
return BuiltinRegistries.BIOME.getResourceKey(biome)
|
||||
.orElseGet(() -> biomeRegistry != null ? biomeRegistry.getResourceKey(biome)
|
||||
.orElse(null) : null);
|
||||
return BuiltinRegistries.BIOME
|
||||
.getResourceKey(biome)
|
||||
.orElseGet(() -> biomeRegistry != null ? biomeRegistry.getResourceKey(biome).orElse(null) : null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -539,19 +538,9 @@ public class BiomeAPI {
|
|||
|
||||
private static void applyModificationsToBiome(List<BiConsumer<ResourceLocation, Biome>> modifications, Biome biome) {
|
||||
ResourceLocation biomeID = getBiomeID(biome);
|
||||
boolean modify = isDatapackBiome(biomeID);
|
||||
if (biome != BuiltinRegistries.BIOME.get(biomeID)) {
|
||||
modify = true;
|
||||
}
|
||||
else if (!modify && !MODIFIED_BIOMES.contains(biomeID)) {
|
||||
MODIFIED_BIOMES.add(biomeID);
|
||||
modify = true;
|
||||
}
|
||||
if (modify) {
|
||||
modifications.forEach(consumer -> {
|
||||
consumer.accept(biomeID, biome);
|
||||
});
|
||||
}
|
||||
|
||||
final BCLBiome bclBiome = BiomeAPI.getBiome(biome);
|
||||
if (bclBiome != null) {
|
||||
|
@ -597,7 +586,6 @@ public class BiomeAPI {
|
|||
rules.add(rule);
|
||||
}
|
||||
});
|
||||
|
||||
return rules;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue