From 26dd2f7cbd5273d5ac396b507c674dd7e56eb838 Mon Sep 17 00:00:00 2001 From: Olof Larsson Date: Mon, 23 Mar 2015 09:11:53 +0100 Subject: [PATCH] Remove monster targeting cancellation. It is interpreted as a bug by some and is not expected behavior. --- .../factions/engine/EngineMain.java | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/src/com/massivecraft/factions/engine/EngineMain.java b/src/com/massivecraft/factions/engine/EngineMain.java index bb37531e..b59b5a9f 100644 --- a/src/com/massivecraft/factions/engine/EngineMain.java +++ b/src/com/massivecraft/factions/engine/EngineMain.java @@ -44,7 +44,6 @@ import org.bukkit.event.entity.EntityCombustByEntityEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityExplodeEvent; -import org.bukkit.event.entity.EntityTargetEvent; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.PotionSplashEvent; import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; @@ -1150,32 +1149,6 @@ public class EngineMain extends EngineAbstract // ... block the spawn. event.setCancelled(true); } - - @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) - public void blockMonsters(EntityTargetEvent event) - { - // If a monster ... - if ( ! MConf.get().entityTypesMonsters.contains(event.getEntityType())) return; - - // ... is targeting something ... - Entity target = event.getTarget(); - if (target == null) return; - - // ... at a place where monsters are forbidden ... - PS ps = PS.valueOf(target.getLocation()); - Faction faction = BoardColl.get().getFactionAt(ps); - if (faction.getFlag(MFlag.getFlagMonsters())) return; - - // ... then if ghast target nothing ... - if (event.getEntityType() == EntityType.GHAST) - { - event.setTarget(null); - return; - } - - // ... otherwise simply cancel. - event.setCancelled(true); - } // -------------------------------------------- // // FLAG: EXPLOSIONS