Skip to content

Commit

Permalink
Forgot offline block protection. Added now.
Browse files Browse the repository at this point in the history
Change-Id: Ib4e8866e5da655e01bdbb64f61d2130c664bc241
  • Loading branch information
thomastanck committed Jun 4, 2011
1 parent 5ddc24f commit 999be49
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/org/mcteam/factions/listeners/FactionsPlayerListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,21 @@ public boolean canPlayerUseBlock(Player player, Block block) {

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) {
Expand Down

0 comments on commit 999be49

Please sign in to comment.