diff options
author | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-12-12 19:27:37 +0000 |
---|---|---|
committer | Thinkofdeath <thinkofdeath@spigotmc.org> | 2014-12-12 19:27:37 +0000 |
commit | 64157d1de5c34fb3b64297348d7b0e17c5aec4ab (patch) | |
tree | 55e7dd4687081fdf94bbf462b21a9728babbac80 /src/main/java | |
parent | 54888dfafbe296594d421301fc80227effc1a83d (diff) | |
download | craftbukkit-64157d1de5c34fb3b64297348d7b0e17c5aec4ab.tar craftbukkit-64157d1de5c34fb3b64297348d7b0e17c5aec4ab.tar.gz craftbukkit-64157d1de5c34fb3b64297348d7b0e17c5aec4ab.tar.lz craftbukkit-64157d1de5c34fb3b64297348d7b0e17c5aec4ab.tar.xz craftbukkit-64157d1de5c34fb3b64297348d7b0e17c5aec4ab.zip |
SPIGOT-189: Remove ListenerWrapper in favour of just doing it in EntityPlayer
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/command/ListenerWrapper.java | 69 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java | 3 |
2 files changed, 1 insertions, 71 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/command/ListenerWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/ListenerWrapper.java deleted file mode 100644 index 817312e9..00000000 --- a/src/main/java/org/bukkit/craftbukkit/command/ListenerWrapper.java +++ /dev/null @@ -1,69 +0,0 @@ -package org.bukkit.craftbukkit.command; - -import net.minecraft.server.BlockPosition; -import net.minecraft.server.Entity; -import net.minecraft.server.EnumCommandResult; -import net.minecraft.server.IChatBaseComponent; -import net.minecraft.server.ICommandListener; -import net.minecraft.server.Vec3D; -import net.minecraft.server.World; - -public class ListenerWrapper implements ICommandListener { - - private final ICommandListener listener; - - public ListenerWrapper(ICommandListener listener) { - this.listener = listener; - } - - @Override - public String getName() { - return listener.getName(); - } - - @Override - public IChatBaseComponent getScoreboardDisplayName() { - return listener.getScoreboardDisplayName(); - } - - @Override - public void sendMessage(IChatBaseComponent icbc) { - listener.sendMessage(icbc); - } - - @Override - public boolean a(int i, String string) { - return true; // Give access to all commands as we do our own perm check - } - - @Override - public BlockPosition getChunkCoordinates() { - return listener.getChunkCoordinates(); - } - - @Override - public Vec3D d() { - return listener.d(); - } - - @Override - public World getWorld() { - return listener.getWorld(); - } - - @Override - public Entity f() { - return listener.f(); - } - - @Override - public boolean getSendCommandFeedback() { - return listener.getSendCommandFeedback(); - } - - @Override - public void a(EnumCommandResult ecr, int i) { - listener.a(ecr, i); - } - -} diff --git a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java index 1c88b4a9..2e85c12b 100644 --- a/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java +++ b/src/main/java/org/bukkit/craftbukkit/command/VanillaCommandWrapper.java @@ -1,6 +1,5 @@ package org.bukkit.craftbukkit.command; -import com.google.common.base.Joiner; import java.util.Iterator; import java.util.List; @@ -127,7 +126,7 @@ public final class VanillaCommandWrapper extends VanillaCommand { private ICommandListener getListener(CommandSender sender) { if (sender instanceof Player) { - return new ListenerWrapper(((CraftPlayer) sender).getHandle()); + return ((CraftPlayer) sender).getHandle(); } if (sender instanceof BlockCommandSender) { return ((CraftBlockCommandSender) sender).getTileEntity(); |