Added Territory Pain Protection

added options
ownedAreaPainBuild
territoryPainBuild
territoryPainBuildWhenOffline
territoryEnemyPainBuild
territoryEnemyPainBuildWhenOffline

Signed-off-by: locutus <bladedpenguin@gmail.com>
This commit is contained in:
locutus 2011-08-03 02:29:51 -04:00
parent 3bcfd5cff5
commit 51a05a1e86
2 changed files with 22 additions and 3 deletions

View File

@ -86,9 +86,13 @@ public class Conf {
public static double territoryShieldFactor = 0.3;
public static boolean territoryDenyBuild = true;
public static boolean territoryDenyBuildWhenOffline = true;
public static boolean territoryPainBuild = true;
public static boolean territoryPainBuildWhenOffline = true;
public static boolean territoryDenyUseage = true;
public static boolean territoryEnemyDenyBuild = true;
public static boolean territoryEnemyDenyBuildWhenOffline = true;
public static boolean territoryEnemyPainBuild = true;
public static boolean territoryEnemyPainBuildWhenOffline = true;
public static boolean territoryEnemyDenyUseage = true;
public static boolean territoryEnemyProtectMaterials = true;
public static boolean territoryBlockCreepers = false;
@ -104,6 +108,7 @@ public class Conf {
public static boolean ownedAreasModeratorsCanSet = false;
public static boolean ownedAreaModeratorsBypass = true;
public static boolean ownedAreaDenyBuild = true;
public static boolean ownedAreaPainBuild = true;
public static boolean ownedAreaProtectMaterials = true;
public static boolean ownedAreaDenyUseage = true;

View File

@ -192,16 +192,30 @@ public class FactionsBlockListener extends BlockListener {
me.sendMessage("You can't "+action+" in the territory of "+otherFaction.getTag(myFaction));
return false;
}
//added by Bladedpenguin@gmail.com
//if not denybuild, hurt the player for building?
else if (
(online && (areEnemies ? Conf.territoryEnemyPainBuild : Conf.territoryPainBuild))
|| (!online && (areEnemies ? Conf.territoryEnemyPainBuildWhenOffline : Conf.territoryPainBuildWhenOffline))
) {
me.sendMessage("You are hurt for "+action+" in the territory of "+otherFaction.getTag(myFaction));
player.damage(1);
}
}
// Also cancel if player doesn't have ownership rights for this claim
// Also restructured by bladedpenguin/locutus
else if (
Conf.ownedAreasEnabled
&& Conf.ownedAreaDenyBuild
&& !myFaction.playerHasOwnershipRights(me, loc)
&& !Factions.hasPermOwnershipBypass(player)
) {
if (Conf.ownedAreaDenyBuild){
me.sendMessage("You can't "+action+" in this territory, it is owned by: "+myFaction.getOwnerListString(loc));
return false;
} else if (Conf.ownedAreaPainBuild){
me.sendMessage("You are hurt for "+action+" in this territory, it is owned by: "+myFaction.getOwnerListString(loc));
player.damage(1);
}
}
return true;