summaryrefslogtreecommitdiffstats
path: root/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectWeatherListener.java
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-09-19 21:07:50 +0100
committerKHobbits <rob@khobbits.co.uk>2012-09-19 21:07:50 +0100
commit44d8c854504546917091543b7ce3a9dbab239e53 (patch)
tree3cc2555358fd13ad22e66142906a4ca21f5c29f4 /EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectWeatherListener.java
parent2a8e44dda89d9c4b3ea7a79352473c000fb4633e (diff)
downloadEssentials-44d8c854504546917091543b7ce3a9dbab239e53.tar
Essentials-44d8c854504546917091543b7ce3a9dbab239e53.tar.gz
Essentials-44d8c854504546917091543b7ce3a9dbab239e53.tar.lz
Essentials-44d8c854504546917091543b7ce3a9dbab239e53.tar.xz
Essentials-44d8c854504546917091543b7ce3a9dbab239e53.zip
ignoreCancelled events.
Diffstat (limited to 'EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectWeatherListener.java')
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectWeatherListener.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectWeatherListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectWeatherListener.java
index 1b8dd19ff..1e5fa6da3 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectWeatherListener.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectWeatherListener.java
@@ -17,11 +17,10 @@ public class EssentialsProtectWeatherListener implements Listener
this.prot = prot;
}
- @EventHandler(priority = EventPriority.HIGHEST)
+ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onWeatherChange(final WeatherChangeEvent event)
{
- if (!event.isCancelled()
- && prot.getSettingBool(ProtectConfig.disable_weather_storm)
+ if (prot.getSettingBool(ProtectConfig.disable_weather_storm)
&& event.toWeatherState())
{
event.setCancelled(true);
@@ -29,21 +28,19 @@ public class EssentialsProtectWeatherListener implements Listener
}
- @EventHandler(priority = EventPriority.HIGHEST)
+ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onLightningStrike(final LightningStrikeEvent event)
{
- if (!event.isCancelled()
- && prot.getSettingBool(ProtectConfig.disable_weather_lightning))
+ if (prot.getSettingBool(ProtectConfig.disable_weather_lightning))
{
event.setCancelled(true);
}
}
- @EventHandler(priority = EventPriority.HIGHEST)
+ @EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onThunderChange(final ThunderChangeEvent event)
{
- if (!event.isCancelled()
- && prot.getSettingBool(ProtectConfig.disable_weather_thunder)
+ if (prot.getSettingBool(ProtectConfig.disable_weather_thunder)
&& event.toThunderState())
{
event.setCancelled(true);