Added offline protection using the new configs

Change-Id: I93c5122bce09a3bd760fcd18d4dd0801a3548af9
This commit is contained in:
Thomas Tan 2011-06-04 17:36:28 +08:00
parent 24a4da6d2e
commit 5ddc24f855

View File

@ -202,12 +202,18 @@ public class FactionsPlayerListener extends PlayerListener{
return true; return true;
} }
if ( ! Conf.territoryDenyUseageMaterials.contains(material)) {
return true; // Item isn't one we're preventing.
}
Faction otherFaction = Board.getFactionAt(new FLocation(block)); 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); FPlayer me = FPlayer.get(player);
if (otherFaction.isNone()) { if (otherFaction.isNone()) {