mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-03 16:04:26 +01:00
Fixed compilation with Bukkit >= CB1564.
Sorry, this breaks compatibility with builds < CB1193.
This commit is contained in:
parent
875b9f326c
commit
5bcac17f1c
@ -1,88 +0,0 @@
|
|||||||
package com.sk89q.worldguard.bukkit;
|
|
||||||
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import org.bukkit.Server;
|
|
||||||
import org.bukkit.command.ConsoleCommandSender;
|
|
||||||
import org.bukkit.permissions.Permission;
|
|
||||||
import org.bukkit.permissions.PermissionAttachment;
|
|
||||||
import org.bukkit.permissions.PermissionAttachmentInfo;
|
|
||||||
import org.bukkit.plugin.Plugin;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Console sender.
|
|
||||||
*
|
|
||||||
* @author sk89q
|
|
||||||
*/
|
|
||||||
class LegacyConsoleSender extends ConsoleCommandSender {
|
|
||||||
private Server server;
|
|
||||||
|
|
||||||
public LegacyConsoleSender(Server server) {
|
|
||||||
super(server);
|
|
||||||
this.server = server;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void sendMessage(String message) {
|
|
||||||
WorldGuardPlugin.logger.info(message);
|
|
||||||
}
|
|
||||||
|
|
||||||
public Server getServer() {
|
|
||||||
return server;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getName() {
|
|
||||||
return "CONSOLE";
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPermissionSet(String name) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPermissionSet(Permission perm) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasPermission(String name) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasPermission(Permission perm) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PermissionAttachment addAttachment(Plugin plugin, String name,
|
|
||||||
boolean value) {
|
|
||||||
throw new UnsupportedOperationException("Fake legacy console command sender does not support this");
|
|
||||||
}
|
|
||||||
|
|
||||||
public PermissionAttachment addAttachment(Plugin plugin) {
|
|
||||||
throw new UnsupportedOperationException("Fake legacy console command sender does not support this");
|
|
||||||
}
|
|
||||||
|
|
||||||
public PermissionAttachment addAttachment(Plugin plugin, String name,
|
|
||||||
boolean value, int ticks) {
|
|
||||||
throw new UnsupportedOperationException("Fake legacy console command sender does not support this");
|
|
||||||
}
|
|
||||||
|
|
||||||
public PermissionAttachment addAttachment(Plugin plugin, int ticks) {
|
|
||||||
throw new UnsupportedOperationException("Fake legacy console command sender does not support this");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void removeAttachment(PermissionAttachment attachment) {
|
|
||||||
throw new UnsupportedOperationException("Fake legacy console command sender does not support this");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void recalculatePermissions() {
|
|
||||||
}
|
|
||||||
|
|
||||||
public Set<PermissionAttachmentInfo> getEffectivePermissions() {
|
|
||||||
throw new UnsupportedOperationException("Fake legacy console command sender does not support this");
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isOp() {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOp(boolean value) {
|
|
||||||
}
|
|
||||||
}
|
|
@ -569,12 +569,7 @@ public CommandSender matchPlayerOrConsole(CommandSender sender, String filter)
|
|||||||
if (filter.equalsIgnoreCase("#console")
|
if (filter.equalsIgnoreCase("#console")
|
||||||
|| filter.equalsIgnoreCase("*console*")
|
|| filter.equalsIgnoreCase("*console*")
|
||||||
|| filter.equalsIgnoreCase("!")) {
|
|| filter.equalsIgnoreCase("!")) {
|
||||||
try {
|
|
||||||
return getServer().getConsoleSender();
|
return getServer().getConsoleSender();
|
||||||
} catch (Throwable t) {
|
|
||||||
// Legacy support
|
|
||||||
return new LegacyConsoleSender(getServer());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return matchSinglePlayer(sender, filter);
|
return matchSinglePlayer(sender, filter);
|
||||||
|
Loading…
Reference in New Issue
Block a user