3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-14 20:10:05 +01:00

Addressed feedback on PR #11614

Dieser Commit ist enthalten in:
Vivian Horvath 2024-11-13 12:50:47 -05:00
Ursprung 33df981a54
Commit cbb122d816

Datei anzeigen

@ -5,12 +5,18 @@ 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..2234846e5031261c403d3a9fe463825185569596 100644
index 009539fa39c81c610ac34747cc09082a0756c79d..04704d729c1e8b170866f4101442da839a52f235 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) {