Fog rendering
This commit is contained in:
parent
32126bd9b0
commit
2fdad6aee8
6 changed files with 221 additions and 243 deletions
|
@ -18,7 +18,7 @@ import ru.betterend.world.generator.BiomeType;
|
|||
|
||||
public class BiomeRegistry {
|
||||
private static final Map<EndBiome, RegistryKey<Biome>> KEYS = Maps.newHashMap();
|
||||
public static final HashMap<Biome, EndBiome> MUTABLE = Maps.newHashMap();
|
||||
private static final HashMap<Biome, EndBiome> MUTABLE = Maps.newHashMap();
|
||||
public static final BiomePicker LAND_BIOMES = new BiomePicker();
|
||||
public static final BiomePicker VOID_BIOMES = new BiomePicker();
|
||||
|
||||
|
@ -27,10 +27,18 @@ public class BiomeRegistry {
|
|||
public static final EndBiome END_HIGHLANDS = registerBiome(BiomeKeys.END_HIGHLANDS, BiomeType.LAND);
|
||||
public static final EndBiome END_MIDLANDS = registerBiome(BiomeKeys.END_MIDLANDS, BiomeType.LAND);
|
||||
public static final EndBiome SMALL_END_ISLANDS = registerBiome(BiomeKeys.SMALL_END_ISLANDS, BiomeType.VOID);
|
||||
public static final EndBiome TEST = registerBiome(new EndBiome(new BiomeDefinition("test").setFogColor(255, 0, 0)), BiomeType.VOID);
|
||||
public static final EndBiome TEST = registerBiome(new EndBiome(new BiomeDefinition("test").setFogColor(255, 0, 0).setFogDensity(10)), BiomeType.VOID);
|
||||
|
||||
public static void register() {}
|
||||
|
||||
public static void mutateRegistry(Registry<Biome> biomeRegistry) {
|
||||
BiomeRegistry.MUTABLE.clear();
|
||||
for (EndBiome biome : BiomeRegistry.LAND_BIOMES.getBiomes())
|
||||
BiomeRegistry.MUTABLE.put(biomeRegistry.getOrThrow(BiomeRegistry.getBiomeKey(biome)), biome);
|
||||
for (EndBiome biome : BiomeRegistry.VOID_BIOMES.getBiomes())
|
||||
BiomeRegistry.MUTABLE.put(biomeRegistry.getOrThrow(BiomeRegistry.getBiomeKey(biome)), biome);
|
||||
}
|
||||
|
||||
public static EndBiome registerBiome(RegistryKey<Biome> key, BiomeType type) {
|
||||
EndBiome endBiome = new EndBiome(BuiltinRegistries.BIOME.get(key));
|
||||
addToPicker(endBiome, type);
|
||||
|
@ -72,4 +80,8 @@ public class BiomeRegistry {
|
|||
public static RegistryKey<Biome> getBiomeKey(EndBiome biome) {
|
||||
return KEYS.get(biome);
|
||||
}
|
||||
|
||||
public static EndBiome getFromBiome(Biome biome) {
|
||||
return MUTABLE.getOrDefault(biome, END);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue