From 28f322c0a6cad4498674417e991e0168ad8ea6fe Mon Sep 17 00:00:00 2001 From: ementalo Date: Wed, 27 Apr 2011 01:33:45 +0000 Subject: [trunk] added new config settings to disable weather. you can disable storm / thunder and lightning seperately. git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1284 e251c2fe-e539-e718-e476-b85c1f46cddb --- .../com/earth2me/essentials/protect/EssentialsProtect.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java') diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java index d66fcca12..7a0baecdb 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java @@ -20,6 +20,7 @@ public class EssentialsProtect extends JavaPlugin private EssentialsProtectBlockListener blockListener = null; private EssentialsProtectPlayerListener playerListener = null; private EssentialsProtectEntityListener entityListener = null; + private EssentialsProtectWeatherListener weatherListener = null; public static final String AUTHORS = Essentials.AUTHORS; private static final Logger logger = Logger.getLogger("Minecraft"); public static HashMap genSettings = null; @@ -33,7 +34,6 @@ public class EssentialsProtect extends JavaPlugin public static ArrayList onUseAlert = null; public static ArrayList onBreakAlert = null; - public EssentialsProtect() { } @@ -48,6 +48,7 @@ public class EssentialsProtect extends JavaPlugin playerListener = new EssentialsProtectPlayerListener(this); blockListener = new EssentialsProtectBlockListener(this); entityListener = new EssentialsProtectEntityListener(this); + weatherListener = new EssentialsProtectWeatherListener(this); pm.registerEvent(Type.PLAYER_INTERACT, playerListener, Priority.Low, this); pm.registerEvent(Type.BLOCK_PLACE, blockListener, Priority.Highest, this); pm.registerEvent(Type.BLOCK_FROMTO, blockListener, Priority.Highest, this); @@ -58,9 +59,12 @@ public class EssentialsProtect extends JavaPlugin pm.registerEvent(Type.ENTITY_TARGET, entityListener, Priority.Highest, this); pm.registerEvent(Type.BLOCK_BREAK, blockListener, Priority.Highest, this); pm.registerEvent(Type.CREATURE_SPAWN, entityListener, Priority.Highest, this); - + pm.registerEvent(Type.WEATHER_CHANGE, weatherListener, Priority.Highest, this); + pm.registerEvent(Type.THUNDER_CHANGE, weatherListener, Priority.Highest, this); + pm.registerEvent(Type.LIGHTNING_STRIKE, weatherListener, Priority.Highest, this); loadSettings(); - if (!this.getDescription().getVersion().equals(Essentials.getStatic().getDescription().getVersion())) { + if (!this.getDescription().getVersion().equals(Essentials.getStatic().getDescription().getVersion())) + { logger.log(Level.WARNING, "Version mismatch! Please update all Essentials jars to the same version."); } logger.info("Loaded " + this.getDescription().getName() + " build " + this.getDescription().getVersion() + " maintained by " + AUTHORS); @@ -76,7 +80,7 @@ public class EssentialsProtect extends JavaPlugin { genSettings.clear(); dataSettings.clear(); - + blockListener = null; playerListener = null; entityListener = null; -- cgit v1.2.3