New conf.json setting "worldsIgnorePvP" as a list of worlds which you don't want Factions to pay any attention to PvP in. No new command has been added to set this, since we now have the /f config command. So, to add/remove worlds, simply use /f config worldsIgnorePvP [YourWorldHere].

This commit is contained in:
Brettflan 2011-08-01 20:22:16 -05:00
parent f38651ca94
commit 92448ca4d2
2 changed files with 10 additions and 2 deletions

View File

@ -164,6 +164,7 @@ public class Conf {
public static Set<String> worldsNoClaiming = new HashSet<String>();
public static Set<String> worldsNoPowerLoss = new HashSet<String>();
public static Set<String> worldsIgnorePvP = new HashSet<String>();
public static transient int mapHeight = 8;
public static transient int mapWidth = 39;

View File

@ -3,6 +3,7 @@ package com.massivecraft.factions.listeners;
import java.text.MessageFormat;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Creeper;
import org.bukkit.entity.Entity;
import org.bukkit.entity.Fireball;
@ -153,12 +154,17 @@ public class FactionsEntityListener extends EntityListener {
return true;
}
Location defenderLoc = defender.getPlayer().getLocation();
if (Conf.worldsIgnorePvP.contains(defenderLoc.getWorld().getName())) {
return true;
}
// Players can not take attack damage in a SafeZone
if (Board.getFactionAt(new FLocation(defender)).isSafeZone()) {
if (Board.getFactionAt(new FLocation(defenderLoc)).isSafeZone()) {
if (damager instanceof Player) {
FPlayer attacker = FPlayer.get((Player)damager);
attacker.sendMessage("You can't hurt other players in a SafeZone.");
// defender.sendMessage(attacker.getNameAndRelevant(defender)+Conf.colorSystem+" tried to hurt you.");
}
return false;
}
@ -237,6 +243,7 @@ public class FactionsEntityListener extends EntityListener {
return true;
}
@Override
public void onCreatureSpawn(CreatureSpawnEvent event) {
if (event.isCancelled()) {
return;