Fire PlayerArmorChangeEvent for more cases

This commit is contained in:
Zach Brown 2019-03-03 15:21:51 -05:00
parent f0d45d4eab
commit 814356359a
No known key found for this signature in database
GPG Key ID: CC9DA35FC5450B76
2 changed files with 9 additions and 9 deletions

View File

@ -1,11 +1,11 @@
From 1350655d71b5c9ecdabe801c33678c48838a4535 Mon Sep 17 00:00:00 2001 From 11940ada751fdf632cdd95c754ba8de96c2b1456 Mon Sep 17 00:00:00 2001
From: pkt77 <parkerkt77@gmail.com> From: pkt77 <parkerkt77@gmail.com>
Date: Fri, 10 Nov 2017 23:46:34 -0500 Date: Fri, 10 Nov 2017 23:46:34 -0500
Subject: [PATCH] Add PlayerArmorChangeEvent Subject: [PATCH] Add PlayerArmorChangeEvent
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index 46a09faf9..49e55ebdb 100644 index 46a09faf9..316b66cc4 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java --- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
@ -20,7 +20,7 @@ index 46a09faf9..49e55ebdb 100644
if (!ItemStack.matches(itemstack1, itemstack)) { if (!ItemStack.matches(itemstack1, itemstack)) {
+ // Paper start - PlayerArmorChangeEvent + // Paper start - PlayerArmorChangeEvent
+ if (this instanceof EntityPlayer && enumitemslot.getType() == EnumItemSlot.Function.ARMOR && !itemstack.getItem().equals(itemstack1.getItem())) { + if (this instanceof EntityPlayer && enumitemslot.getType() == EnumItemSlot.Function.ARMOR) {
+ final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack); + final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack);
+ final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack1); + final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack1);
+ new PlayerArmorChangeEvent((Player) this.getBukkitEntity(), PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent(); + new PlayerArmorChangeEvent((Player) this.getBukkitEntity(), PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent();
@ -42,5 +42,5 @@ index a9a133993..8f4b5dca9 100644
return this.g; return this.g;
} }
-- --
2.20.1 2.21.0

View File

@ -1,4 +1,4 @@
From a4b32478b53f263fe1a08efe28c5ac09d5e85cef Mon Sep 17 00:00:00 2001 From 08bbc4d2c03b381ae4444f6920fa37bf2a9a66e8 Mon Sep 17 00:00:00 2001
From: kashike <kashike@vq.lc> From: kashike <kashike@vq.lc>
Date: Wed, 15 Aug 2018 01:26:09 -0700 Date: Wed, 15 Aug 2018 01:26:09 -0700
Subject: [PATCH] Allow disabling armour stand ticking Subject: [PATCH] Allow disabling armour stand ticking
@ -141,7 +141,7 @@ index c604182dd..2c54e3e34 100644
public Vector3f r() { public Vector3f r() {
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
index fa4c593de..d94f5e609 100644 index bca5136dc..497b5ceb5 100644
--- a/src/main/java/net/minecraft/server/EntityLiving.java --- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java
@@ -2083,52 +2083,7 @@ public abstract class EntityLiving extends Entity { @@ -2083,52 +2083,7 @@ public abstract class EntityLiving extends Entity {
@ -170,7 +170,7 @@ index fa4c593de..d94f5e609 100644
- -
- if (!ItemStack.matches(itemstack1, itemstack)) { - if (!ItemStack.matches(itemstack1, itemstack)) {
- // Paper start - PlayerArmorChangeEvent - // Paper start - PlayerArmorChangeEvent
- if (this instanceof EntityPlayer && enumitemslot.getType() == EnumItemSlot.Function.ARMOR && !itemstack.getItem().equals(itemstack1.getItem())) { - if (this instanceof EntityPlayer && enumitemslot.getType() == EnumItemSlot.Function.ARMOR) {
- final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack); - final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack);
- final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack1); - final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack1);
- new PlayerArmorChangeEvent((Player) this.getBukkitEntity(), PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent(); - new PlayerArmorChangeEvent((Player) this.getBukkitEntity(), PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent();
@ -226,7 +226,7 @@ index fa4c593de..d94f5e609 100644
+ +
+ if (!ItemStack.matches(itemstack1, itemstack)) { + if (!ItemStack.matches(itemstack1, itemstack)) {
+ // Paper start - PlayerArmorChangeEvent + // Paper start - PlayerArmorChangeEvent
+ if (this instanceof EntityPlayer && enumitemslot.getType() == EnumItemSlot.Function.ARMOR && !itemstack.getItem().equals(itemstack1.getItem())) { + if (this instanceof EntityPlayer && enumitemslot.getType() == EnumItemSlot.Function.ARMOR) {
+ final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack); + final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack);
+ final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack1); + final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack1);
+ new PlayerArmorChangeEvent((Player) this.getBukkitEntity(), PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent(); + new PlayerArmorChangeEvent((Player) this.getBukkitEntity(), PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent();
@ -277,5 +277,5 @@ index 9f5c3b92e..07ce93f17 100644
// Paper end // Paper end
} }
-- --
2.20.1 2.21.0