private void Z() {
    // CraftBukkit start
    WeatherChangeEvent weather = new WeatherChangeEvent(this.getWorld(), false);
    this.getServer().getPluginManager().callEvent(weather);

    ThunderChangeEvent thunder = new ThunderChangeEvent(this.getWorld(), false);
    this.getServer().getPluginManager().callEvent(thunder);
    if (!weather.isCancelled()) {
      this.worldData.setWeatherDuration(0);
      this.worldData.setStorm(false);
    }
    if (!thunder.isCancelled()) {
      this.worldData.setThunderDuration(0);
      this.worldData.setThundering(false);
    }
    // CraftBukkit end
  }
Beispiel #2
0
  @EventHandler
  public void onRain(WeatherChangeEvent event) {

    if (event.toWeatherState() == true) {
      Random rand = new Random();
      int value = rand.nextInt(100) + 1;

      if (value < 60) {
        getServer()
            .broadcastMessage(
                ChatColor.DARK_RED + "The gods are cruel, insufferable rain pours down upon you");
      } else {
        event.setCancelled(true);
        getServer()
            .broadcastMessage(
                ChatColor.BLUE + "The gods are kind, another few days of clear skies");
      }
    }
  }
 @EventHandler
 public void onWeatherChange(WeatherChangeEvent e) {
   if (!plugin.getConfig().getBoolean("Complete")) return;
   e.setCancelled(true);
 }
 @EventHandler
 public void clearWeather(WeatherChangeEvent event) {
   event.setCancelled(true);
 }
 @EventHandler
 public void onWeatherChangeEvent(WeatherChangeEvent event) {
   if (Lobby.get().isLobbyEnabled()) {
     event.setCancelled(true);
   }
 }
 @Listener(priority = EventPriority.LOWEST)
 public void toRain(WeatherChangeEvent e) {
   if (r.getCnfg().getBoolean("Weather.Rain") && enabled) {
     e.setCancelled(true);
   }
 }