mirror of
https://github.com/EngineHub/WorldEdit.git
synced 2024-12-27 05:00:08 +08:00
Removed the com.sk89q.bukkit.migration package and LegacyPermissionsProviderWrapper.
This restores compatibility with the latest Bukkit builds.
This commit is contained in:
parent
20315f10ef
commit
247e8b163d
@ -1,32 +0,0 @@
|
|||||||
// $Id$
|
|
||||||
/*
|
|
||||||
* WorldEdit
|
|
||||||
* Copyright (C) 2010, 2011 sk89q <http://www.sk89q.com> and contributors
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.sk89q.bukkit.migration;
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public interface PermissionsProvider {
|
|
||||||
public boolean hasPermission(String name, String permission);
|
|
||||||
|
|
||||||
public boolean hasPermission(String worldName, String name, String permission);
|
|
||||||
|
|
||||||
public boolean inGroup(String player, String group);
|
|
||||||
|
|
||||||
public String[] getGroups(String player);
|
|
||||||
|
|
||||||
}
|
|
@ -1,25 +0,0 @@
|
|||||||
// $Id$
|
|
||||||
/*
|
|
||||||
* WorldEdit
|
|
||||||
* Copyright (C) 2010 sk89q <http://www.sk89q.com> and contributors
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.sk89q.bukkit.migration;
|
|
||||||
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public interface PermissionsResolver extends com.sk89q.wepif.PermissionsResolver {
|
|
||||||
}
|
|
@ -1,86 +0,0 @@
|
|||||||
// $Id$
|
|
||||||
/*
|
|
||||||
* WorldEdit
|
|
||||||
* Copyright (C) 2010 sk89q <http://www.sk89q.com> and contributors
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.sk89q.bukkit.migration;
|
|
||||||
|
|
||||||
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 {
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public PermissionsResolverManager(org.bukkit.util.config.Configuration config, Server server, String name, Logger logger) {}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public PermissionsResolverManager(Plugin plugin, String name, Logger logger) {
|
|
||||||
setUp(plugin);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public void findResolver() {
|
|
||||||
getRealResolver().findResolver();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public void setPluginPermissionsResolver(Plugin plugin) {
|
|
||||||
getRealResolver().setPluginPermissionsResolver(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) {
|
|
||||||
return getRealResolver().hasPermission(name, permission);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasPermission(String worldName, String name, String permission) {
|
|
||||||
return getRealResolver().hasPermission(worldName, name, permission);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean inGroup(String player, String group) {
|
|
||||||
return getRealResolver().inGroup(player, group);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String[] getGroups(String player) {
|
|
||||||
return getRealResolver().getGroups(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDetectionMessage() {
|
|
||||||
return getRealResolver().getDetectionMessage();
|
|
||||||
}
|
|
||||||
|
|
||||||
void setUp(Plugin plugin) {
|
|
||||||
com.sk89q.wepif.PermissionsResolverManager.initialize(plugin);
|
|
||||||
}
|
|
||||||
|
|
||||||
private com.sk89q.wepif.PermissionsResolverManager getRealResolver() {
|
|
||||||
return com.sk89q.wepif.PermissionsResolverManager.getInstance();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,45 +0,0 @@
|
|||||||
// $Id$
|
|
||||||
/*
|
|
||||||
* WorldEdit
|
|
||||||
* Copyright (C) 2010 sk89q <http://www.sk89q.com> and contributors
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.sk89q.bukkit.migration;
|
|
||||||
|
|
||||||
import org.bukkit.event.server.ServerListener;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public class PermissionsResolverServerListener extends ServerListener {
|
|
||||||
private PermissionsResolverManager manager;
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public PermissionsResolverServerListener(PermissionsResolverManager manager) {
|
|
||||||
this.manager = manager;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public PermissionsResolverServerListener(PermissionsResolverManager manager, Plugin plugin) {
|
|
||||||
this.manager = manager;
|
|
||||||
register(plugin);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public void register(Plugin plugin) {
|
|
||||||
manager.setUp(plugin);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,81 +0,0 @@
|
|||||||
// $Id$
|
|
||||||
/*
|
|
||||||
* WorldEdit
|
|
||||||
* Copyright (C) 2010 sk89q <http://www.sk89q.com> and contributors
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.sk89q.wepif;
|
|
||||||
|
|
||||||
import org.bukkit.OfflinePlayer;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
|
||||||
public class LegacyPermissionsProviderWrapper implements PermissionsProvider {
|
|
||||||
private final com.sk89q.bukkit.migration.PermissionsProvider legacyPermissionsProvider;
|
|
||||||
|
|
||||||
static PermissionsProvider wrap(Plugin plugin) {
|
|
||||||
if (!(plugin instanceof com.sk89q.bukkit.migration.PermissionsProvider)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
final com.sk89q.bukkit.migration.PermissionsProvider legacyPermissionsProvider = (com.sk89q.bukkit.migration.PermissionsProvider) plugin;
|
|
||||||
return new LegacyPermissionsProviderWrapper(legacyPermissionsProvider);
|
|
||||||
}
|
|
||||||
|
|
||||||
private LegacyPermissionsProviderWrapper(com.sk89q.bukkit.migration.PermissionsProvider legacyPermissionsProvider) {
|
|
||||||
this.legacyPermissionsProvider = legacyPermissionsProvider;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasPermission(String name, String permission) {
|
|
||||||
return legacyPermissionsProvider.hasPermission(name, permission);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasPermission(String worldName, String name, String permission) {
|
|
||||||
return legacyPermissionsProvider.hasPermission(worldName, name, permission);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean inGroup(String player, String group) {
|
|
||||||
return legacyPermissionsProvider.inGroup(player, group);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getGroups(String player) {
|
|
||||||
return legacyPermissionsProvider.getGroups(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasPermission(OfflinePlayer player, String permission) {
|
|
||||||
return legacyPermissionsProvider.hasPermission(player.getName(), permission);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasPermission(String worldName, OfflinePlayer player, String permission) {
|
|
||||||
return legacyPermissionsProvider.hasPermission(worldName, player.getName(), permission);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean inGroup(OfflinePlayer player, String group) {
|
|
||||||
return legacyPermissionsProvider.inGroup(player.getName(), group);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String[] getGroups(OfflinePlayer player) {
|
|
||||||
return legacyPermissionsProvider.getGroups(player.getName());
|
|
||||||
}
|
|
||||||
}
|
|
@ -43,11 +43,6 @@ public static PermissionsResolver factory(Server server, YAMLProcessor config) {
|
|||||||
if (plugin instanceof PermissionsProvider) {
|
if (plugin instanceof PermissionsProvider) {
|
||||||
return new PluginPermissionsResolver((PermissionsProvider) plugin, plugin);
|
return new PluginPermissionsResolver((PermissionsProvider) plugin, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
final PermissionsProvider legacyPermissionsProvider = LegacyPermissionsProviderWrapper.wrap(plugin);
|
|
||||||
if (legacyPermissionsProvider != null) {
|
|
||||||
return new PluginPermissionsResolver(legacyPermissionsProvider, plugin);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
Reference in New Issue
Block a user