mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Don't call plugin manager in Settings.
This commit is contained in:
parent
28d2a9ed2e
commit
8dbcebda53
3 changed files with 16 additions and 1 deletions
|
@ -20,6 +20,9 @@ public class EssentialsPluginListener implements Listener, IConf
|
|||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPluginEnable(final PluginEnableEvent event)
|
||||
{
|
||||
if (event.getPlugin().getName().equals("EssentialsChat")) {
|
||||
ess.getSettings().setEssentialsChatActive(true);
|
||||
}
|
||||
ess.getPermissionsHandler().checkPermissions();
|
||||
ess.getAlternativeCommandsHandler().addPlugin(event.getPlugin());
|
||||
if (!ess.getPaymentMethod().hasMethod() && ess.getPaymentMethod().setMethod(ess.getServer().getPluginManager()))
|
||||
|
@ -31,6 +34,9 @@ public class EssentialsPluginListener implements Listener, IConf
|
|||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPluginDisable(final PluginDisableEvent event)
|
||||
{
|
||||
if (event.getPlugin().getName().equals("EssentialsChat")) {
|
||||
ess.getSettings().setEssentialsChatActive(false);
|
||||
}
|
||||
ess.getPermissionsHandler().checkPermissions();
|
||||
ess.getAlternativeCommandsHandler().removePlugin(event.getPlugin());
|
||||
// Check to see if the plugin thats being disabled is the one we are using
|
||||
|
|
|
@ -181,4 +181,6 @@ public interface ISettings extends IConf
|
|||
double getMaxWalkSpeed();
|
||||
|
||||
public int getMailsPerMinute();
|
||||
|
||||
public void setEssentialsChatActive(boolean b);
|
||||
}
|
||||
|
|
|
@ -696,6 +696,7 @@ public class Settings implements ISettings
|
|||
}
|
||||
private boolean prefixsuffixconfigured = false;
|
||||
private boolean addprefixsuffix = false;
|
||||
private boolean essentialsChatActive = false;
|
||||
|
||||
private boolean _addPrefixSuffix()
|
||||
{
|
||||
|
@ -707,10 +708,16 @@ public class Settings implements ISettings
|
|||
return config.hasProperty("add-prefix-suffix");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEssentialsChatActive(boolean essentialsChatActive)
|
||||
{
|
||||
this.essentialsChatActive = essentialsChatActive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addPrefixSuffix()
|
||||
{
|
||||
return prefixsuffixconfigured ? addprefixsuffix : ess.getServer().getPluginManager().isPluginEnabled("EssentialsChat");
|
||||
return prefixsuffixconfigured ? addprefixsuffix : essentialsChatActive;
|
||||
}
|
||||
private boolean disablePrefix = false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue