Search in sources :

Example 1 with BiomeConfig

use of org.blockartistry.mod.DynSurround.data.config.BiomeConfig in project BetterRain by OreCruncher.

the class BiomeRegistry method process.

private static void process(final BiomeConfig config) {
    for (final BiomeConfig.Entry entry : config.entries) {
        for (final Entry biomeEntry : registry.valueCollection()) {
            if (isBiomeMatch(entry, resolveName(biomeEntry.biome))) {
                if (entry.hasPrecipitation != null)
                    biomeEntry.hasPrecipitation = entry.hasPrecipitation.booleanValue();
                if (entry.hasAurora != null)
                    biomeEntry.hasAurora = entry.hasAurora.booleanValue();
                if (entry.hasDust != null)
                    biomeEntry.hasDust = entry.hasDust.booleanValue();
                if (entry.hasFog != null)
                    biomeEntry.hasFog = entry.hasFog.booleanValue();
                if (entry.fogDensity != null)
                    biomeEntry.fogDensity = entry.fogDensity.floatValue();
                if (entry.fogColor != null) {
                    final int[] rgb = MyUtils.splitToInts(entry.fogColor, ',');
                    if (rgb.length == 3)
                        biomeEntry.fogColor = new Color(rgb[0], rgb[1], rgb[2]);
                }
                if (entry.dustColor != null) {
                    final int[] rgb = MyUtils.splitToInts(entry.dustColor, ',');
                    if (rgb.length == 3)
                        biomeEntry.dustColor = new Color(rgb[0], rgb[1], rgb[2]);
                }
                if (entry.soundReset != null && entry.soundReset.booleanValue()) {
                    biomeEntry.sounds = new ArrayList<SoundEffect>();
                    biomeEntry.spotSounds = new ArrayList<SoundEffect>();
                }
                if (entry.spotSoundChance != null)
                    biomeEntry.spotSoundChance = entry.spotSoundChance.intValue();
                for (final SoundConfig sr : entry.sounds) {
                    if (SoundRegistry.isSoundBlocked(sr.sound))
                        continue;
                    final SoundEffect s = new SoundEffect(sr);
                    if (s.type == SoundType.SPOT)
                        biomeEntry.spotSounds.add(s);
                    else
                        biomeEntry.sounds.add(s);
                }
            }
        }
    }
}
Also used : SoundEffect(org.blockartistry.mod.DynSurround.client.sound.SoundEffect) Color(org.blockartistry.mod.DynSurround.util.Color) SoundConfig(org.blockartistry.mod.DynSurround.data.config.SoundConfig) BiomeConfig(org.blockartistry.mod.DynSurround.data.config.BiomeConfig)

Aggregations

SoundEffect (org.blockartistry.mod.DynSurround.client.sound.SoundEffect)1 BiomeConfig (org.blockartistry.mod.DynSurround.data.config.BiomeConfig)1 SoundConfig (org.blockartistry.mod.DynSurround.data.config.SoundConfig)1 Color (org.blockartistry.mod.DynSurround.util.Color)1