From cb8822cd6a68117356e05b19bb4b90865b626250 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Sat, 18 Oct 2014 13:24:47 +1100 Subject: [PATCH] bug fixes. --- .../src/com/intellectualcrafters/plot/PlotMain.java | 9 +++------ .../intellectualcrafters/plot/commands/MainCommand.java | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java b/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java index 3c84dc468..acee8cd0d 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/PlotMain.java @@ -132,7 +132,7 @@ public class PlotMain extends JavaPlugin { * @return */ public static int hasPermissionRange(Player player, String stub, int range) { - if (player.isOp()) { + if (player==null || player.isOp()) { return range; } if (player.hasPermission(stub + ".*")) { @@ -157,10 +157,7 @@ public class PlotMain extends JavaPlugin { */ public static boolean hasPermissions(Player player, String[] perms) { // Assumes null player is console. - if (player==null) { - return true; - } - if (player.isOp()) { + if (player==null || player.isOp()) { return true; } for (String perm : perms) { @@ -205,7 +202,7 @@ public class PlotMain extends JavaPlugin { * @return */ public static boolean hasPermission(Player player, String perm) { - if (player.isOp()) { + if (player==null || player.isOp()) { return true; } if (player.hasPermission(perm)) { diff --git a/PlotSquared/src/com/intellectualcrafters/plot/commands/MainCommand.java b/PlotSquared/src/com/intellectualcrafters/plot/commands/MainCommand.java index e6492170d..fb0f3bdd0 100644 --- a/PlotSquared/src/com/intellectualcrafters/plot/commands/MainCommand.java +++ b/PlotSquared/src/com/intellectualcrafters/plot/commands/MainCommand.java @@ -29,7 +29,7 @@ public class MainCommand implements CommandExecutor { private static SubCommand[] _subCommands = new SubCommand[] { new Claim(), new Paste(), new Copy(), new Clipboard(), new Auto(), new Home(), new Visit(), new TP(), new Set(), new Clear(), new Delete(), new SetOwner(), new Denied(), new Helpers(), new Trusted(), - new Info(), new list(), new Help(), new Debug(), new Schematic(), new plugin(), new Inventory(), + new Info(), new list(), new Help(), new Debug(), new Schematic(), new plugin(), new Inventory(), new Purge(), new Reload(), new Merge(), new Unlink(), new Kick(), new Setup() }; public static ArrayList subCommands = new ArrayList() { @@ -52,7 +52,7 @@ public class MainCommand implements CommandExecutor { else { player = null; } - if (PlotMain.hasPermission(player, "plots.use")) { + if (!PlotMain.hasPermission(player, "plots.use")) { return no_permission(player); } if ((args.length < 1)