Examples of WeatherSimulator


Examples of org.spout.vanilla.world.WeatherSimulator

   * @param time to use
   * @param timeFactor unknown factor, use 1.0f
   */
  public void updateCelestialTime(long time, float timeFactor) {
    float celestial = MathHelper.getRealCelestialAngle(time, timeFactor);
    WeatherSimulator weather = this.getWeatherSimulator();
    if (weather != null) {
      celestial = (float) ((double) celestial * (1.0d - (double) (weather.getRainStrength(timeFactor) * 5f) / 16d));
      celestial = (float) ((double) celestial * (1.0d - (double) (weather.getThunderStrength(timeFactor) * 5f) / 16d));
    }
    getOwner().setSkyLight((byte) (celestial * (float) SKY_LIGHT_RANGE + MIN_SKY_LIGHT));

    TimeUpdateEvent event = new TimeUpdateEvent(getOwner(), time);
    for (Player player : getOwner().getPlayers()) {
View Full Code Here

Examples of org.spout.vanilla.world.WeatherSimulator

  /**
   * Sets whether or not the sky can produce weather.
   */
  public synchronized void setHasWeather(boolean hasWeather) {
    if (hasWeather && this.weather == null) {
      this.weather = new WeatherSimulator(this);
    } else {
      this.weather = null;
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.