diff options
Diffstat (limited to 'patches/server/1046-Fix-equipment-slot-and-group-API.patch')
-rw-r--r-- | patches/server/1046-Fix-equipment-slot-and-group-API.patch | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/patches/server/1046-Fix-equipment-slot-and-group-API.patch b/patches/server/1046-Fix-equipment-slot-and-group-API.patch index 71bb23060d..8bfd78d2c2 100644 --- a/patches/server/1046-Fix-equipment-slot-and-group-API.patch +++ b/patches/server/1046-Fix-equipment-slot-and-group-API.patch @@ -5,8 +5,34 @@ Subject: [PATCH] Fix equipment slot and group API Add test for EquipmentSlotGroup +diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java +index 9d74577af071954e1e37201a96368c1360076209..eafa54c870c3e2aef30c3f9f96f516607a7cae24 100644 +--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java ++++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftInventoryPlayer.java +@@ -135,6 +135,10 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i + case HEAD: + this.setHelmet(item); + break; ++ // Paper start ++ case BODY: ++ throw new IllegalArgumentException("BODY is not valid for players!"); ++ // Paper end + default: + throw new IllegalArgumentException("Not implemented. This is a bug"); + } +@@ -162,6 +166,10 @@ public class CraftInventoryPlayer extends CraftInventory implements org.bukkit.i + return java.util.Objects.requireNonNullElseGet(this.getChestplate(), () -> new ItemStack(org.bukkit.Material.AIR)); // Paper - make nonnull + case HEAD: + return java.util.Objects.requireNonNullElseGet(this.getHelmet(), () -> new ItemStack(org.bukkit.Material.AIR)); // Paper - make nonnull ++ // Paper start ++ case BODY: ++ throw new IllegalArgumentException("BODY is not valid for players!"); ++ // Paper end + default: + throw new IllegalArgumentException("Not implemented. This is a bug"); + } diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java -index 860bc5ec4baec5e09a456cc5559d0de2aa10797a..554dc8b6b142c185d1dd0c4a3450232b7b708f1b 100644 +index c235b80b94fdb6c77766016114713cd501ffd67c..d5789326d70bb8b029c5448270bbaa6faf52e6e1 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaItem.java @@ -1331,7 +1331,7 @@ class CraftMetaItem implements ItemMeta, Damageable, Repairable, BlockDataMeta { |