diff --git a/src/com/massivecraft/factions/Conf.java b/src/com/massivecraft/factions/Conf.java index f4c9c52f..b2667179 100644 --- a/src/com/massivecraft/factions/Conf.java +++ b/src/com/massivecraft/factions/Conf.java @@ -126,11 +126,11 @@ public class Conf public static int actionDeniedPainAmount = 1; // commands which will be prevented if the player is a member of a permanent faction - public static Set permanentFactionMemberDenyCommands = new HashSet(); + public static Set permanentFactionMemberDenyCommands = new LinkedHashSet(); // commands which will be prevented when in claimed territory of another faction - public static Set territoryNeutralDenyCommands = new HashSet(); - public static Set territoryEnemyDenyCommands = new HashSet(); + public static Set territoryNeutralDenyCommands = new LinkedHashSet(); + public static Set territoryEnemyDenyCommands = new LinkedHashSet(); public static double territoryShieldFactor = 0.3; public static boolean territoryDenyBuild = true; @@ -261,11 +261,14 @@ public class Conf public static boolean bankMembersCanWithdraw = false; //Have to be at least moderator to withdraw or pay money to another faction public static boolean bankFactionPaysCosts = true; //The faction pays for faction command costs, such as sethome public static boolean bankFactionPaysLandCosts = true; //The faction pays for land claiming costs. - - public static Set worldsNoClaiming = new HashSet(); - public static Set worldsNoPowerLoss = new HashSet(); - public static Set worldsIgnorePvP = new HashSet(); - public static Set worldsNoWildernessProtection = new HashSet(); + + // mainly for other plugins/mods that use a fake player to take actions, which shouldn't be subject to our protections + public static Set playersWhoBypassAllProtection = new LinkedHashSet(); + + public static Set worldsNoClaiming = new LinkedHashSet(); + public static Set worldsNoPowerLoss = new LinkedHashSet(); + public static Set worldsIgnorePvP = new LinkedHashSet(); + public static Set worldsNoWildernessProtection = new LinkedHashSet(); public static transient int mapHeight = 8; public static transient int mapWidth = 39; diff --git a/src/com/massivecraft/factions/listeners/FactionsBlockListener.java b/src/com/massivecraft/factions/listeners/FactionsBlockListener.java index cb299713..716e2497 100644 --- a/src/com/massivecraft/factions/listeners/FactionsBlockListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsBlockListener.java @@ -170,10 +170,11 @@ public class FactionsBlockListener implements Listener public static boolean playerCanBuildDestroyBlock(Player player, Location location, String action, boolean justCheck) { - FPlayer me = FPlayers.i.get(player); + String name = player.getName(); + if (Conf.playersWhoBypassAllProtection.contains(name)) return true; - if (me.isAdminBypassing()) - return true; + FPlayer me = FPlayers.i.get(name); + if (me.isAdminBypassing()) return true; FLocation loc = new FLocation(location); Faction otherFaction = Board.getFactionAt(loc); diff --git a/src/com/massivecraft/factions/listeners/FactionsEntityListener.java b/src/com/massivecraft/factions/listeners/FactionsEntityListener.java index 356646d2..32730c88 100644 --- a/src/com/massivecraft/factions/listeners/FactionsEntityListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsEntityListener.java @@ -329,7 +329,9 @@ public class FactionsEntityListener implements Listener if (attacker == null || attacker.getPlayer() == null) return true; - + + if (Conf.playersWhoBypassAllProtection.contains(attacker.getName())) return true; + if (attacker.hasLoginPvpDisabled()) { if (notify) attacker.msg("You can't hurt other players for " + Conf.noPVPDamageToOthersForXSecondsAfterLogin + " seconds after logging in."); diff --git a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java index 1fcce737..88c4b207 100644 --- a/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java +++ b/src/com/massivecraft/factions/listeners/FactionsPlayerListener.java @@ -260,9 +260,11 @@ public class FactionsPlayerListener implements Listener public static boolean playerCanUseItemHere(Player player, Location location, Material material, boolean justCheck) { - FPlayer me = FPlayers.i.get(player); - if (me.isAdminBypassing()) - return true; + String name = player.getName(); + if (Conf.playersWhoBypassAllProtection.contains(name)) return true; + + FPlayer me = FPlayers.i.get(name); + if (me.isAdminBypassing()) return true; FLocation loc = new FLocation(location); Faction otherFaction = Board.getFactionAt(loc); @@ -335,9 +337,11 @@ public class FactionsPlayerListener implements Listener public static boolean canPlayerUseBlock(Player player, Block block, boolean justCheck) { - FPlayer me = FPlayers.i.get(player); - if (me.isAdminBypassing()) - return true; + String name = player.getName(); + if (Conf.playersWhoBypassAllProtection.contains(name)) return true; + + FPlayer me = FPlayers.i.get(name); + if (me.isAdminBypassing()) return true; Material material = block.getType(); FLocation loc = new FLocation(block);