From 5ddc24f8559fbd4f40d5b594550baf6f7134b83c Mon Sep 17 00:00:00 2001 From: Thomas Tan Date: Sat, 4 Jun 2011 17:36:28 +0800 Subject: [PATCH] Added offline protection using the new configs Change-Id: I93c5122bce09a3bd760fcd18d4dd0801a3548af9 --- .../factions/listeners/FactionsPlayerListener.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/org/mcteam/factions/listeners/FactionsPlayerListener.java b/src/org/mcteam/factions/listeners/FactionsPlayerListener.java index 1e1ad765..223c09ee 100644 --- a/src/org/mcteam/factions/listeners/FactionsPlayerListener.java +++ b/src/org/mcteam/factions/listeners/FactionsPlayerListener.java @@ -202,12 +202,18 @@ public class FactionsPlayerListener extends PlayerListener{ return true; } - if ( ! Conf.territoryDenyUseageMaterials.contains(material)) { - return true; // Item isn't one we're preventing. - } - Faction otherFaction = Board.getFactionAt(new FLocation(block)); + if (otherFaction.getOnlinePlayers()!=null){ + if ( ! Conf.territoryDenyUseageMaterials.contains(material)) { + return true; // Item isn't one we're preventing for online factions. + } + }else{ + if ( ! Conf.territoryDenyUseageMaterialsWhenOffline.contains(material)) { + return true; // Item isn't one we're preventing for offline factions. + } + } + FPlayer me = FPlayer.get(player); if (otherFaction.isNone()) {