mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-27 05:00:08 +08:00
Removed some unnecessary checks and fixed compatibility with CraftBook and other plugins that load() before registering the server listener
This commit is contained in:
parent
258bdc11b0
commit
745716426f
@ -21,21 +21,19 @@
|
||||
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import com.sk89q.wepif.WEPIFRuntimeException;
|
||||
import org.bukkit.Server;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
@Deprecated
|
||||
public class PermissionsResolverManager implements PermissionsProvider {
|
||||
private static boolean setUp;
|
||||
|
||||
@Deprecated
|
||||
public PermissionsResolverManager(org.bukkit.util.config.Configuration config, Server server, String name, Logger logger) {}
|
||||
|
||||
@Deprecated
|
||||
public PermissionsResolverManager(Plugin plugin, String name, Logger logger) {
|
||||
if (!setUp) {
|
||||
setUp(plugin);
|
||||
}
|
||||
setUp(plugin);
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ -50,7 +48,11 @@ public void setPluginPermissionsResolver(Plugin plugin) {
|
||||
|
||||
@Deprecated
|
||||
public void load() {
|
||||
try {
|
||||
getRealResolver().load();
|
||||
} catch (WEPIFRuntimeException ignore) {
|
||||
// Some plugins do this very early in the initialization process
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasPermission(String name, String permission) {
|
||||
@ -72,17 +74,12 @@ public String[] getGroups(String player) {
|
||||
public String getDetectionMessage() {
|
||||
return getRealResolver().getDetectionMessage();
|
||||
}
|
||||
|
||||
boolean isSetUp() {
|
||||
return setUp;
|
||||
}
|
||||
|
||||
void setUp(Plugin 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();
|
||||
}
|
||||
|
||||
|
@ -39,9 +39,7 @@ public PermissionsResolverServerListener(PermissionsResolverManager manager, Plu
|
||||
|
||||
@Deprecated
|
||||
public void register(Plugin plugin) {
|
||||
if (!manager.isSetUp()) {
|
||||
manager.setUp(plugin);
|
||||
}
|
||||
manager.setUp(plugin);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user