13
0
geforkt von Mirrors/Paper
Paper/nms-patches/EntityBee.patch

94 Zeilen
3.0 KiB
Diff

2019-12-10 23:00:00 +01:00
--- a/net/minecraft/server/EntityBee.java
+++ b/net/minecraft/server/EntityBee.java
@@ -157,7 +157,7 @@
}
this.setHasStung(true);
- this.setGoalTarget((EntityLiving) null);
+ this.setGoalTarget((EntityLiving) null, org.bukkit.event.entity.EntityTargetEvent.TargetReason.FORGOT_TARGET, true); // CraftBukkit
this.a(SoundEffects.ENTITY_BEE_STING, 1.0F, 1.0F);
}
@@ -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 @@
2019-12-10 23:00:00 +01:00
class d extends EntityBee.a {
private d() {
- super(null);
+ super(); // CraftBukkit - decompile error
}
@Override
@@ -632,7 +636,7 @@
2019-12-10 23:00:00 +01:00
class g extends EntityBee.a {
private g() {
- super(null);
+ super(); // CraftBukkit - decompile error
}
@Override
@@ -696,7 +700,7 @@
2019-12-10 23:00:00 +01:00
class i extends EntityBee.a {
private i() {
- super(null);
+ super(); // CraftBukkit - decompile error
}
@Override
@@ -760,7 +764,7 @@
2019-12-10 23:00:00 +01:00
private int h = 0;
k() {
- super(null);
+ super(); // CraftBukkit - decompile error
this.a(EnumSet.of(PathfinderGoal.Type.MOVE));
}
@@ -944,7 +948,7 @@
2019-12-10 23:00:00 +01:00
private int c;
f() {
- super(null);
+ super(); // CraftBukkit - decompile error
this.c = EntityBee.this.world.random.nextInt(10);
this.a(EnumSet.of(PathfinderGoal.Type.MOVE));
}
@@ -1001,7 +1005,7 @@
2019-12-10 23:00:00 +01:00
private PathEntity e;
e() {
- super(null);
+ super(); // CraftBukkit - decompile error
this.c = EntityBee.this.world.random.nextInt(10);
this.d = Lists.newArrayList();
this.e = null;
@@ -1210,7 +1214,7 @@
2019-12-10 23:00:00 +01:00
@Override
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
if (entityinsentient instanceof EntityBee && this.e.hasLineOfSight(entityliving) && ((EntityBee) entityinsentient).a((Entity) entityliving)) {
- entityinsentient.setGoalTarget(entityliving);
+ entityinsentient.setGoalTarget(entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit - reason
}
}