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

项目:Skript    文件:CondWeather.java   
@Override
public boolean check(final Event e) {
    return worlds.check(e, new Checker<World>() {
        @Override
        public boolean check(final World w) {
            final WeatherType t;
            if (e instanceof WeatherEvent && w.equals(((WeatherEvent) e).getWorld()) && !Delay.isDelayed(e)) {
                t = WeatherType.fromEvent((WeatherEvent) e);
            } else {
                t = WeatherType.fromWorld(w);
            }
            return weathers.check(e, new Checker<WeatherType>() {
                @Override
                public boolean check(final WeatherType wt) {
                    return wt == t;
                }
            }, isNegated());
        }
    });
}
项目:Skript    文件:ExprWeather.java   
@Override
protected WeatherType[] get(final Event e, final World[] source) {
    return get(source, new Getter<WeatherType, World>() {
        @Override
        public WeatherType get(final World w) {
            if (getTime() >= 0 && e instanceof WeatherEvent && w.equals(((WeatherEvent) e).getWorld()) && !Delay.isDelayed(e))
                return WeatherType.fromEvent((WeatherEvent) e);
            else
                return WeatherType.fromWorld(w);
        }
    });
}