Forgot offline block protection. Added now.

Change-Id: Ib4e8866e5da655e01bdbb64f61d2130c664bc241
This commit is contained in:
Thomas Tan 2011-06-04 17:59:35 +08:00
parent 5ddc24f855
commit 999be49f5c

View File

@ -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) {