geforkt von Mirrors/FastAsyncWorldEdit
Removed some unnecessary checks and fixed compatibility with CraftBook and other plugins that load() before registering the server listener
Dieser Commit ist enthalten in:
Ursprung
258bdc11b0
Commit
745716426f
@ -21,21 +21,19 @@ package com.sk89q.bukkit.migration;
|
|||||||
|
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import com.sk89q.wepif.WEPIFRuntimeException;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public class PermissionsResolverManager implements PermissionsProvider {
|
public class PermissionsResolverManager implements PermissionsProvider {
|
||||||
private static boolean setUp;
|
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public PermissionsResolverManager(org.bukkit.util.config.Configuration config, Server server, String name, Logger logger) {}
|
public PermissionsResolverManager(org.bukkit.util.config.Configuration config, Server server, String name, Logger logger) {}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public PermissionsResolverManager(Plugin plugin, String name, Logger logger) {
|
public PermissionsResolverManager(Plugin plugin, String name, Logger logger) {
|
||||||
if (!setUp) {
|
setUp(plugin);
|
||||||
setUp(plugin);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
@ -50,7 +48,11 @@ public class PermissionsResolverManager implements PermissionsProvider {
|
|||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void load() {
|
public void load() {
|
||||||
|
try {
|
||||||
getRealResolver().load();
|
getRealResolver().load();
|
||||||
|
} catch (WEPIFRuntimeException ignore) {
|
||||||
|
// Some plugins do this very early in the initialization process
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasPermission(String name, String permission) {
|
public boolean hasPermission(String name, String permission) {
|
||||||
@ -72,17 +74,12 @@ public class PermissionsResolverManager implements PermissionsProvider {
|
|||||||
public String getDetectionMessage() {
|
public String getDetectionMessage() {
|
||||||
return getRealResolver().getDetectionMessage();
|
return getRealResolver().getDetectionMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean isSetUp() {
|
|
||||||
return setUp;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setUp(Plugin plugin) {
|
void setUp(Plugin plugin) {
|
||||||
com.sk89q.wepif.PermissionsResolverManager.initialize(plugin);
|
com.sk89q.wepif.PermissionsResolverManager.initialize(plugin);
|
||||||
setUp = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public com.sk89q.wepif.PermissionsResolverManager getRealResolver() {
|
private com.sk89q.wepif.PermissionsResolverManager getRealResolver() {
|
||||||
return com.sk89q.wepif.PermissionsResolverManager.getInstance();
|
return com.sk89q.wepif.PermissionsResolverManager.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,9 +39,7 @@ public class PermissionsResolverServerListener extends ServerListener {
|
|||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void register(Plugin plugin) {
|
public void register(Plugin plugin) {
|
||||||
if (!manager.isSetUp()) {
|
manager.setUp(plugin);
|
||||||
manager.setUp(plugin);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren