From c0bd5688b53672eeeb63ed19ec76af2e2dc629b9 Mon Sep 17 00:00:00 2001 From: Pedro <3602279+Doc94@users.noreply.github.com> Date: Mon, 14 Apr 2025 16:12:09 -0400 Subject: [PATCH] Add logic for Human canUseEquipmentSlot (#12433) --- .../org/bukkit/craftbukkit/entity/CraftHumanEntity.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index fc432152a..e0e6a5087 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -41,6 +41,7 @@ import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.NamespacedKey; import org.bukkit.block.Block; +import org.bukkit.craftbukkit.CraftEquipmentSlot; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.event.CraftEventFactory; import org.bukkit.craftbukkit.inventory.CraftContainer; @@ -922,6 +923,12 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { return success ? (Firework) fireworks.getBukkitEntity() : null; } + @Override + public boolean canUseEquipmentSlot(org.bukkit.inventory.EquipmentSlot slot) { + net.minecraft.world.entity.EquipmentSlot equipmentSlot = CraftEquipmentSlot.getNMS(slot); + return (equipmentSlot.getType() == net.minecraft.world.entity.EquipmentSlot.Type.HUMANOID_ARMOR || equipmentSlot.getType() == net.minecraft.world.entity.EquipmentSlot.Type.HAND) && super.canUseEquipmentSlot(slot); + } + @Override public org.bukkit.entity.Entity copy() { throw new UnsupportedOperationException("Cannot copy human entities");