From 999be49f5cae444293b1c863c3eef40718cc6882 Mon Sep 17 00:00:00 2001 From: Thomas Tan Date: Sat, 4 Jun 2011 17:59:35 +0800 Subject: [PATCH] Forgot offline block protection. Added now. Change-Id: Ib4e8866e5da655e01bdbb64f61d2130c664bc241 --- .../factions/listeners/FactionsPlayerListener.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/org/mcteam/factions/listeners/FactionsPlayerListener.java b/src/org/mcteam/factions/listeners/FactionsPlayerListener.java index 223c09ee..bd60d9a0 100644 --- a/src/org/mcteam/factions/listeners/FactionsPlayerListener.java +++ b/src/org/mcteam/factions/listeners/FactionsPlayerListener.java @@ -258,14 +258,21 @@ public class FactionsPlayerListener extends PlayerListener{ Material material = block.getType(); + Faction otherFaction = Board.getFactionAt(new FLocation(block)); + // We only care about some material types. - if ( ! Conf.territoryProtectedMaterials.contains(material)) { - return true; + if (otherFaction.getOnlinePlayers()!=null){ + if ( ! Conf.territoryProtectedMaterials.contains(material)) { + return true; + } + }else{ + if ( ! Conf.territoryProtectedMaterialsWhenOffline.contains(material)) { + return true; + } } FPlayer me = FPlayer.get(player); Faction myFaction = me.getFaction(); - Faction otherFaction = Board.getFactionAt(new FLocation(block)); // In safe zones you may use any block... if (otherFaction.isNormal() && myFaction != otherFaction) {