summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-10 21:14:38 +0000
committersnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-10 21:14:38 +0000
commit300f9c33cccc3d192d47656f38d286d0cf58588d (patch)
treecf6af426d78a1a1f3f4cb66dd2895c95cdb94a2f
parent87b0ae26958e5a3105a4e064befe164ec039bc4f (diff)
downloadEssentials-300f9c33cccc3d192d47656f38d286d0cf58588d.tar
Essentials-300f9c33cccc3d192d47656f38d286d0cf58588d.tar.gz
Essentials-300f9c33cccc3d192d47656f38d286d0cf58588d.tar.lz
Essentials-300f9c33cccc3d192d47656f38d286d0cf58588d.tar.xz
Essentials-300f9c33cccc3d192d47656f38d286d0cf58588d.zip
Reload Users and Protect on /essentials reload.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1411 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r--Essentials/src/com/earth2me/essentials/Essentials.java10
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java8
2 files changed, 15 insertions, 3 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java
index 40f68a6fd..879876572 100644
--- a/Essentials/src/com/earth2me/essentials/Essentials.java
+++ b/Essentials/src/com/earth2me/essentials/Essentials.java
@@ -187,6 +187,11 @@ public class Essentials extends JavaPlugin
{
iConf.reloadConfig();
}
+
+ for (User user : users.values())
+ {
+ user.reloadConfig();
+ }
try
{
@@ -644,4 +649,9 @@ public class Essentials extends JavaPlugin
{
return iConomyFallback;
}
+
+ public void addReloadListener(IConf listener)
+ {
+ confList.add(listener);
+ }
}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java
index 337b2c107..d1fbb786a 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtect.java
@@ -1,6 +1,7 @@
package com.earth2me.essentials.protect;
import com.earth2me.essentials.Essentials;
+import com.earth2me.essentials.IConf;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.ArrayList;
@@ -16,7 +17,7 @@ import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
-public class EssentialsProtect extends JavaPlugin
+public class EssentialsProtect extends JavaPlugin implements IConf
{
private EssentialsProtectBlockListener blockListener = null;
private EssentialsProtectPlayerListener playerListener = null;
@@ -76,7 +77,8 @@ public class EssentialsProtect extends JavaPlugin
//serverlistener
pm.registerEvent(Type.PLUGIN_ENABLE, serverListener, Priority.Highest, this);
- loadSettings();
+ reloadConfig();
+ Essentials.getStatic().addReloadListener(this);
if (!this.getDescription().getVersion().equals(Essentials.getStatic().getDescription().getVersion())) {
logger.log(Level.WARNING, Util.i18n("versionMismatchAll"));
}
@@ -108,7 +110,7 @@ public class EssentialsProtect extends JavaPlugin
onBreakAlert = null;
}
- public static void loadSettings()
+ public void reloadConfig()
{
dataSettings = Essentials.getStatic().getSettings().getEpDBSettings();
genSettings = Essentials.getStatic().getSettings().getEpSettings();