mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-01 05:58:00 +01:00
Fixed ArmorEquipEvent calling
This commit is contained in:
parent
aeeb9f08a4
commit
4a287f82a6
@ -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();
|
||||
}
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user