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:
parent
3a3b09da61
commit
85d055739d
@ -59,7 +59,7 @@ public class Conf {
|
|||||||
public static boolean homesTeleportToOnDeath = true;
|
public static boolean homesTeleportToOnDeath = true;
|
||||||
public static double homesTeleportAllowedEnemyDistance = 32;
|
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 territoryDenyBuild = true;
|
||||||
public static boolean territoryDenyUseage = true;
|
public static boolean territoryDenyUseage = true;
|
||||||
public static boolean territoryBlockCreepers = false;
|
public static boolean territoryBlockCreepers = false;
|
||||||
@ -77,6 +77,13 @@ public class Conf {
|
|||||||
public static boolean warZoneBlockTNT = true;
|
public static boolean warZoneBlockTNT = true;
|
||||||
public static boolean warZonePowerLoss = 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> territoryProtectedMaterials = new HashSet<Material>();
|
||||||
public static Set<Material> territoryDenyUseageMaterials = new HashSet<Material>();
|
public static Set<Material> territoryDenyUseageMaterials = new HashSet<Material>();
|
||||||
|
|
||||||
|
@ -60,12 +60,16 @@ public class FactionsBlockListener extends BlockListener {
|
|||||||
|
|
||||||
Faction otherFaction = Board.getFactionAt(new FLocation(block));
|
Faction otherFaction = Board.getFactionAt(new FLocation(block));
|
||||||
|
|
||||||
if (otherFaction.isNone()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
FPlayer me = FPlayer.get(player);
|
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 (otherFaction.isSafeZone()) {
|
||||||
if (Factions.hasPermManageSafeZone(player) || !Conf.safeZoneDenyBuild) {
|
if (Factions.hasPermManageSafeZone(player) || !Conf.safeZoneDenyBuild) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -48,6 +48,9 @@ public class FactionsEntityListener extends EntityListener {
|
|||||||
if (Conf.worldsNoPowerLoss.contains(player.getWorld().getName())) {
|
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.");
|
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())) {
|
} else if (Conf.worldsNoPowerLoss.contains(player.getWorld().getName())) {
|
||||||
fplayer.sendMessage("You didn't lose any power due to the world you died in.");
|
fplayer.sendMessage("You didn't lose any power due to the world you died in.");
|
||||||
return;
|
return;
|
||||||
@ -97,6 +100,7 @@ public class FactionsEntityListener extends EntityListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (event.getEntity() instanceof Creeper && (
|
if (event.getEntity() instanceof Creeper && (
|
||||||
|
(faction.isNone() && Conf.wildernessBlockCreepers) ||
|
||||||
(faction.isNormal() && Conf.territoryBlockCreepers) ||
|
(faction.isNormal() && Conf.territoryBlockCreepers) ||
|
||||||
(faction.isWarZone() && Conf.warZoneBlockCreepers) ||
|
(faction.isWarZone() && Conf.warZoneBlockCreepers) ||
|
||||||
faction.isSafeZone()
|
faction.isSafeZone()
|
||||||
@ -104,6 +108,7 @@ public class FactionsEntityListener extends EntityListener {
|
|||||||
// creeper which needs prevention
|
// creeper which needs prevention
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (event.getEntity() instanceof Fireball && (
|
} else if (event.getEntity() instanceof Fireball && (
|
||||||
|
(faction.isNone() && Conf.wildernessBlockFireballs) ||
|
||||||
(faction.isNormal() && Conf.territoryBlockFireballs) ||
|
(faction.isNormal() && Conf.territoryBlockFireballs) ||
|
||||||
(faction.isWarZone() && Conf.warZoneBlockFireballs) ||
|
(faction.isWarZone() && Conf.warZoneBlockFireballs) ||
|
||||||
faction.isSafeZone()
|
faction.isSafeZone()
|
||||||
@ -111,6 +116,7 @@ public class FactionsEntityListener extends EntityListener {
|
|||||||
// ghast fireball which needs prevention
|
// ghast fireball which needs prevention
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
} else if (
|
} else if (
|
||||||
|
(faction.isNone() && Conf.wildernessBlockTNT) ||
|
||||||
(faction.isNormal() && Conf.territoryBlockTNT) ||
|
(faction.isNormal() && Conf.territoryBlockTNT) ||
|
||||||
(faction.isWarZone() && Conf.warZoneBlockTNT) ||
|
(faction.isWarZone() && Conf.warZoneBlockTNT) ||
|
||||||
(faction.isSafeZone() && Conf.safeZoneBlockTNT)
|
(faction.isSafeZone() && Conf.safeZoneBlockTNT)
|
||||||
@ -263,12 +269,16 @@ public class FactionsEntityListener extends EntityListener {
|
|||||||
|
|
||||||
Faction otherFaction = Board.getFactionAt(loc);
|
Faction otherFaction = Board.getFactionAt(loc);
|
||||||
|
|
||||||
if (otherFaction.isNone()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
FPlayer me = FPlayer.get(player);
|
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 (otherFaction.isSafeZone()) {
|
||||||
if (Factions.hasPermManageSafeZone(player) || !Conf.safeZoneDenyBuild) {
|
if (Factions.hasPermManageSafeZone(player) || !Conf.safeZoneDenyBuild) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -187,11 +187,15 @@ public class FactionsPlayerListener extends PlayerListener{
|
|||||||
|
|
||||||
Faction otherFaction = Board.getFactionAt(new FLocation(block));
|
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);
|
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 (otherFaction.isSafeZone() && Conf.safeZoneDenyUseage) {
|
||||||
if (Factions.hasPermManageSafeZone(player)) {
|
if (Factions.hasPermManageSafeZone(player)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user