From fb7abcb37a36892c056e8955228adf5a8889bf47 Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 19 Dec 2019 12:25:11 +1100 Subject: [PATCH] SPIGOT-5466: Bees still get angry even if damage event cancelled --- nms-patches/EntityBee.patch | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/nms-patches/EntityBee.patch b/nms-patches/EntityBee.patch index 3d158e1b77..0922534b18 100644 --- a/nms-patches/EntityBee.patch +++ b/nms-patches/EntityBee.patch @@ -9,7 +9,26 @@ this.a(SoundEffects.ENTITY_BEE_STING, 1.0F, 1.0F); } -@@ -572,7 +572,7 @@ +@@ -546,12 +546,16 @@ + } else { + Entity entity = damagesource.getEntity(); + +- if (!this.world.isClientSide && entity instanceof EntityHuman && !((EntityHuman) entity).isCreative() && this.hasLineOfSight(entity) && !this.isNoAI()) { ++ // CraftBukkit start ++ boolean result = super.damageEntity(damagesource, f); ++ ++ if (result && !this.world.isClientSide && entity instanceof EntityHuman && !((EntityHuman) entity).isCreative() && this.hasLineOfSight(entity) && !this.isNoAI()) { + this.bJ.l(); + this.a(entity); + } + +- return super.damageEntity(damagesource, f); ++ return result; ++ // CraftBukkit end + } + } + +@@ -572,7 +576,7 @@ class d extends EntityBee.a { private d() { @@ -18,7 +37,7 @@ } @Override -@@ -632,7 +632,7 @@ +@@ -632,7 +636,7 @@ class g extends EntityBee.a { private g() { @@ -27,7 +46,7 @@ } @Override -@@ -696,7 +696,7 @@ +@@ -696,7 +700,7 @@ class i extends EntityBee.a { private i() { @@ -36,7 +55,7 @@ } @Override -@@ -760,7 +760,7 @@ +@@ -760,7 +764,7 @@ private int h = 0; k() { @@ -45,7 +64,7 @@ this.a(EnumSet.of(PathfinderGoal.Type.MOVE)); } -@@ -944,7 +944,7 @@ +@@ -944,7 +948,7 @@ private int c; f() { @@ -54,7 +73,7 @@ this.c = EntityBee.this.world.random.nextInt(10); this.a(EnumSet.of(PathfinderGoal.Type.MOVE)); } -@@ -1001,7 +1001,7 @@ +@@ -1001,7 +1005,7 @@ private PathEntity e; e() { @@ -63,7 +82,7 @@ this.c = EntityBee.this.world.random.nextInt(10); this.d = Lists.newArrayList(); this.e = null; -@@ -1210,7 +1210,7 @@ +@@ -1210,7 +1214,7 @@ @Override protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) { if (entityinsentient instanceof EntityBee && this.e.hasLineOfSight(entityliving) && ((EntityBee) entityinsentient).a((Entity) entityliving)) {