From 750e525806e339416f557e997e34c217f4a5fe34 Mon Sep 17 00:00:00 2001 From: zml2008 Date: Sat, 7 Jan 2012 22:14:36 -0800 Subject: [PATCH] Added permissions support for SpoutPlayer --- .../com/sk89q/worldedit/spout/SpoutCommandSender.java | 9 +++------ src/main/java/com/sk89q/worldedit/spout/SpoutPlayer.java | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/spout/SpoutCommandSender.java b/src/main/java/com/sk89q/worldedit/spout/SpoutCommandSender.java index b6ec96e6a..5f912474c 100644 --- a/src/main/java/com/sk89q/worldedit/spout/SpoutCommandSender.java +++ b/src/main/java/com/sk89q/worldedit/spout/SpoutCommandSender.java @@ -24,8 +24,7 @@ public class SpoutCommandSender extends LocalPlayer { @Override public String getName() { - //return sender.getName(); - return "Console"; + return sender.getName(); } @Override @@ -51,14 +50,12 @@ public class SpoutCommandSender extends LocalPlayer { @Override public String[] getGroups() { - return new String[0]; + return sender.getGroups(); } @Override public boolean hasPermission(String perm) { - // TODO: Implement permissions - // return sender.isOp(): - return true; + return sender.hasPermission(perm); } @Override diff --git a/src/main/java/com/sk89q/worldedit/spout/SpoutPlayer.java b/src/main/java/com/sk89q/worldedit/spout/SpoutPlayer.java index 65435a36e..f2d030aed 100644 --- a/src/main/java/com/sk89q/worldedit/spout/SpoutPlayer.java +++ b/src/main/java/com/sk89q/worldedit/spout/SpoutPlayer.java @@ -116,7 +116,7 @@ public class SpoutPlayer extends LocalPlayer { @Override public String[] getGroups() { - return new String[0]; + return player.getGroups(); } @Override @@ -126,7 +126,7 @@ public class SpoutPlayer extends LocalPlayer { @Override public boolean hasPermission(String perm) { - return true; // TODO: Implement permissions + return player.hasPermission(perm); } @Override