Added in options to protect all wilderness (unclaimed) areas, in case that's your sort of thing. Also lowered default "territoryShieldFactor" from 0.5 to 0.3, since it seemed a bit overpowered at 0.5.

This commit is contained in:
Brettflan 2011-06-01 18:32:09 -05:00
parent 3a3b09da61
commit 85d055739d
4 changed files with 38 additions and 13 deletions

View File

@ -59,7 +59,7 @@ public class Conf {
public static boolean homesTeleportToOnDeath = true;
public static double homesTeleportAllowedEnemyDistance = 32;
public static double territoryShieldFactor = 0.5;
public static double territoryShieldFactor = 0.3;
public static boolean territoryDenyBuild = true;
public static boolean territoryDenyUseage = true;
public static boolean territoryBlockCreepers = false;
@ -77,6 +77,13 @@ public class Conf {
public static boolean warZoneBlockTNT = true;
public static boolean warZonePowerLoss = true;
public static boolean wildernessDenyBuild = false;
public static boolean wildernessDenyUseage = false;
public static boolean wildernessBlockCreepers = false;
public static boolean wildernessBlockFireballs = false;
public static boolean wildernessBlockTNT = false;
public static boolean wildernessPowerLoss = true;
public static Set<Material> territoryProtectedMaterials = new HashSet<Material>();
public static Set<Material> territoryDenyUseageMaterials = new HashSet<Material>();

View File

@ -60,12 +60,16 @@ public class FactionsBlockListener extends BlockListener {
Faction otherFaction = Board.getFactionAt(new FLocation(block));
if (otherFaction.isNone()) {
return true;
}
FPlayer me = FPlayer.get(player);
if (otherFaction.isNone()) {
if (!Conf.wildernessDenyBuild) {
return true; // This is not faction territory. Use whatever you like here.
}
me.sendMessage("You can't "+action+" in the wilderness.");
return false;
}
if (otherFaction.isSafeZone()) {
if (Factions.hasPermManageSafeZone(player) || !Conf.safeZoneDenyBuild) {
return true;

View File

@ -48,6 +48,9 @@ public class FactionsEntityListener extends EntityListener {
if (Conf.worldsNoPowerLoss.contains(player.getWorld().getName())) {
fplayer.sendMessage("The world you are in has power loss normally disabled, but you still lost power since you were in a war zone.");
}
} else if (faction.isNone() && !Conf.wildernessPowerLoss) {
fplayer.sendMessage("You didn't lose any power since you were in the wilderness.");
return;
} else if (Conf.worldsNoPowerLoss.contains(player.getWorld().getName())) {
fplayer.sendMessage("You didn't lose any power due to the world you died in.");
return;
@ -97,6 +100,7 @@ public class FactionsEntityListener extends EntityListener {
}
if (event.getEntity() instanceof Creeper && (
(faction.isNone() && Conf.wildernessBlockCreepers) ||
(faction.isNormal() && Conf.territoryBlockCreepers) ||
(faction.isWarZone() && Conf.warZoneBlockCreepers) ||
faction.isSafeZone()
@ -104,6 +108,7 @@ public class FactionsEntityListener extends EntityListener {
// creeper which needs prevention
event.setCancelled(true);
} else if (event.getEntity() instanceof Fireball && (
(faction.isNone() && Conf.wildernessBlockFireballs) ||
(faction.isNormal() && Conf.territoryBlockFireballs) ||
(faction.isWarZone() && Conf.warZoneBlockFireballs) ||
faction.isSafeZone()
@ -111,6 +116,7 @@ public class FactionsEntityListener extends EntityListener {
// ghast fireball which needs prevention
event.setCancelled(true);
} else if (
(faction.isNone() && Conf.wildernessBlockTNT) ||
(faction.isNormal() && Conf.territoryBlockTNT) ||
(faction.isWarZone() && Conf.warZoneBlockTNT) ||
(faction.isSafeZone() && Conf.safeZoneBlockTNT)
@ -263,12 +269,16 @@ public class FactionsEntityListener extends EntityListener {
Faction otherFaction = Board.getFactionAt(loc);
if (otherFaction.isNone()) {
return true;
}
FPlayer me = FPlayer.get(player);
if (otherFaction.isNone()) {
if (!Conf.wildernessDenyBuild) {
return true; // This is not faction territory. Use whatever you like here.
}
me.sendMessage("You can't "+action+" paintings in the wilderness.");
return false;
}
if (otherFaction.isSafeZone()) {
if (Factions.hasPermManageSafeZone(player) || !Conf.safeZoneDenyBuild) {
return true;

View File

@ -187,11 +187,15 @@ public class FactionsPlayerListener extends PlayerListener{
Faction otherFaction = Board.getFactionAt(new FLocation(block));
if (otherFaction.isNone()) {
return true; // This is not faction territory. Use whatever you like here.
}
FPlayer me = FPlayer.get(player);
if (otherFaction.isNone()) {
if (!Conf.wildernessDenyUseage) {
return true; // This is not faction territory. Use whatever you like here.
}
me.sendMessage("You can't use "+TextUtil.getMaterialName(material)+" in the wilderness.");
return false;
}
if (otherFaction.isSafeZone() && Conf.safeZoneDenyUseage) {
if (Factions.hasPermManageSafeZone(player)) {