Added permissions manager to main class, along with a setup and get method

This commit is contained in:
Tim Visée 2015-11-20 20:01:31 +01:00
parent f17f1fe5fb
commit 82e65250b8

View File

@ -12,6 +12,7 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger;
import fr.xephi.authme.listener.*;
import fr.xephi.authme.permission.PermissionsManager;
import org.apache.logging.log4j.LogManager;
import org.bukkit.Bukkit;
import org.bukkit.Location;
@ -76,6 +77,7 @@ public class AuthMe extends JavaPlugin {
// TODO: Move this to a better place! -- timvisee
private CommandHandler commandHandler = null;
private PermissionsManager permsMan = null;
public Management management;
public NewAPI api;
@ -140,6 +142,9 @@ public class AuthMe extends JavaPlugin {
authmeLogger = Logger.getLogger("AuthMe");
plugin = this;
// Set up the permissions manager
setupPermissionsManager();
// Set up and initialize the command handler
this.commandHandler = new CommandHandler(false);
this.commandHandler.init();
@ -449,6 +454,23 @@ public class AuthMe extends JavaPlugin {
}
}
/**
* Set up the permissions manager.
*/
public void setupPermissionsManager() {
this.permsMan = new PermissionsManager(Bukkit.getServer(), this, this.authmeLogger);
this.permsMan.setup();
}
/**
* Get the permissions manager instance.
*
* @return Permissions Manager instance.
*/
public PermissionsManager getPermissionsManager() {
return this.permsMan;
}
// Set the console filter to remove the passwords
private void setLog4JFilter() {
Bukkit.getScheduler().scheduleSyncDelayedTask(this, new Runnable() {