item frame cancel!

This commit is contained in:
Cheese 2015-11-27 22:27:20 +11:00
parent ec0e2d2d64
commit 53da9c97d0

View File

@ -23,6 +23,7 @@ import org.bukkit.event.block.BlockIgniteEvent;
import org.bukkit.event.block.BlockIgniteEvent.IgniteCause;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDeathEvent;
import org.bukkit.event.entity.EntitySpawnEvent;
import org.bukkit.event.entity.EntityTargetEvent;
@ -159,6 +160,30 @@ public class Spawn extends MiniPlugin
}
}
@EventHandler
public void onItemFrameDamage(CustomDamageEvent event)
{
if (event.GetDamageeEntity() instanceof ItemFrame)
{
if (isInSpawn(event.GetDamageeEntity().getLocation()))
{
event.SetCancelled("Item Frame Cancel");
}
}
}
@EventHandler
public void onItemFrameDamage(EntityDamageEvent event)
{
if (event.getEntity() instanceof ItemFrame)
{
if (isInSpawn(event.getEntity().getLocation()))
{
event.setCancelled(true);
}
}
}
@EventHandler
public void Update(UpdateEvent event)
{