mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 18:45:54 +01:00
ce2eae5ce3
Upstream has released updates that appears to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing
Bukkit Changes:
b56e8160 #519: Add ArrowBodyCountChangeEvent
CraftBukkit Changes:
39806409e
#697: Add ArrowBodyCountChangeEvent
44 lines
2.2 KiB
Diff
44 lines
2.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: pkt77 <parkerkt77@gmail.com>
|
|
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 01130113c699047002640ccacf6210ca9a536ec1..77f95e26d1e5d3c505d412f863a85c7c3880ef0e 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
@@ -1,5 +1,6 @@
|
|
package net.minecraft.server;
|
|
|
|
+import com.destroystokyo.paper.event.player.PlayerArmorChangeEvent; // Paper
|
|
import com.google.common.base.Objects;
|
|
import com.google.common.collect.ImmutableList;
|
|
import com.google.common.collect.ImmutableMap;
|
|
@@ -2533,6 +2534,13 @@ public abstract class EntityLiving extends Entity {
|
|
ItemStack itemstack1 = this.getEquipment(enumitemslot);
|
|
|
|
if (!ItemStack.matches(itemstack1, itemstack)) {
|
|
+ // Paper start - PlayerArmorChangeEvent
|
|
+ if (this instanceof EntityPlayer && enumitemslot.getType() == EnumItemSlot.Function.ARMOR) {
|
|
+ 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();
|
|
+ }
|
|
+ // Paper end
|
|
if (map == null) {
|
|
map = Maps.newEnumMap(EnumItemSlot.class);
|
|
}
|
|
diff --git a/src/main/java/net/minecraft/server/EnumItemSlot.java b/src/main/java/net/minecraft/server/EnumItemSlot.java
|
|
index 02a7ae6785b0539e4aa567fca377d727184fd019..60b235f16f5e762d635efa1578b715db445513a5 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;
|
|
}
|