From 12c476f3c2a5b913e14684509c1ed8081f490aff Mon Sep 17 00:00:00 2001 From: boy0001 Date: Fri, 7 Nov 2014 21:30:29 +1100 Subject: [PATCH] fixed bugs --- .../java/com/intellectualcrafters/plot/FlagManager.java | 2 +- .../java/com/intellectualcrafters/plot/commands/Set.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/FlagManager.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/FlagManager.java index 083cafd60..a1b2d9350 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/FlagManager.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/FlagManager.java @@ -71,7 +71,7 @@ public class FlagManager { public static List getFlags(final Player player) { final List returnFlags = new ArrayList<>(); for (final AbstractFlag flag : flags) { - if (player.hasPermission("plots.set." + flag.getKey().toLowerCase())) { + if (player.hasPermission("plots.set.flag." + flag.getKey().toLowerCase())) { returnFlags.add(flag); } } diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java index 1b22e7c63..22ed5110d 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/commands/Set.java @@ -262,7 +262,13 @@ public class Set extends SubCommand { sendMessage(plr, C.NAME_LITTLE, "Material", args[1].length() + "", "2"); return true; } - final Material material = getMaterial(args[1], PlotWorld.BLOCKS); + Material material; + try { + material = getMaterial(args[1], PlotWorld.BLOCKS); + } + catch (NullPointerException e) { + material = null; + } /* * for (Material m : PlotWorld.BLOCKS) { * if (m.toString().equalsIgnoreCase(args[1])) {