Search in sources :

Example 1 with WeatherDescriptor

use of mcjty.rftoolsdim.dimensions.description.WeatherDescriptor in project RFToolsDimensions by McJty.

the class GenericWorldProvider method updateWeather.

@Override
public void updateWeather() {
    super.updateWeather();
    if (!world.isRemote) {
        getDimensionInformation();
        if (dimensionInformation != null) {
            WeatherDescriptor descriptor = dimensionInformation.getWeatherDescriptor();
            float rs = descriptor.getRainStrength();
            if (rs > -0.5f) {
                world.rainingStrength = rs;
                if (Math.abs(world.rainingStrength) < 0.001) {
                    world.prevRainingStrength = 0;
                    world.rainingStrength = 0;
                    world.getWorldInfo().setRaining(false);
                }
            }
            float ts = descriptor.getThunderStrength();
            if (ts > -0.5f) {
                world.thunderingStrength = ts;
                if (Math.abs(world.thunderingStrength) < 0.001) {
                    world.prevThunderingStrength = 0;
                    world.thunderingStrength = 0;
                    world.getWorldInfo().setThundering(false);
                }
            }
        }
    }
}
Also used : WeatherDescriptor(mcjty.rftoolsdim.dimensions.description.WeatherDescriptor)

Aggregations

WeatherDescriptor (mcjty.rftoolsdim.dimensions.description.WeatherDescriptor)1