#421 Create PluginHooks

- PluginHooks manages third-party plugins and allows to perform actions and queries on them, instead of public fields on the AuthMe main class
This commit is contained in:
ljacqu
2016-03-12 08:50:26 +01:00
parent 45fd241517
commit 8b27444a49
12 changed files with 273 additions and 186 deletions
@@ -25,7 +25,8 @@ public class PurgeBannedPlayersCommand implements ExecutableCommand {
// Purge the banned players
plugin.getDataSource().purgeBanned(bannedPlayers);
if (commandService.getProperty(PurgeSettings.REMOVE_ESSENTIALS_FILES) && plugin.ess != null)
if (commandService.getProperty(PurgeSettings.REMOVE_ESSENTIALS_FILES)
&& commandService.getPluginHooks().isEssentialsAvailable())
plugin.dataManager.purgeEssentials(bannedPlayers);
if (commandService.getProperty(PurgeSettings.REMOVE_PLAYER_DAT))
plugin.dataManager.purgeDat(bannedPlayers);
@@ -47,7 +47,8 @@ public class PurgeCommand implements ExecutableCommand {
sender.sendMessage(ChatColor.GOLD + "Deleted " + purged.size() + " user accounts");
// Purge other data
if (commandService.getProperty(PurgeSettings.REMOVE_ESSENTIALS_FILES) && plugin.ess != null)
if (commandService.getProperty(PurgeSettings.REMOVE_ESSENTIALS_FILES) &&
commandService.getPluginHooks().isEssentialsAvailable())
plugin.dataManager.purgeEssentials(purged);
if (commandService.getProperty(PurgeSettings.REMOVE_PLAYER_DAT))
plugin.dataManager.purgeDat(purged);