diff --git a/Spigot-Server-Patches/0250-Add-PlayerArmorChangeEvent.patch b/Spigot-Server-Patches/0250-Add-PlayerArmorChangeEvent.patch index 62f728e073..82db8ffa2a 100644 --- a/Spigot-Server-Patches/0250-Add-PlayerArmorChangeEvent.patch +++ b/Spigot-Server-Patches/0250-Add-PlayerArmorChangeEvent.patch @@ -1,11 +1,11 @@ -From e2873d6dbc62fb4bfa94eb918e83c606937d95ae Mon Sep 17 00:00:00 2001 +From fb607ad9851b223ee5585c4e0e873ea33d80a8c7 Mon Sep 17 00:00:00 2001 From: pkt77 Date: Fri, 10 Nov 2017 23:46:34 -0500 Subject: [PATCH] Add PlayerArmorChangeEvent diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java -index 135a9c0e..5e17d107 100644 +index 135a9c0e..559aebf2 100644 --- a/src/main/java/net/minecraft/server/EntityLiving.java +++ b/src/main/java/net/minecraft/server/EntityLiving.java @@ -1,5 +1,6 @@ @@ -20,7 +20,7 @@ index 135a9c0e..5e17d107 100644 if (!ItemStack.matches(itemstack1, itemstack)) { + // Paper start - PlayerArmorChangeEvent -+ if (this instanceof EntityPlayer && enumitemslot.a() == EnumItemSlot.Function.ARMOR && !itemstack.getItem().equals(itemstack1.getItem())) { ++ if (this instanceof EntityPlayer && enumitemslot.getType() == EnumItemSlot.Function.ARMOR && !itemstack.getItem().equals(itemstack1.getItem())) { + final org.bukkit.inventory.ItemStack oldItem = CraftItemStack.asBukkitCopy(itemstack); + final org.bukkit.inventory.ItemStack newItem = CraftItemStack.asBukkitCopy(itemstack1); + new PlayerArmorChangeEvent((Player) this.getBukkitEntity(), PlayerArmorChangeEvent.SlotType.valueOf(enumitemslot.name()), oldItem, newItem).callEvent(); @@ -29,6 +29,18 @@ index 135a9c0e..5e17d107 100644 ((WorldServer) this.world).getTracker().a((Entity) this, (Packet) (new PacketPlayOutEntityEquipment(this.getId(), enumitemslot, itemstack1))); if (!itemstack.isEmpty()) { this.getAttributeMap().a(itemstack.a(enumitemslot)); +diff --git a/src/main/java/net/minecraft/server/EnumItemSlot.java b/src/main/java/net/minecraft/server/EnumItemSlot.java +index cdf3a3ba..be5d0bf8 100644 +--- a/src/main/java/net/minecraft/server/EnumItemSlot.java ++++ b/src/main/java/net/minecraft/server/EnumItemSlot.java +@@ -16,6 +16,7 @@ public enum EnumItemSlot { + this.j = s; + } + ++ public EnumItemSlot.Function getType() { return this.a(); } // Paper - OBFHELPER + public EnumItemSlot.Function a() { + return this.g; + } -- 2.14.2 diff --git a/scripts/importmcdev.sh b/scripts/importmcdev.sh index dfd01204fa..3cfd521840 100755 --- a/scripts/importmcdev.sh +++ b/scripts/importmcdev.sh @@ -63,10 +63,11 @@ import DataInspectorBlockEntity import DataPalette import DefinedStructure import EntityLlama -import EULA import EntitySquid import EntityTypes import EntityWaterAnimal +import EnumItemSlot +import EULA import FileIOThread import IHopper import ItemBlock @@ -75,7 +76,6 @@ import ItemMonsterEgg import NavigationAbstract import NBTTagCompound import NBTTagList -import PersistentScoreboard import PacketPlayInUseEntity import PacketPlayOutMapChunk import PacketPlayOutPlayerListHeaderFooter @@ -87,6 +87,7 @@ import PathfinderGoal import PathfinderGoalFloat import PathfinderGoalGotoTarget import PathfinderWater +import PersistentScoreboard import PersistentVillage import PlayerConnectionUtils import RegionFile