New boolean config options territoryBlockTNT (default false), safeZoneDenyBuild (default true), safeZoneDenyUseage (default true), safeZoneBlockTNT (default true). territoryBlockTNT prevents TNT explosions inside faction territory, which defaults to false (same as before). It prevents TNT cannons from being a viable tactic, and I think for most people it would be an undesirable option. safeZoneBlockTNT prevents TNT explosions inside safe zone areas, which defaults to true (new behavior). I think most server operators would prefer safe zones to be safe from TNT, from TNT cannons or otherwise. safeZoneDenyBuild prevents players from building inside safe zone areas, which defaults to true (same as before). This option is added for server admins who, for whatever reason, want to let their players build and break inside safe zone areas. safeZoneDenyUseage prevents players from using items in the territoryDenyUseageMaterials list, which defaults to true (new behavior). This will (with the default list) prevent players from dumping/using buckets inside safe zone areas.

This commit is contained in:
Brettflan 2011-04-04 06:31:48 -05:00
parent 4437aa231d
commit b912b49289
5 changed files with 11 additions and 4 deletions

View File

@ -1,5 +1,5 @@
name: Factions
version: 1.1.3
version: 1.1.4
main: com.bukkit.mcteam.factions.Factions
commands:
f:

View File

@ -53,6 +53,11 @@ public class Conf {
public static double territoryShieldFactor = 0.5;
public static boolean territoryBlockCreepers = false;
public static boolean territoryBlockFireballs = false;
public static boolean territoryBlockTNT = false;
public static boolean safeZoneDenyBuild = true;
public static boolean safeZoneDenyUseage = true;
public static boolean safeZoneBlockTNT = true;
public static Set<Material> territoryProtectedMaterials = new HashSet<Material>();
public static Set<Material> territoryDenyUseageMaterials = new HashSet<Material>();

View File

@ -64,7 +64,7 @@ public class FactionsBlockListener extends BlockListener {
FPlayer me = FPlayer.get(player);
if (otherFaction.isSafeZone()) {
if (Factions.hasPermManageSafeZone(player)) {
if (Factions.hasPermManageSafeZone(player) || !Conf.safeZoneDenyBuild) {
return true;
}
me.sendMessage("You can't "+action+" in a safe zone.");

View File

@ -65,7 +65,6 @@ public class FactionsEntityListener extends EntityListener {
}
// TODO what happens with the creeper or fireball then? Must we delete them manually?
@Override
public void onEntityExplode(EntityExplodeEvent event)
{
@ -86,6 +85,9 @@ public class FactionsEntityListener extends EntityListener {
} else if ((Conf.territoryBlockFireballs || faction.isSafeZone()) && event.getEntity() instanceof Fireball) {
// ghast fireball which might need prevention, if inside faction territory
event.setCancelled(true);
} else if (Conf.territoryBlockTNT || (faction.isSafeZone() && Conf.safeZoneBlockTNT)) {
// we'll assume it's TNT, which might need prevention, if inside faction territory or safe zone
event.setCancelled(true);
}
}

View File

@ -171,7 +171,7 @@ public class FactionsPlayerListener extends PlayerListener{
FPlayer me = FPlayer.get(player);
if (otherFaction.isSafeZone()) {
if (otherFaction.isSafeZone() && Conf.safeZoneDenyUseage) {
if (Factions.hasPermManageSafeZone(player)) {
return true;
}