Java 类org.bukkit.event.weather.ThunderChangeEvent 实例源码

项目:Uranium    文件:CraftWorld.java   
public void setThundering(boolean thundering) {
    if (thundering && !hasStorm()) setStorm(true);
    CraftServer server = world.getServer();

    ThunderChangeEvent thunder = new ThunderChangeEvent(this, thundering);
    server.getPluginManager().callEvent(thunder);
    if (!thunder.isCancelled()) {
        world.worldInfo.setThundering(thundering);

        // These numbers are from Minecraft
        if (thundering) {
            setThunderDuration(rand.nextInt(12000) + 3600);
        } else {
            setThunderDuration(rand.nextInt(168000) + 12000);
        }
    }
}
项目:Skript    文件:EvtWeatherChange.java   
@SuppressWarnings("null")
@Override
public boolean check(final Event e) {
    if (types == null)
        return true;
    if (!(e instanceof WeatherChangeEvent || e instanceof ThunderChangeEvent))
        return false;
    final boolean rain = e instanceof WeatherChangeEvent ? ((WeatherChangeEvent) e).toWeatherState() : ((ThunderChangeEvent) e).getWorld().hasStorm();
    final boolean thunder = e instanceof ThunderChangeEvent ? ((ThunderChangeEvent) e).toThunderState() : ((WeatherChangeEvent) e).getWorld().isThundering();
    return types.check(e, new Checker<WeatherType>() {
        @Override
        public boolean check(final WeatherType t) {
            return t.isWeather(rain, thunder);
        }
    });
}
项目:ThermosRebased    文件:CraftWorld.java   
public void setThundering(boolean thundering) {
    if (thundering && !hasStorm()) setStorm(true);
    CraftServer server = world.getServer();

    ThunderChangeEvent thunder = new ThunderChangeEvent(this, thundering);
    server.getPluginManager().callEvent(thunder);
    if (!thunder.isCancelled()) {
        world.worldInfo.setThundering(thundering);

        // These numbers are from Minecraft
        if (thundering) {
            setThunderDuration(rand.nextInt(12000) + 3600);
        } else {
            setThunderDuration(rand.nextInt(168000) + 12000);
        }
    }
}
项目:Thermos    文件:CraftWorld.java   
public void setThundering(boolean thundering) {
    if (thundering && !hasStorm()) setStorm(true);
    CraftServer server = world.getServer();

    ThunderChangeEvent thunder = new ThunderChangeEvent(this, thundering);
    server.getPluginManager().callEvent(thunder);
    if (!thunder.isCancelled()) {
        world.worldInfo.setThundering(thundering);

        // These numbers are from Minecraft
        if (thundering) {
            setThunderDuration(rand.nextInt(12000) + 3600);
        } else {
            setThunderDuration(rand.nextInt(168000) + 12000);
        }
    }
}
项目:KCauldron    文件:CraftWorld.java   
public void setThundering(boolean thundering) {
    if (thundering && !hasStorm()) setStorm(true);
    CraftServer server = world.getServer();

    ThunderChangeEvent thunder = new ThunderChangeEvent(this, thundering);
    server.getPluginManager().callEvent(thunder);
    if (!thunder.isCancelled()) {
        world.worldInfo.setThundering(thundering);

        // These numbers are from Minecraft
        if (thundering) {
            setThunderDuration(rand.nextInt(12000) + 3600);
        } else {
            setThunderDuration(rand.nextInt(168000) + 12000);
        }
    }
}
项目:CauldronGit    文件:CraftWorld.java   
public void setThundering(boolean thundering) {
    if (thundering && !hasStorm()) setStorm(true);
    CraftServer server = world.getServer();

    ThunderChangeEvent thunder = new ThunderChangeEvent(this, thundering);
    server.getPluginManager().callEvent(thunder);
    if (!thunder.isCancelled()) {
        world.worldInfo.setThundering(thundering);

        // These numbers are from Minecraft
        if (thundering) {
            setThunderDuration(rand.nextInt(12000) + 3600);
        } else {
            setThunderDuration(rand.nextInt(168000) + 12000);
        }
    }
}
项目:Cauldron-Old    文件:CraftWorld.java   
public void setThundering(boolean thundering) {
    if (thundering && !hasStorm()) setStorm(true);
    CraftServer server = world.getServer();

    ThunderChangeEvent thunder = new ThunderChangeEvent(this, thundering);
    server.getPluginManager().callEvent(thunder);
    if (!thunder.isCancelled()) {
        world.worldInfo.setThundering(thundering);

        // These numbers are from Minecraft
        if (thundering) {
            setThunderDuration(rand.nextInt(12000) + 3600);
        } else {
            setThunderDuration(rand.nextInt(168000) + 12000);
        }
    }
}
项目:Cauldron-Reloaded    文件:CraftWorld.java   
public void setThundering(boolean thundering) {
    if (thundering && !hasStorm()) setStorm(true);
    CraftServer server = world.getServer();

    ThunderChangeEvent thunder = new ThunderChangeEvent(this, thundering);
    server.getPluginManager().callEvent(thunder);
    if (!thunder.isCancelled()) {
        world.worldInfo.setThundering(thundering);

        // These numbers are from Minecraft
        if (thundering) {
            setThunderDuration(rand.nextInt(12000) + 3600);
        } else {
            setThunderDuration(rand.nextInt(168000) + 12000);
        }
    }
}
项目:FFoKC    文件:CraftWorld.java   
public void setThundering(boolean thundering) {
    if (thundering && !hasStorm()) setStorm(true);
    CraftServer server = world.getServer();

    ThunderChangeEvent thunder = new ThunderChangeEvent(this, thundering);
    server.getPluginManager().callEvent(thunder);
    if (!thunder.isCancelled()) {
        world.worldInfo.setThundering(thundering);

        // These numbers are from Minecraft
        if (thundering) {
            setThunderDuration(rand.nextInt(12000) + 3600);
        } else {
            setThunderDuration(rand.nextInt(168000) + 12000);
        }
    }
}
项目:CraftBukkit    文件:CraftWorld.java   
public void setThundering(boolean thundering) {
    if (thundering && !hasStorm()) setStorm(true);
    CraftServer server = world.getServer();

    ThunderChangeEvent thunder = new ThunderChangeEvent(this, thundering);
    server.getPluginManager().callEvent(thunder);
    if (!thunder.isCancelled()) {
        world.worldData.setThundering(thundering);

        // These numbers are from Minecraft
        if (thundering) {
            setThunderDuration(rand.nextInt(12000) + 3600);
        } else {
            setThunderDuration(rand.nextInt(168000) + 12000);
        }
    }
}
项目:CraftBukkit    文件:WorldServer.java   
private void Y() {
    // 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
}
项目:Almura-Server    文件:CraftWorld.java   
public void setThundering(boolean thundering) {
    if (thundering && !hasStorm()) setStorm(true);
    CraftServer server = world.getServer();

    ThunderChangeEvent thunder = new ThunderChangeEvent(this, thundering);
    server.getPluginManager().callEvent(thunder);
    if (!thunder.isCancelled()) {
        world.worldData.setThundering(thundering);

        // These numbers are from Minecraft
        if (thundering) {
            setThunderDuration(rand.nextInt(12000) + 3600);
        } else {
            setThunderDuration(rand.nextInt(168000) + 12000);
        }
    }
}
项目:Almura-Server    文件:WorldServer.java   
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
}
项目:Tweakkit-Server    文件:CraftWorld.java   
public void setThundering(boolean thundering) {
    if (thundering && !hasStorm()) setStorm(true);
    CraftServer server = world.getServer();

    ThunderChangeEvent thunder = new ThunderChangeEvent(this, thundering);
    server.getPluginManager().callEvent(thunder);
    if (!thunder.isCancelled()) {
        world.worldData.setThundering(thundering);

        // These numbers are from Minecraft
        if (thundering) {
            setThunderDuration(rand.nextInt(12000) + 3600);
        } else {
            setThunderDuration(rand.nextInt(168000) + 12000);
        }
    }
}
项目:Tweakkit-Server    文件:WorldServer.java   
private void Y() {
    // 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
}
项目:Cauldron    文件:WorldServer.java   
private void resetRainAndThunder()
{
    // 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.worldInfo.setRainTime(0);
        this.worldInfo.setRaining(false);
    }

    if (!thunder.isCancelled())
    {
        this.worldInfo.setThunderTime(0);
        this.worldInfo.setThundering(false);
    }

    // CraftBukkit end
    if (!weather.isCancelled() && !thunder.isCancelled()) provider.resetRainAndThunder(); // Cauldron
}
项目:Cauldron    文件:CraftWorld.java   
public void setThundering(boolean thundering) {
    if (thundering && !hasStorm()) setStorm(true);
    CraftServer server = world.getServer();

    ThunderChangeEvent thunder = new ThunderChangeEvent(this, thundering);
    server.getPluginManager().callEvent(thunder);
    if (!thunder.isCancelled()) {
        world.worldInfo.setThundering(thundering);

        // These numbers are from Minecraft
        if (thundering) {
            setThunderDuration(rand.nextInt(12000) + 3600);
        } else {
            setThunderDuration(rand.nextInt(168000) + 12000);
        }
    }
}
项目:TatsuCraftMod    文件:TFM_WeatherListener.java   
@EventHandler(priority = EventPriority.HIGH)
public void onThunderChange(ThunderChangeEvent event)
{
    try
    {
        if (event.getWorld() == TFM_AdminWorld.getInstance().getWorld() && TFM_AdminWorld.getInstance().getWeatherMode() != TFM_AdminWorld.WeatherMode.OFF)
        {
            return;
        }
    }
    catch (Exception ex)
    {
    }

    if (event.toThunderState() && TFM_ConfigEntry.DISABLE_WEATHER.getBoolean())
    {
        event.setCancelled(true);
        return;
    }
}
项目:Craft-city    文件:CraftWorld.java   
public void setThundering(boolean thundering) {
    if (thundering && !hasStorm()) setStorm(true);
    CraftServer server = world.getServer();

    ThunderChangeEvent thunder = new ThunderChangeEvent(this, thundering);
    server.getPluginManager().callEvent(thunder);
    if (!thunder.isCancelled()) {
        world.worldData.setThundering(thundering);

        // These numbers are from Minecraft
        if (thundering) {
            setThunderDuration(rand.nextInt(12000) + 3600);
        } else {
            setThunderDuration(rand.nextInt(168000) + 12000);
        }
    }
}
项目:Craft-city    文件:WorldServer.java   
private void X() {
    // 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
}
项目:MCPBukkit    文件:CraftWorld.java   
public void setThundering(boolean thundering) {
    if (thundering && !hasStorm()) setStorm(true);
    CraftServer server = world.getServer();

    ThunderChangeEvent thunder = new ThunderChangeEvent((org.bukkit.World) this, thundering);
    server.getPluginManager().callEvent(thunder);
    if (!thunder.isCancelled()) {
        world.field_72986_A.func_76069_a(thundering);

        // These numbers are from Minecraft
        if (thundering) {
            setThunderDuration(rand.nextInt(12000) + 3600);
        } else {
            setThunderDuration(rand.nextInt(168000) + 12000);
        }
    }
}
项目:UltraCore    文件:Events.java   
@EventHandler(priority=EventPriority.HIGHEST)
public void onThunderChange(ThunderChangeEvent event) {

  if (plugin.getConfig().getString("toggle.noweather").equals(true)) {  
    boolean storm = event.toThunderState();
    if(storm)
        event.setCancelled(true);
    }
}
项目:UltraCore    文件:Events.java   
@EventHandler(priority = EventPriority.HIGHEST)
public void onThunderChange(ThunderChangeEvent event) {

    if (plugin.getConfig().getString("toggle.noweather").equals(true)) {
        boolean storm = event.toThunderState();
        if (storm)
            event.setCancelled(true);
    }
}
项目:UltimateSpawn    文件:BasicFeatures.java   
@EventHandler
public void Thunder(ThunderChangeEvent e) {
    if (ConfigGServerEvent.getConfig().getBoolean("Server.Disable.ThunderChange.Enable")) {
        if (!ConfigGServerEvent.getConfig().getBoolean("Server.Disable.ThunderChange.World.All_World")) {
            if (WorldUtils.getWTC().contains(e.getWorld().getName())) {
                e.setCancelled(true);
            }
        } else {
            e.setCancelled(true);
        }
    }
}
项目:ZorahPractice    文件:EnvironmentListener.java   
@EventHandler(priority=EventPriority.HIGHEST)
public void onThunderChange(ThunderChangeEvent event) {
    boolean storm = event.toThunderState();

    if (storm) {
        event.setCancelled(true);
    }
}
项目:SpigotSource    文件:WorldData.java   
public void setThundering(boolean flag) {
    // CraftBukkit start
    org.bukkit.World world = Bukkit.getWorld(getName());
    if (world != null) {
        ThunderChangeEvent thunder = new ThunderChangeEvent(world, flag);
        Bukkit.getServer().getPluginManager().callEvent(thunder);
        if (thunder.isCancelled()) {
            return;
        }

        setThunderDuration(0); // Will force a time reset
    }
    // CraftBukkit end
    this.v = flag;
}
项目:Essentials    文件:EssentialsProtectWeatherListener.java   
@EventHandler(priority = EventPriority.HIGHEST)
public void onThunderChange(final ThunderChangeEvent event)
{
    final ProtectHolder settings = prot.getSettings();

    if (!event.isCancelled() && settings.getData().isDisableThunder() && event.toThunderState())
    {
        event.setCancelled(true);
    }
}
项目:SuperSkyBros    文件:WorldListeners.java   
@EventHandler(priority = EventPriority.LOWEST)
public void thunder(ThunderChangeEvent e) {
    if (isDedicated() || isNotBlacklist(e.getWorld().getName())) {
        if (e.toThunderState()) {
            e.setCancelled(true);
        }
    }

}
项目:ZentrelaRPG    文件:EnvironmentManager.java   
@EventHandler
public void onThunderChange(ThunderChangeEvent event) {
    event.setCancelled(true);
}
项目:PA    文件:PACreativo.java   
@EventHandler(priority=EventPriority.HIGHEST)
public void onThunderChange(ThunderChangeEvent event) {
    boolean storm = event.toThunderState();
    if(storm) event.setCancelled(true);
}
项目:PA    文件:PlayerEvents.java   
@EventHandler(priority=EventPriority.HIGHEST)
public void onThunderChange(ThunderChangeEvent event) {
    if(event.toThunderState()) event.setCancelled(true);
}
项目:Skript    文件:ExprWeather.java   
@SuppressWarnings("unchecked")
@Override
public boolean setTime(final int time) {
    return super.setTime(time, getExpr(), WeatherChangeEvent.class, ThunderChangeEvent.class);
}
项目:GriefPreventionFlags    文件:FlagDef_NoWeatherChange.java   
@EventHandler(priority = EventPriority.HIGHEST)
public void onWeatherChange(ThunderChangeEvent event)
{
    this.handleEvent(event.getWorld(), event);
}
项目:Arcade2    文件:MatchListeners.java   
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onThunderChange(ThunderChangeEvent event) {
    if (this.isMatchIdle()) {
        event.setCancelled(true);
    }
}
项目:Arcade2    文件:GeneralListeners.java   
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void onThunderChange(ThunderChangeEvent event) {
    event.setCancelled(true);
}
项目:RpgPlus    文件:ScriptEventManager.java   
@EventHandler
public void onThunderChange(ThunderChangeEvent event) {
    callHandlers("weather.thunderChange", event);
}
项目:Cardinal-Plus    文件:WorldFreeze.java   
@EventHandler
public void onThunderChange(ThunderChangeEvent event) {
    event.setCancelled(true);
}
项目:CraftBukkit    文件:World.java   
protected void o() {
    if (!this.worldProvider.g) {
        if (!this.isStatic) {
            int i = this.worldData.getThunderDuration();

            if (i <= 0) {
                if (this.worldData.isThundering()) {
                    this.worldData.setThunderDuration(this.random.nextInt(12000) + 3600);
                } else {
                    this.worldData.setThunderDuration(this.random.nextInt(168000) + 12000);
                }
            } else {
                --i;
                this.worldData.setThunderDuration(i);
                if (i <= 0) {
                    // CraftBukkit start
                    ThunderChangeEvent thunder = new ThunderChangeEvent(this.getWorld(), !this.worldData.isThundering());
                    this.getServer().getPluginManager().callEvent(thunder);
                    if (!thunder.isCancelled()) {
                        this.worldData.setThundering(!this.worldData.isThundering());
                    }
                    // CraftBukkit end
                }
            }

            this.o = this.p;
            if (this.worldData.isThundering()) {
                this.p = (float) ((double) this.p + 0.01D);
            } else {
                this.p = (float) ((double) this.p - 0.01D);
            }

            this.p = MathHelper.a(this.p, 0.0F, 1.0F);
            int j = this.worldData.getWeatherDuration();

            if (j <= 0) {
                if (this.worldData.hasStorm()) {
                    this.worldData.setWeatherDuration(this.random.nextInt(12000) + 12000);
                } else {
                    this.worldData.setWeatherDuration(this.random.nextInt(168000) + 12000);
                }
            } else {
                --j;
                this.worldData.setWeatherDuration(j);
                if (j <= 0) {
                    // CraftBukkit start
                    WeatherChangeEvent weather = new WeatherChangeEvent(this.getWorld(), !this.worldData.hasStorm());
                    this.getServer().getPluginManager().callEvent(weather);

                    if (!weather.isCancelled()) {
                        this.worldData.setStorm(!this.worldData.hasStorm());
                    }
                    // CraftBukkit end
                }
            }

            this.m = this.n;
            if (this.worldData.hasStorm()) {
                this.n = (float) ((double) this.n + 0.01D);
            } else {
                this.n = (float) ((double) this.n - 0.01D);
            }

            this.n = MathHelper.a(this.n, 0.0F, 1.0F);
        }
    }
}
项目:Almura-Server    文件:World.java   
protected void o() {
    if (!this.worldProvider.g) {
        int i = this.worldData.getThunderDuration();

        if (i <= 0) {
            if (this.worldData.isThundering()) {
                this.worldData.setThunderDuration(this.random.nextInt(12000) + 3600);
            } else {
                this.worldData.setThunderDuration(this.random.nextInt(168000) + 12000);
            }
        } else {
            --i;
            this.worldData.setThunderDuration(i);
            if (i <= 0) {
                // CraftBukkit start
                ThunderChangeEvent thunder = new ThunderChangeEvent(this.getWorld(), !this.worldData.isThundering());
                this.getServer().getPluginManager().callEvent(thunder);
                if (!thunder.isCancelled()) {
                    this.worldData.setThundering(!this.worldData.isThundering());
                }
                // CraftBukkit end
            }
        }

        int j = this.worldData.getWeatherDuration();

        if (j <= 0) {
            if (this.worldData.hasStorm()) {
                this.worldData.setWeatherDuration(this.random.nextInt(12000) + 12000);
            } else {
                this.worldData.setWeatherDuration(this.random.nextInt(168000) + 12000);
            }
        } else {
            --j;
            this.worldData.setWeatherDuration(j);
            if (j <= 0) {
                // CraftBukkit start
                WeatherChangeEvent weather = new WeatherChangeEvent(this.getWorld(), !this.worldData.hasStorm());
                this.getServer().getPluginManager().callEvent(weather);

                if (!weather.isCancelled()) {
                    this.worldData.setStorm(!this.worldData.hasStorm());
                }
                // CraftBukkit end
            }
        }

        this.m = this.n;
        if (this.worldData.hasStorm()) {
            this.n = (float) ((double) this.n + 0.01D);
        } else {
            this.n = (float) ((double) this.n - 0.01D);
        }

        if (this.n < 0.0F) {
            this.n = 0.0F;
        }

        if (this.n > 1.0F) {
            this.n = 1.0F;
        }

        this.o = this.p;
        if (this.worldData.isThundering()) {
            this.p = (float) ((double) this.p + 0.01D);
        } else {
            this.p = (float) ((double) this.p - 0.01D);
        }

        if (this.p < 0.0F) {
            this.p = 0.0F;
        }

        if (this.p > 1.0F) {
            this.p = 1.0F;
        }
    }
}
项目:Tweakkit-Server    文件:World.java   
protected void o() {
    if (!this.worldProvider.g) {
        if (!this.isStatic) {
            int i = this.worldData.getThunderDuration();

            if (i <= 0) {
                if (this.worldData.isThundering()) {
                    this.worldData.setThunderDuration(this.random.nextInt(12000) + 3600);
                } else {
                    this.worldData.setThunderDuration(this.random.nextInt(168000) + 12000);
                }
            } else {
                --i;
                this.worldData.setThunderDuration(i);
                if (i <= 0) {
                    // CraftBukkit start
                    ThunderChangeEvent thunder = new ThunderChangeEvent(this.getWorld(), !this.worldData.isThundering());
                    this.getServer().getPluginManager().callEvent(thunder);
                    if (!thunder.isCancelled()) {
                        this.worldData.setThundering(!this.worldData.isThundering());
                    }
                    // CraftBukkit end
                }
            }

            this.o = this.p;
            if (this.worldData.isThundering()) {
                this.p = (float) ((double) this.p + 0.01D);
            } else {
                this.p = (float) ((double) this.p - 0.01D);
            }

            this.p = MathHelper.a(this.p, 0.0F, 1.0F);
            int j = this.worldData.getWeatherDuration();

            if (j <= 0) {
                if (this.worldData.hasStorm()) {
                    this.worldData.setWeatherDuration(this.random.nextInt(12000) + 12000);
                } else {
                    this.worldData.setWeatherDuration(this.random.nextInt(168000) + 12000);
                }
            } else {
                --j;
                this.worldData.setWeatherDuration(j);
                if (j <= 0) {
                    // CraftBukkit start
                    WeatherChangeEvent weather = new WeatherChangeEvent(this.getWorld(), !this.worldData.hasStorm());
                    this.getServer().getPluginManager().callEvent(weather);

                    if (!weather.isCancelled()) {
                        this.worldData.setStorm(!this.worldData.hasStorm());
                    }
                    // CraftBukkit end
                }
            }

            this.m = this.n;
            if (this.worldData.hasStorm()) {
                this.n = (float) ((double) this.n + 0.01D);
            } else {
                this.n = (float) ((double) this.n - 0.01D);
            }

            this.n = MathHelper.a(this.n, 0.0F, 1.0F);
        }
    }
}