From 38cf542d8c15d990ba1bbe435787ad410ef30212 Mon Sep 17 00:00:00 2001 From: Driftay Date: Sat, 21 Dec 2019 22:03:40 -0500 Subject: [PATCH] Fixed territoryBypassProtectedMaterials - 2 Maps were defined --- src/main/java/com/massivecraft/factions/Conf.java | 1 - .../factions/listeners/FactionsBlockListener.java | 5 +---- .../factions/listeners/FactionsPlayerListener.java | 2 +- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/Conf.java b/src/main/java/com/massivecraft/factions/Conf.java index 98367118..fdc4852c 100644 --- a/src/main/java/com/massivecraft/factions/Conf.java +++ b/src/main/java/com/massivecraft/factions/Conf.java @@ -252,7 +252,6 @@ public class Conf { public static Set territoryCancelAndAllowItemUseMaterial = new HashSet<>(); public static Set territoryDenySwitchMaterials = new HashSet<>(); - public static Set territoryBypasssProtectedMaterials = EnumSet.noneOf(Material.class); public static boolean allowCreeperEggingChests = true; // Economy settings diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java index f75208eb..2c6f9ca8 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsBlockListener.java @@ -46,7 +46,6 @@ public class FactionsBlockListener implements Listener { private HashMap bannerCooldownMap = new HashMap<>(); public static boolean playerCanBuildDestroyBlock(Player player, Location location, String action, boolean justCheck) { - if (Conf.playersWhoBypassAllProtection.contains(player.getName())) return true; FPlayer me = FPlayers.getInstance().getById(player.getUniqueId().toString()); @@ -75,9 +74,8 @@ public class FactionsBlockListener implements Listener { if (!justCheck) me.msg(TL.ACTION_DENIED_WARZONE, action); return false; } else if (!otherFaction.getId().equals(myFaction.getId())) { // If the faction target is not my own - if (FactionsPlugin.instance.getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded()) + if (FactionsPlugin.getInstance().getConfig().getBoolean("hcf.raidable", false) && otherFaction.getLandRounded() > otherFaction.getPowerRounded()) return true; - // Get faction pain build access relation to me boolean pain = !justCheck && otherFaction.getAccess(me, PermissableAction.PAIN_BUILD) == Access.ALLOW; return CheckActionState(otherFaction, loc, me, PermissableAction.fromString(action), pain); } else if (otherFaction.getId().equals(myFaction.getId())) { @@ -88,7 +86,6 @@ public class FactionsBlockListener implements Listener { return false; } - private static boolean CheckPlayerAccess(Player player, FPlayer me, FLocation loc, Faction myFaction, Access access, PermissableAction action, boolean shouldHurt) { boolean landOwned = (myFaction.doesLocationHaveOwnersSet(loc) && !myFaction.getOwnerList(loc).isEmpty()); if ((landOwned && myFaction.getOwnerListString(loc).contains(player.getName())) || (me.getRole() == Role.LEADER && me.getFactionId().equals(myFaction.getId()))) diff --git a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java index 2e4b9631..6ce946c5 100644 --- a/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/main/java/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -830,7 +830,7 @@ public class FactionsPlayerListener implements Listener { // territoryBypasssProtectedMaterials totally bypass the protection system - if (Conf.territoryBypasssProtectedMaterials.contains(block.getType())) return; + if (Conf.territoryBypassProtectedMaterials.contains(block.getType())) return; // Do type null checks so if XMaterial has a parsing issue and fills null as a value it will not bypass. // territoryCancelAndAllowItemUseMaterial bypass the protection system but only if they're not clicking on territoryDenySwitchMaterials // if they're clicking on territoryDenySwitchMaterials, let the protection system handle the permissions