mirror of
https://github.com/Minestom/Minestom.git
synced 2024-12-29 04:28:21 +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();
|
final EquipmentSlot equipmentSlot = material.registry().equipmentSlot();
|
||||||
if (equipmentSlot != null) {
|
if (equipmentSlot != null) {
|
||||||
final ItemStack currentlyEquipped = playerInventory.getEquipment(equipmentSlot);
|
final ItemStack currentlyEquipped = playerInventory.getEquipment(equipmentSlot);
|
||||||
playerInventory.setEquipment(equipmentSlot, itemStack);
|
if (currentlyEquipped.isAir()) {
|
||||||
playerInventory.setItemInHand(hand, currentlyEquipped);
|
playerInventory.setEquipment(equipmentSlot, itemStack);
|
||||||
|
playerInventory.setItemInHand(hand, currentlyEquipped);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PlayerItemAnimationEvent.ItemAnimationType itemAnimationType = null;
|
PlayerItemAnimationEvent.ItemAnimationType itemAnimationType = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user