mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-05 15:01:46 +01:00
fix: do not try to equip "body" equipment to players
This commit is contained in:
parent
d707b0674f
commit
7b659f0fc3
@ -1,5 +1,6 @@
|
|||||||
package net.minestom.server.listener;
|
package net.minestom.server.listener;
|
||||||
|
|
||||||
|
import net.minestom.server.entity.EquipmentSlot;
|
||||||
import net.minestom.server.entity.Player;
|
import net.minestom.server.entity.Player;
|
||||||
import net.minestom.server.entity.PlayerHand;
|
import net.minestom.server.entity.PlayerHand;
|
||||||
import net.minestom.server.event.EventDispatcher;
|
import net.minestom.server.event.EventDispatcher;
|
||||||
@ -88,7 +89,7 @@ public class UseItemListener {
|
|||||||
|
|
||||||
// If the item was not usable, we can try to do an equipment swap with it.
|
// If the item was not usable, we can try to do an equipment swap with it.
|
||||||
final Equippable equippable = itemStack.get(ItemComponent.EQUIPPABLE);
|
final Equippable equippable = itemStack.get(ItemComponent.EQUIPPABLE);
|
||||||
if (equippable != null && equippable.swappable()) {
|
if (equippable != null && equippable.swappable() && equippable.slot() != EquipmentSlot.BODY) {
|
||||||
final ItemStack currentlyEquipped = player.getEquipment(equippable.slot());
|
final ItemStack currentlyEquipped = player.getEquipment(equippable.slot());
|
||||||
player.setEquipment(equippable.slot(), itemStack);
|
player.setEquipment(equippable.slot(), itemStack);
|
||||||
player.setItemInHand(hand, currentlyEquipped);
|
player.setItemInHand(hand, currentlyEquipped);
|
||||||
|
Loading…
Reference in New Issue
Block a user