mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-12 01:25:26 +02:00
Reload Users and Protect on /essentials reload.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1411 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
@@ -187,6 +187,11 @@ public class Essentials extends JavaPlugin
|
|||||||
{
|
{
|
||||||
iConf.reloadConfig();
|
iConf.reloadConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (User user : users.values())
|
||||||
|
{
|
||||||
|
user.reloadConfig();
|
||||||
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -644,4 +649,9 @@ public class Essentials extends JavaPlugin
|
|||||||
{
|
{
|
||||||
return iConomyFallback;
|
return iConomyFallback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addReloadListener(IConf listener)
|
||||||
|
{
|
||||||
|
confList.add(listener);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
package com.earth2me.essentials.protect;
|
package com.earth2me.essentials.protect;
|
||||||
|
|
||||||
import com.earth2me.essentials.Essentials;
|
import com.earth2me.essentials.Essentials;
|
||||||
|
import com.earth2me.essentials.IConf;
|
||||||
import com.earth2me.essentials.User;
|
import com.earth2me.essentials.User;
|
||||||
import com.earth2me.essentials.Util;
|
import com.earth2me.essentials.Util;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -16,7 +17,7 @@ import org.bukkit.plugin.PluginManager;
|
|||||||
import org.bukkit.plugin.java.JavaPlugin;
|
import org.bukkit.plugin.java.JavaPlugin;
|
||||||
|
|
||||||
|
|
||||||
public class EssentialsProtect extends JavaPlugin
|
public class EssentialsProtect extends JavaPlugin implements IConf
|
||||||
{
|
{
|
||||||
private EssentialsProtectBlockListener blockListener = null;
|
private EssentialsProtectBlockListener blockListener = null;
|
||||||
private EssentialsProtectPlayerListener playerListener = null;
|
private EssentialsProtectPlayerListener playerListener = null;
|
||||||
@@ -76,7 +77,8 @@ public class EssentialsProtect extends JavaPlugin
|
|||||||
//serverlistener
|
//serverlistener
|
||||||
pm.registerEvent(Type.PLUGIN_ENABLE, serverListener, Priority.Highest, this);
|
pm.registerEvent(Type.PLUGIN_ENABLE, serverListener, Priority.Highest, this);
|
||||||
|
|
||||||
loadSettings();
|
reloadConfig();
|
||||||
|
Essentials.getStatic().addReloadListener(this);
|
||||||
if (!this.getDescription().getVersion().equals(Essentials.getStatic().getDescription().getVersion())) {
|
if (!this.getDescription().getVersion().equals(Essentials.getStatic().getDescription().getVersion())) {
|
||||||
logger.log(Level.WARNING, Util.i18n("versionMismatchAll"));
|
logger.log(Level.WARNING, Util.i18n("versionMismatchAll"));
|
||||||
}
|
}
|
||||||
@@ -108,7 +110,7 @@ public class EssentialsProtect extends JavaPlugin
|
|||||||
onBreakAlert = null;
|
onBreakAlert = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadSettings()
|
public void reloadConfig()
|
||||||
{
|
{
|
||||||
dataSettings = Essentials.getStatic().getSettings().getEpDBSettings();
|
dataSettings = Essentials.getStatic().getSettings().getEpDBSettings();
|
||||||
genSettings = Essentials.getStatic().getSettings().getEpSettings();
|
genSettings = Essentials.getStatic().getSettings().getEpSettings();
|
||||||
|
Reference in New Issue
Block a user