aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVivian Horvath <[email protected]>2024-11-15 09:00:33 +0000
committerGitHub <[email protected]>2024-11-15 10:00:33 +0100
commitbe886cf4e7ba906a3e79d9d38835d35abf60a0ce (patch)
treeca7edaa819395a95f6b185bb68df68af5fa132bf
parent13f48d832071fe20f7fa1292001d88757a64c659 (diff)
downloadPaper-be886cf4e7ba906a3e79d9d38835d35abf60a0ce.tar.gz
Paper-be886cf4e7ba906a3e79d9d38835d35abf60a0ce.zip
Fix Naming issue inside Add PlayerArmorChangeEvent (#11614)
-rw-r--r--patches/server/0156-Add-PlayerArmorChangeEvent.patch16
1 files changed, 11 insertions, 5 deletions
diff --git a/patches/server/0156-Add-PlayerArmorChangeEvent.patch b/patches/server/0156-Add-PlayerArmorChangeEvent.patch
index 0097500daf..cd83cc1481 100644
--- a/patches/server/0156-Add-PlayerArmorChangeEvent.patch
+++ b/patches/server/0156-Add-PlayerArmorChangeEvent.patch
@@ -5,17 +5,23 @@ Subject: [PATCH] Add PlayerArmorChangeEvent
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-index 009539fa39c81c610ac34747cc09082a0756c79d..08322f6147b78d140a2e0d6c3189ee95270c3c71 100644
+index 009539fa39c81c610ac34747cc09082a0756c79d..a03583daf6cac850c154e0e89dc3fa00a844903f 100644
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
-@@ -3284,6 +3284,13 @@ public abstract class LivingEntity extends Entity implements Attackable {
+@@ -3280,10 +3280,17 @@ 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