Fixed ArmorEquipEvent calling

This commit is contained in:
Felix Cravic 2020-05-14 18:59:01 +02:00
parent aeeb9f08a4
commit 4a287f82a6
3 changed files with 6 additions and 6 deletions

View File

@ -263,7 +263,7 @@ public abstract class EntityCreature extends LivingEntity {
}
private ItemStack getEquipmentItem(ItemStack itemStack, ArmorEquipEvent.ArmorSlot armorSlot) {
ArmorEquipEvent armorEquipEvent = new ArmorEquipEvent(itemStack, armorSlot);
ArmorEquipEvent armorEquipEvent = new ArmorEquipEvent(this, itemStack, armorSlot);
callEvent(ArmorEquipEvent.class, armorEquipEvent);
return armorEquipEvent.getArmorItem();
}

View File

@ -192,13 +192,13 @@ public class PlayerInventory implements InventoryModifier, InventoryClickHandler
ArmorEquipEvent armorEquipEvent = null;
if (slot == HELMET_SLOT) {
armorEquipEvent = new ArmorEquipEvent(itemStack, ArmorEquipEvent.ArmorSlot.HELMET);
armorEquipEvent = new ArmorEquipEvent(player, itemStack, ArmorEquipEvent.ArmorSlot.HELMET);
} else if (slot == CHESTPLATE_SLOT) {
armorEquipEvent = new ArmorEquipEvent(itemStack, ArmorEquipEvent.ArmorSlot.CHESTPLATE);
armorEquipEvent = new ArmorEquipEvent(player, itemStack, ArmorEquipEvent.ArmorSlot.CHESTPLATE);
} else if (slot == LEGGINGS_SLOT) {
armorEquipEvent = new ArmorEquipEvent(itemStack, ArmorEquipEvent.ArmorSlot.LEGGINGS);
armorEquipEvent = new ArmorEquipEvent(player, itemStack, ArmorEquipEvent.ArmorSlot.LEGGINGS);
} else if (slot == BOOTS_SLOT) {
armorEquipEvent = new ArmorEquipEvent(itemStack, ArmorEquipEvent.ArmorSlot.BOOTS);
armorEquipEvent = new ArmorEquipEvent(player, itemStack, ArmorEquipEvent.ArmorSlot.BOOTS);
}
if (armorEquipEvent != null) {

View File

@ -38,7 +38,7 @@ public class UseItemListener {
} else {
armorSlot = ArmorEquipEvent.ArmorSlot.BOOTS;
}
ArmorEquipEvent armorEquipEvent = new ArmorEquipEvent(itemStack, armorSlot);
ArmorEquipEvent armorEquipEvent = new ArmorEquipEvent(player, itemStack, armorSlot);
player.callEvent(ArmorEquipEvent.class, armorEquipEvent);
ItemStack armorItem = armorEquipEvent.getArmorItem();