Minor cleanup of WEPIF constructors

Dieser Commit ist enthalten in:
zml2008 2011-09-07 17:56:23 -07:00
Ursprung 703131107d
Commit 6b3f19f857
3 geänderte Dateien mit 21 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -58,6 +58,7 @@ public class PermissionsResolverManager implements PermissionsResolver {
private Logger logger;
protected boolean ignoreNijiPermsBridges;
@Deprecated
public PermissionsResolverManager(Configuration config, Server server, String name, Logger logger) {
this.server = server;
this.name = name;
@ -65,6 +66,15 @@ public class PermissionsResolverManager implements PermissionsResolver {
loadConfig(new File("wepif.yml")); // TODO: config migration, maybe
findResolver();
}
public PermissionsResolverManager(Plugin plugin, String name, Logger logger) {
this.server = plugin.getServer();
this.name = name;
this.logger = logger;
new PermissionsResolverServerListener(this, plugin);
loadConfig(new File("wepif.yml")); // TODO: config migration, maybe
findResolver();
}
public void findResolver() {
if (tryPluginPermissionsResolver()) return;
if (tryNijiPermissions()) return;

Datei anzeigen

@ -29,10 +29,16 @@ import org.bukkit.plugin.Plugin;
public class PermissionsResolverServerListener extends ServerListener {
private PermissionsResolverManager manager;
@Deprecated
public PermissionsResolverServerListener(PermissionsResolverManager manager) {
this.manager = manager;
}
public PermissionsResolverServerListener(PermissionsResolverManager manager, Plugin plugin) {
this.manager = manager;
register(plugin);
}
/**
* Called when a plugin is enabled
*

Datei anzeigen

@ -87,8 +87,7 @@ public class WorldEditPlugin extends JavaPlugin {
// Set up configuration and such, including the permissions
// resolver
config = new BukkitConfiguration(getConfiguration(), logger);
perms = new PermissionsResolverManager(
getConfiguration(), getServer(), "WorldEdit", logger);
perms = new PermissionsResolverManager(this, "WorldEdit", logger);
// Load the configuration
loadConfiguration();
@ -138,13 +137,13 @@ public class WorldEditPlugin extends JavaPlugin {
new WorldEditCriticalPlayerListener(this);
// The permissions resolver has some hooks of its own
(new PermissionsResolverServerListener(perms)).register(this);
new PermissionsResolverServerListener(perms, this);
}
/**
* Register an event.
*
* @param type
* @param typeName
* @param listener
* @param priority
*/
@ -160,7 +159,7 @@ public class WorldEditPlugin extends JavaPlugin {
/**
* Register an event at normal priority.
*
* @param type
* @param typeName
* @param listener
*/
public void registerEvent(String typeName, Listener listener) {