use of org.bukkit.inventory.EntityEquipment in project Denizen-For-Bukkit by DenizenScript.
the class PacketHelper_v1_10_R1 method resetEquipment.
@Override
public void resetEquipment(Player player, LivingEntity entity) {
EntityEquipment equipment = entity.getEquipment();
showEquipment(player, entity, EquipmentSlot.HAND, equipment.getItemInMainHand());
showEquipment(player, entity, EquipmentSlot.OFF_HAND, equipment.getItemInOffHand());
showEquipment(player, entity, EquipmentSlot.HEAD, equipment.getHelmet());
showEquipment(player, entity, EquipmentSlot.CHEST, equipment.getChestplate());
showEquipment(player, entity, EquipmentSlot.LEGS, equipment.getLeggings());
showEquipment(player, entity, EquipmentSlot.FEET, equipment.getBoots());
}
use of org.bukkit.inventory.EntityEquipment in project Denizen-For-Bukkit by DenizenScript.
the class PlayerEquipsArmorScriptEvent method handleChangedArmor.
private void handleChangedArmor(final Player player, final String reason) {
EntityEquipment oldEquipment = player.getEquipment();
final ItemStack oldHelmet = oldEquipment.getHelmet();
final ItemStack oldChestplate = oldEquipment.getChestplate();
final ItemStack oldLeggings = oldEquipment.getLeggings();
final ItemStack oldBoots = oldEquipment.getBoots();
Bukkit.getScheduler().runTaskLater(DenizenAPI.getCurrentInstance(), new Runnable() {
@Override
public void run() {
EntityEquipment newEquipment = player.getEquipment();
handleEvent(player, "helmet", oldHelmet, newEquipment.getHelmet(), reason);
handleEvent(player, "chestplate", oldChestplate, newEquipment.getChestplate(), reason);
handleEvent(player, "leggings", oldLeggings, newEquipment.getLeggings(), reason);
handleEvent(player, "boots", oldBoots, newEquipment.getBoots(), reason);
}
}, 1);
}
use of org.bukkit.inventory.EntityEquipment in project Denizen-For-Bukkit by DenizenScript.
the class PacketHelper_v1_11_R1 method resetEquipment.
@Override
public void resetEquipment(Player player, LivingEntity entity) {
EntityEquipment equipment = entity.getEquipment();
showEquipment(player, entity, EquipmentSlot.HAND, equipment.getItemInMainHand());
showEquipment(player, entity, EquipmentSlot.OFF_HAND, equipment.getItemInOffHand());
showEquipment(player, entity, EquipmentSlot.HEAD, equipment.getHelmet());
showEquipment(player, entity, EquipmentSlot.CHEST, equipment.getChestplate());
showEquipment(player, entity, EquipmentSlot.LEGS, equipment.getLeggings());
showEquipment(player, entity, EquipmentSlot.FEET, equipment.getBoots());
}
use of org.bukkit.inventory.EntityEquipment in project Denizen-For-Bukkit by DenizenScript.
the class PacketHelper_v1_8_R3 method resetEquipment.
@Override
public void resetEquipment(Player player, LivingEntity entity) {
EntityEquipment equipment = entity.getEquipment();
showEquipment(player, entity, EquipmentSlot.HAND, equipment.getItemInHand());
showEquipment(player, entity, EquipmentSlot.HEAD, equipment.getHelmet());
showEquipment(player, entity, EquipmentSlot.CHEST, equipment.getChestplate());
showEquipment(player, entity, EquipmentSlot.LEGS, equipment.getLeggings());
showEquipment(player, entity, EquipmentSlot.FEET, equipment.getBoots());
}
use of org.bukkit.inventory.EntityEquipment in project Sentinel by mcmonkey4eva.
the class SentinelTrait method isInvisible.
public boolean isInvisible(LivingEntity entity) {
SentinelCurrentTarget sct = new SentinelCurrentTarget();
sct.targetID = entity.getUniqueId();
EntityEquipment eq = entity.getEquipment();
return entity.hasPotionEffect(PotionEffectType.INVISIBILITY) && !currentTargets.contains(sct) && isAir(eq.getItemInHand()) && isAir(eq.getBoots()) && isAir(eq.getLeggings()) && isAir(eq.getChestplate()) && isAir(eq.getHelmet()) && SentinelPlugin.instance.getConfig().getBoolean("random.ignore invisible targets");
}
Aggregations