diff options
author | Thinkofdeath <thinkofdeath@spigotmc.org> | 2015-01-04 23:36:55 +0000 |
---|---|---|
committer | Thinkofdeath <thinkofdeath@spigotmc.org> | 2015-01-04 23:36:55 +0000 |
commit | 5b92dc3d0a531468fa5b5ed6501dfe295b186e39 (patch) | |
tree | 4ab6c86200579026b40004c8427e120c254c9d6a /src/main/java/org/bukkit | |
parent | 6ac32df219e6c00a404a3bec847ad87a9b699ad6 (diff) | |
download | craftbukkit-5b92dc3d0a531468fa5b5ed6501dfe295b186e39.tar craftbukkit-5b92dc3d0a531468fa5b5ed6501dfe295b186e39.tar.gz craftbukkit-5b92dc3d0a531468fa5b5ed6501dfe295b186e39.tar.lz craftbukkit-5b92dc3d0a531468fa5b5ed6501dfe295b186e39.tar.xz craftbukkit-5b92dc3d0a531468fa5b5ed6501dfe295b186e39.zip |
Whoops missed a file
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java | 126 |
1 files changed, 126 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java b/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java new file mode 100644 index 00000000..9acd92c3 --- /dev/null +++ b/src/main/java/org/bukkit/craftbukkit/command/ProxiedNativeCommandSender.java @@ -0,0 +1,126 @@ + +package org.bukkit.craftbukkit.command; + +import java.util.Set; +import net.minecraft.server.ICommandListener; + +import org.bukkit.Server; +import org.bukkit.command.CommandSender; +import org.bukkit.command.ProxiedCommandSender; +import org.bukkit.permissions.Permission; +import org.bukkit.permissions.PermissionAttachment; +import org.bukkit.permissions.PermissionAttachmentInfo; +import org.bukkit.plugin.Plugin; + +public class ProxiedNativeCommandSender implements ProxiedCommandSender { + + private final ICommandListener orig; + private final CommandSender caller; + private final CommandSender callee; + + public ProxiedNativeCommandSender(ICommandListener orig, CommandSender caller, CommandSender callee) { + this.orig = orig; + this.caller = caller; + this.callee = callee; + } + + public ICommandListener getHandle() { + return orig; + } + + @Override + public CommandSender getCaller() { + return caller; + } + + @Override + public CommandSender getCallee() { + return callee; + } + + @Override + public void sendMessage(String message) { + getCaller().sendMessage(message); + } + + @Override + public void sendMessage(String[] messages) { + getCaller().sendMessage(messages); + } + + @Override + public Server getServer() { + return getCallee().getServer(); + } + + @Override + public String getName() { + return getCallee().getName(); + } + + @Override + public boolean isPermissionSet(String name) { + return getCaller().isPermissionSet(name); + } + + @Override + public boolean isPermissionSet(Permission perm) { + return getCaller().isPermissionSet(perm); + } + + @Override + public boolean hasPermission(String name) { + return getCaller().hasPermission(name); + } + + @Override + public boolean hasPermission(Permission perm) { + return getCaller().hasPermission(perm); + } + + @Override + public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value) { + return getCaller().addAttachment(plugin, name, value); + } + + @Override + public PermissionAttachment addAttachment(Plugin plugin) { + return getCaller().addAttachment(plugin); + } + + @Override + public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value, int ticks) { + return getCaller().addAttachment(plugin, name, value, ticks); + } + + @Override + public PermissionAttachment addAttachment(Plugin plugin, int ticks) { + return getCaller().addAttachment(plugin, ticks); + } + + @Override + public void removeAttachment(PermissionAttachment attachment) { + getCaller().removeAttachment(attachment); + } + + @Override + public void recalculatePermissions() { + getCaller().recalculatePermissions(); + } + + @Override + public Set<PermissionAttachmentInfo> getEffectivePermissions() { + return getCaller().getEffectivePermissions(); + } + + @Override + public boolean isOp() { + return getCaller().isOp(); + } + + @Override + public void setOp(boolean value) { + getCaller().setOp(value); + } + +} |