1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-12 17:45:08 +02:00

If Essentials core fails to read one of the configs now, it will disable itself. If other modules detect that Essentials is not enabled, they will be disabled too. EssentialsProtect will go into emergency mode, canceling all events that could hurt your world. Fix the file and either restart or reload the server.

This commit is contained in:
snowleo
2011-11-30 20:48:42 +01:00
parent 15d8ec6026
commit 5e2123c91e
18 changed files with 232 additions and 57 deletions

View File

@@ -21,6 +21,15 @@ public class EssentialsChat extends JavaPlugin
{
final PluginManager pluginManager = getServer().getPluginManager();
final IEssentials ess = (IEssentials)pluginManager.getPlugin("Essentials");
if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
{
LOGGER.log(Level.WARNING, _("versionMismatchAll"));
}
if (!ess.isEnabled())
{
this.setEnabled(false);
return;
}
chatListener = new HashMap<String, IEssentialsChatListener>();
@@ -30,16 +39,16 @@ public class EssentialsChat extends JavaPlugin
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerLowest, Priority.Lowest, this);
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerNormal, Priority.Normal, this);
pluginManager.registerEvent(Type.PLAYER_CHAT, playerListenerHighest, Priority.Highest, this);
if (!this.getDescription().getVersion().equals(ess.getDescription().getVersion()))
{
LOGGER.log(Level.WARNING, _("versionMismatchAll"));
}
LOGGER.info(_("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), "essentials team"));
}
public void onDisable()
{
chatListener.clear();
if (chatListener != null)
{
chatListener.clear();
}
}
public void addEssentialsChatListener(final String plugin, final IEssentialsChatListener listener)