mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-28 12:07:42 +01:00
Right-click equip should only work if the current equipment is air
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
1851ea7eca
commit
c9f52397cb
@ -34,8 +34,10 @@ public class UseItemListener {
|
||||
final EquipmentSlot equipmentSlot = material.registry().equipmentSlot();
|
||||
if (equipmentSlot != null) {
|
||||
final ItemStack currentlyEquipped = playerInventory.getEquipment(equipmentSlot);
|
||||
playerInventory.setEquipment(equipmentSlot, itemStack);
|
||||
playerInventory.setItemInHand(hand, currentlyEquipped);
|
||||
if (currentlyEquipped.isAir()) {
|
||||
playerInventory.setEquipment(equipmentSlot, itemStack);
|
||||
playerInventory.setItemInHand(hand, currentlyEquipped);
|
||||
}
|
||||
}
|
||||
|
||||
PlayerItemAnimationEvent.ItemAnimationType itemAnimationType = null;
|
||||
|
Loading…
Reference in New Issue
Block a user