mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 23:10:16 +01:00
SPIGOT-5466: Bees still get angry even if damage event cancelled
This commit is contained in:
parent
4499fec567
commit
fb7abcb37a
1 changed files with 26 additions and 7 deletions
|
@ -9,7 +9,26 @@
|
||||||
this.a(SoundEffects.ENTITY_BEE_STING, 1.0F, 1.0F);
|
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 {
|
class d extends EntityBee.a {
|
||||||
|
|
||||||
private d() {
|
private d() {
|
||||||
|
@ -18,7 +37,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -632,7 +632,7 @@
|
@@ -632,7 +636,7 @@
|
||||||
class g extends EntityBee.a {
|
class g extends EntityBee.a {
|
||||||
|
|
||||||
private g() {
|
private g() {
|
||||||
|
@ -27,7 +46,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -696,7 +696,7 @@
|
@@ -696,7 +700,7 @@
|
||||||
class i extends EntityBee.a {
|
class i extends EntityBee.a {
|
||||||
|
|
||||||
private i() {
|
private i() {
|
||||||
|
@ -36,7 +55,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -760,7 +760,7 @@
|
@@ -760,7 +764,7 @@
|
||||||
private int h = 0;
|
private int h = 0;
|
||||||
|
|
||||||
k() {
|
k() {
|
||||||
|
@ -45,7 +64,7 @@
|
||||||
this.a(EnumSet.of(PathfinderGoal.Type.MOVE));
|
this.a(EnumSet.of(PathfinderGoal.Type.MOVE));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -944,7 +944,7 @@
|
@@ -944,7 +948,7 @@
|
||||||
private int c;
|
private int c;
|
||||||
|
|
||||||
f() {
|
f() {
|
||||||
|
@ -54,7 +73,7 @@
|
||||||
this.c = EntityBee.this.world.random.nextInt(10);
|
this.c = EntityBee.this.world.random.nextInt(10);
|
||||||
this.a(EnumSet.of(PathfinderGoal.Type.MOVE));
|
this.a(EnumSet.of(PathfinderGoal.Type.MOVE));
|
||||||
}
|
}
|
||||||
@@ -1001,7 +1001,7 @@
|
@@ -1001,7 +1005,7 @@
|
||||||
private PathEntity e;
|
private PathEntity e;
|
||||||
|
|
||||||
e() {
|
e() {
|
||||||
|
@ -63,7 +82,7 @@
|
||||||
this.c = EntityBee.this.world.random.nextInt(10);
|
this.c = EntityBee.this.world.random.nextInt(10);
|
||||||
this.d = Lists.newArrayList();
|
this.d = Lists.newArrayList();
|
||||||
this.e = null;
|
this.e = null;
|
||||||
@@ -1210,7 +1210,7 @@
|
@@ -1210,7 +1214,7 @@
|
||||||
@Override
|
@Override
|
||||||
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
|
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
|
||||||
if (entityinsentient instanceof EntityBee && this.e.hasLineOfSight(entityliving) && ((EntityBee) entityinsentient).a((Entity) entityliving)) {
|
if (entityinsentient instanceof EntityBee && this.e.hasLineOfSight(entityliving) && ((EntityBee) entityinsentient).a((Entity) entityliving)) {
|
||||||
|
|
Loading…
Reference in a new issue