Added config option territoryBlockFireballs, defaults to false; if enabled, prevents destruction of blocks by Ghast fireballs inside faction territory... note that this only works in CB build 557 and higher, where fireball detection was added
This commit is contained in:
parent
45162a3444
commit
d5308bc75d
@ -361,9 +361,6 @@ public class Commands {
|
||||
}
|
||||
page -= 1;
|
||||
|
||||
|
||||
// TODO Doesn't the second sort bellow completely overwrite the first??
|
||||
|
||||
// Sort by total followers first
|
||||
Collections.sort(FactionList, new Comparator<Faction>(){
|
||||
@Override
|
||||
|
@ -43,6 +43,8 @@ public class Conf {
|
||||
|
||||
public static double territoryShieldFactor = 0.5;
|
||||
public static boolean territoryBlockCreepers = false;
|
||||
public static boolean territoryBlockFireballs = false;
|
||||
|
||||
public static List<Material> territoryProtectedMaterials = new ArrayList<Material>();
|
||||
|
||||
// Command names / aliases
|
||||
|
@ -4,6 +4,7 @@ import java.text.MessageFormat;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Fireball;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@ -75,6 +76,14 @@ public class FactionsEntityListener extends EntityListener {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (Conf.territoryBlockFireballs && event.getEntity() instanceof Fireball)
|
||||
{ // ghast fireball which might need prevention, if inside faction territory
|
||||
if (Board.get(event.getLocation().getWorld()).getFactionIdAt(Coord.from(event.getLocation())) > 0)
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean canDamagerHurtDamagee(EntityDamageByEntityEvent sub) {
|
||||
|
Loading…
Reference in New Issue
Block a user