Fixed territoryBypassProtectedMaterials - 2 Maps were defined
This commit is contained in:
parent
93b485aae8
commit
38cf542d8c
@ -252,7 +252,6 @@ public class Conf {
|
|||||||
|
|
||||||
public static Set<Material> territoryCancelAndAllowItemUseMaterial = new HashSet<>();
|
public static Set<Material> territoryCancelAndAllowItemUseMaterial = new HashSet<>();
|
||||||
public static Set<Material> territoryDenySwitchMaterials = new HashSet<>();
|
public static Set<Material> territoryDenySwitchMaterials = new HashSet<>();
|
||||||
public static Set<Material> territoryBypasssProtectedMaterials = EnumSet.noneOf(Material.class);
|
|
||||||
public static boolean allowCreeperEggingChests = true;
|
public static boolean allowCreeperEggingChests = true;
|
||||||
|
|
||||||
// Economy settings
|
// Economy settings
|
||||||
|
@ -46,7 +46,6 @@ public class FactionsBlockListener implements Listener {
|
|||||||
private HashMap<String, Boolean> bannerCooldownMap = new HashMap<>();
|
private HashMap<String, Boolean> bannerCooldownMap = new HashMap<>();
|
||||||
|
|
||||||
public static boolean playerCanBuildDestroyBlock(Player player, Location location, String action, boolean justCheck) {
|
public static boolean playerCanBuildDestroyBlock(Player player, Location location, String action, boolean justCheck) {
|
||||||
|
|
||||||
if (Conf.playersWhoBypassAllProtection.contains(player.getName())) return true;
|
if (Conf.playersWhoBypassAllProtection.contains(player.getName())) return true;
|
||||||
|
|
||||||
FPlayer me = FPlayers.getInstance().getById(player.getUniqueId().toString());
|
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);
|
if (!justCheck) me.msg(TL.ACTION_DENIED_WARZONE, action);
|
||||||
return false;
|
return false;
|
||||||
} else if (!otherFaction.getId().equals(myFaction.getId())) { // If the faction target is not my own
|
} 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;
|
return true;
|
||||||
// Get faction pain build access relation to me
|
|
||||||
boolean pain = !justCheck && otherFaction.getAccess(me, PermissableAction.PAIN_BUILD) == Access.ALLOW;
|
boolean pain = !justCheck && otherFaction.getAccess(me, PermissableAction.PAIN_BUILD) == Access.ALLOW;
|
||||||
return CheckActionState(otherFaction, loc, me, PermissableAction.fromString(action), pain);
|
return CheckActionState(otherFaction, loc, me, PermissableAction.fromString(action), pain);
|
||||||
} else if (otherFaction.getId().equals(myFaction.getId())) {
|
} else if (otherFaction.getId().equals(myFaction.getId())) {
|
||||||
@ -88,7 +86,6 @@ public class FactionsBlockListener implements Listener {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static boolean CheckPlayerAccess(Player player, FPlayer me, FLocation loc, Faction myFaction, Access access, PermissableAction action, boolean shouldHurt) {
|
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());
|
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())))
|
if ((landOwned && myFaction.getOwnerListString(loc).contains(player.getName())) || (me.getRole() == Role.LEADER && me.getFactionId().equals(myFaction.getId())))
|
||||||
|
@ -830,7 +830,7 @@ public class FactionsPlayerListener implements Listener {
|
|||||||
|
|
||||||
|
|
||||||
// territoryBypasssProtectedMaterials totally bypass the protection system
|
// 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.
|
// 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
|
// 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
|
// if they're clicking on territoryDenySwitchMaterials, let the protection system handle the permissions
|
||||||
|
Loading…
Reference in New Issue
Block a user