From 5a9b3c9e23409b5377c019b8de8068a2b1da1a35 Mon Sep 17 00:00:00 2001 From: Vivian Horvath Date: Fri, 15 Nov 2024 09:00:33 +0000 Subject: [PATCH] Fix Naming issue inside Add PlayerArmorChangeEvent (#11614) --- patches/server/Add-PlayerArmorChangeEvent.patch | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/patches/server/Add-PlayerArmorChangeEvent.patch b/patches/server/Add-PlayerArmorChangeEvent.patch index da2e0c37ca..7a51eb27af 100644 --- a/patches/server/Add-PlayerArmorChangeEvent.patch +++ b/patches/server/Add-PlayerArmorChangeEvent.patch @@ -9,13 +9,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/world/entity/LivingEntity.java +++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java @@ -0,0 +0,0 @@ public abstract class LivingEntity extends Entity implements Attackable { + throw new MatchException((String) null, (Throwable) null); + } - itemstack = this.getItemBySlot(enumitemslot); +- ItemStack itemstack2 = itemstack1; ++ ItemStack itemstack2 = itemstack1; final ItemStack oldEquipment = itemstack2; // Paper - PlayerArmorChangeEvent - obfhelper + +- itemstack = this.getItemBySlot(enumitemslot); ++ itemstack = this.getItemBySlot(enumitemslot); final ItemStack newEquipment = itemstack;// Paper - PlayerArmorChangeEvent - obfhelper if (this.equipmentHasChanged(itemstack2, itemstack)) { + // Paper start - PlayerArmorChangeEvent + if (this instanceof ServerPlayer && enumitemslot.getType() == EquipmentSlot.Type.HUMANOID_ARMOR) { -+ final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack1); -+ final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack2); ++ final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(oldEquipment); ++ final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(newEquipment); + new com.destroystokyo.paper.event.player.PlayerArmorChangeEvent((Player) this.getBukkitEntity(), com.destroystokyo.paper.event.player.PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent(); + } + // Paper end - PlayerArmorChangeEvent