summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2018-03-24 16:13:17 +1100
committermd_5 <git@md-5.net>2018-03-24 16:13:17 +1100
commitaa255689c1e00b77b066440bbfd2d84b641bfd58 (patch)
tree7308ee5b9afe2357e7bc8e8e1b2ce7daa43a63ca
parent3fed09cc4262956bbb419841b1469dafc1139b9e (diff)
downloadcraftbukkit-aa255689c1e00b77b066440bbfd2d84b641bfd58.tar
craftbukkit-aa255689c1e00b77b066440bbfd2d84b641bfd58.tar.gz
craftbukkit-aa255689c1e00b77b066440bbfd2d84b641bfd58.tar.lz
craftbukkit-aa255689c1e00b77b066440bbfd2d84b641bfd58.tar.xz
craftbukkit-aa255689c1e00b77b066440bbfd2d84b641bfd58.zip
SPIGOT-3869: More resurrect fixes
-rw-r--r--nms-patches/EntityLiving.patch8
1 files changed, 5 insertions, 3 deletions
diff --git a/nms-patches/EntityLiving.patch b/nms-patches/EntityLiving.patch
index f39e620f..72d5cdcc 100644
--- a/nms-patches/EntityLiving.patch
+++ b/nms-patches/EntityLiving.patch
@@ -326,7 +326,7 @@
this.aA = 0.0F;
Entity entity1 = damagesource.getEntity();
-@@ -833,18 +981,28 @@
+@@ -833,19 +981,29 @@
EnumHand[] aenumhand = EnumHand.values();
int i = aenumhand.length;
@@ -346,6 +346,7 @@
}
- if (itemstack != null) {
+- if (this instanceof EntityPlayer) {
+ EntityResurrectEvent event = new EntityResurrectEvent((LivingEntity) this.getBukkitEntity());
+ event.setCancelled(itemstack == null);
+ this.world.getServer().getPluginManager().callEvent(event);
@@ -354,10 +355,11 @@
+ if (!itemstack1.isEmpty()) {
+ itemstack1.subtract(1);
+ }
-+ // CraftBukkit end
- if (this instanceof EntityPlayer) {
++ if (itemstack != null && this instanceof EntityPlayer) {
++ // CraftBukkit end
EntityPlayer entityplayer = (EntityPlayer) this;
+ entityplayer.b(StatisticList.b(Items.cY));
@@ -859,7 +1017,7 @@
this.world.broadcastEntityEffect(this, (byte) 35);
}