From 567385ff1c9736c461e26cae6d651725bd6ab813 Mon Sep 17 00:00:00 2001 From: Brettflan Date: Sat, 14 Dec 2013 15:02:05 -0600 Subject: [PATCH] New command /wb bypasslist, which outputs a list of all players who have border bypass enabled. Requires new permission "worldborder.bypasslist". --- src/main/java/com/wimbli/WorldBorder/Config.java | 8 ++++++++ src/main/java/com/wimbli/WorldBorder/WBCommand.java | 9 +++++++++ src/main/resources/plugin.yml | 5 +++++ 3 files changed, 22 insertions(+) diff --git a/src/main/java/com/wimbli/WorldBorder/Config.java b/src/main/java/com/wimbli/WorldBorder/Config.java index 9d6b71b..c0d5d39 100644 --- a/src/main/java/com/wimbli/WorldBorder/Config.java +++ b/src/main/java/com/wimbli/WorldBorder/Config.java @@ -355,6 +355,14 @@ public class Config setPlayerBypass(player, !isPlayerBypassing(player)); } + public static String getPlayerBypassList() + { + if (bypassPlayers.isEmpty()) + return ""; + String newString = bypassPlayers.toString(); + return newString.substring(1, newString.length() - 1); + } + public static boolean isBorderTimerRunning() diff --git a/src/main/java/com/wimbli/WorldBorder/WBCommand.java b/src/main/java/com/wimbli/WorldBorder/WBCommand.java index a90f15d..f8dc7be 100644 --- a/src/main/java/com/wimbli/WorldBorder/WBCommand.java +++ b/src/main/java/com/wimbli/WorldBorder/WBCommand.java @@ -787,6 +787,14 @@ public class WBCommand implements CommandExecutor sender.sendMessage("Border bypass is now " + enabledColored(bypassing) + "."); } + // "bypasslist" command from player or console + else if (split.length == 1 && split[0].equalsIgnoreCase("bypasslist")) + { + if (!Config.HasPermission(player, "bypasslist")) return true; + + sender.sendMessage("Players with border bypass enabled: " + Config.getPlayerBypassList()); + } + // we couldn't decipher any known commands, so show help else { @@ -850,6 +858,7 @@ public class WBCommand implements CommandExecutor } if (page == 0 || page == 4) { + sender.sendMessage(cmd+" bypasslist " + clrDesc + " - list players with border bypass enabled."); sender.sendMessage(cmd+" portal " + clrReq + "" + clrDesc + " - turn portal redirection on or off."); sender.sendMessage(cmd+" reload" + clrDesc + " - re-load data from config.yml."); sender.sendMessage(cmd+" debug " + clrReq + "" + clrDesc + " - turn console debug output on or off."); diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 3de4d53..9727ff9 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -32,6 +32,7 @@ commands: / [world] fill [freq] [pad] [force] - generate world to border. / [world] trim [freq] [pad] - trim world outside of border. / bypass [player] [on/off] - let player go beyond border. + / bypasslist - list players with border bypass enabled. / remount - delay before remounting after knockback. / dynmap - turn DynMap border display on or off. / dynmapmsg - DynMap border labels will show this. @@ -59,6 +60,7 @@ permissions: worldborder.dynmap: true worldborder.dynmapmsg: true worldborder.bypass: true + worldborder.bypasslist: true worldborder.wrap: true worldborder.portal: true worldborder.remount: true @@ -128,3 +130,6 @@ permissions: worldborder.bypass: description: Can enable bypass mode to go beyond the border default: op + worldborder.bypasslist: + description: Can get list of players with border bypass enabled + default: op