From 3c10b8276c5dc7b13fd4b46737b755f6a9b85436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?SvenjaRei=C3=9Faus?= Date: Thu, 14 Mar 2019 12:26:56 -0500 Subject: [PATCH] Allow the use of certain block materials, regardless of permissions. HCF feature. --- src/main/java/com/massivecraft/factions/Conf.java | 5 +++++ .../factions/listeners/FactionsPlayerListener.java | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/main/java/com/massivecraft/factions/Conf.java b/src/main/java/com/massivecraft/factions/Conf.java index d1bc7588..eb164320 100644 --- a/src/main/java/com/massivecraft/factions/Conf.java +++ b/src/main/java/com/massivecraft/factions/Conf.java @@ -215,6 +215,11 @@ public class Conf { public static Set territoryProtectedMaterialsWhenOffline = EnumSet.noneOf(Material.class); public static Set territoryDenyUseageMaterialsWhenOffline = EnumSet.noneOf(Material.class); public static transient Set safeZoneNerfedCreatureTypes = EnumSet.noneOf(EntityType.class); + /// + /// This defines a set of materials which should always be allowed to use, regardless of factions permissions. + /// Useful for HCF features. + /// + public static Set territoryBypassAllProtection = EnumSet.noneOf(Material.class); // Economy settings public static boolean econEnabled = false; diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java index ffe3aa4a..d7293fcc 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -160,6 +160,10 @@ public class FactionsPlayerListener implements Listener { return true; Material material = block.getType(); + + // Check if the material is bypassing protection + if (Conf.territoryBypassAllProtection.contains(material)) return true; + // Dupe fix. FLocation loc = new FLocation(block); Faction otherFaction = Board.getInstance().getFactionAt(loc);