From d3c4681c49371806752184abe5fa3dd836d0b65e Mon Sep 17 00:00:00 2001 From: PseudoKnight Date: Sat, 22 Sep 2018 21:31:00 -0700 Subject: [PATCH] Fix protections for potted plants and undyed shulker boxes --- .../java/com/sk89q/worldguard/bukkit/util/Materials.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/util/Materials.java b/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/util/Materials.java index b222ba6c..ee52a670 100644 --- a/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/util/Materials.java +++ b/worldguard-legacy/src/main/java/com/sk89q/worldguard/bukkit/util/Materials.java @@ -56,6 +56,7 @@ public final class Materials { private static Set shulkerBoxes = new HashSet<>(); static { + shulkerBoxes.add(Material.SHULKER_BOX); shulkerBoxes.add(Material.WHITE_SHULKER_BOX); shulkerBoxes.add(Material.ORANGE_SHULKER_BOX); shulkerBoxes.add(Material.MAGENTA_SHULKER_BOX); @@ -236,7 +237,6 @@ public final class Materials { MATERIAL_FLAGS.put(Material.COMMAND_BLOCK, MODIFIED_ON_RIGHT); MATERIAL_FLAGS.put(Material.BEACON, MODIFIED_ON_RIGHT); MATERIAL_FLAGS.put(Material.COBBLESTONE_WALL, 0); - MATERIAL_FLAGS.put(Material.FLOWER_POT, MODIFIED_ON_RIGHT); MATERIAL_FLAGS.put(Material.ANVIL, MODIFIED_ON_RIGHT); MATERIAL_FLAGS.put(Material.TRAPPED_CHEST, MODIFIED_ON_RIGHT); MATERIAL_FLAGS.put(Material.HEAVY_WEIGHTED_PRESSURE_PLATE, 0); @@ -607,6 +607,9 @@ public final class Materials { for (Material button : Tag.BUTTONS.getValues()) { MATERIAL_FLAGS.put(button, MODIFIED_ON_RIGHT); } + for (Material pot : Tag.FLOWER_POTS.getValues()) { + MATERIAL_FLAGS.put(pot, MODIFIED_ON_RIGHT); + } // Check for missing items/blocks for (Material material : Material.values()) { @@ -1090,7 +1093,7 @@ public static boolean isItemAppliedToBlock(Material item, Material block) { public static boolean isConsideredBuildingIfUsed(Material type) { return type == Material.REPEATER || type == Material.COMPARATOR - || type == Material.FLOWER_POT; + || Tag.FLOWER_POTS.getValues().contains(type); } /**