mirror of
https://github.com/PaperMC/Paper.git
synced 2025-07-31 20:22:05 -07:00
Expose LivingEntity#canUseSlot (#10930)
This commit is contained in:
@@ -3,8 +3,28 @@ From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
Date: Wed, 22 May 2024 10:01:19 -0700
|
||||
Subject: [PATCH] Fix equipment slot and group API
|
||||
|
||||
Add test for EquipmentSlotGroup
|
||||
Adds the following:
|
||||
- Add test for EquipmentSlotGroup
|
||||
- Expose LivingEntity#canUseSlot
|
||||
|
||||
Co-authored-by: SoSeDiK <mrsosedik@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java
|
||||
@@ -0,0 +0,0 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
this.getHandle().setYBodyRot(bodyYaw);
|
||||
}
|
||||
// Paper end - body yaw API
|
||||
+
|
||||
+ // Paper start - Expose canUseSlot
|
||||
+ @Override
|
||||
+ public boolean canUseEquipmentSlot(org.bukkit.inventory.EquipmentSlot slot) {
|
||||
+ return this.getHandle().canUseSlot(org.bukkit.craftbukkit.CraftEquipmentSlot.getNMS(slot));
|
||||
+ }
|
||||
+ // Paper end - Expose canUseSlot
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java
|
||||
|
Reference in New Issue
Block a user