Prevent death effect armor stand modification
This commit is contained in:
parent
8874b52b39
commit
aff5396384
@ -32,9 +32,9 @@ import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.event.entity.ItemSpawnEvent;
|
||||
import org.bukkit.event.entity.PlayerDeathEvent;
|
||||
import org.bukkit.event.player.PlayerArmorStandManipulateEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerDropItemEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
@ -1422,17 +1422,16 @@ public class BawkBawkBattles extends TeamGame implements IThrown
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void blockDeathEffectHeadInteract(PlayerInteractEntityEvent event)
|
||||
public void blockDeathEffectHeadModification(PlayerArmorStandManipulateEvent event)
|
||||
{
|
||||
if (event.getRightClicked().getType() == EntityType.ARMOR_STAND)
|
||||
ArmorStand armorStand = event.getRightClicked();
|
||||
|
||||
for (DeathEffectData data : _deathEffect.getData())
|
||||
{
|
||||
for (DeathEffectData data : _deathEffect.getData())
|
||||
if (data.isChickenHead(armorStand))
|
||||
{
|
||||
if (data.getChickenHead().equals(event.getRightClicked()))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
event.setCancelled(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,11 @@ public class DeathEffectData
|
||||
_player = player;
|
||||
_death = death;
|
||||
}
|
||||
|
||||
public boolean isChickenHead(ArmorStand armorStand)
|
||||
{
|
||||
return _chickenHead.equals(armorStand);
|
||||
}
|
||||
|
||||
public void addFoodItems(ArrayList<Item> foodItems)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user