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

102 Zeilen
3.4 KiB
Diff

2019-12-10 23:00:00 +01:00
--- a/net/minecraft/server/EntityBee.java
+++ b/net/minecraft/server/EntityBee.java
2020-06-25 02:00:00 +02:00
@@ -137,7 +137,7 @@
}
if (b0 > 0) {
- ((EntityLiving) entity).addEffect(new MobEffect(MobEffects.POISON, b0 * 20, 0));
+ ((EntityLiving) entity).addEffect(new MobEffect(MobEffects.POISON, b0 * 20, 0), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit
}
2019-12-10 23:00:00 +01:00
}
2020-06-25 02:00:00 +02:00
@@ -512,11 +512,15 @@
} else {
Entity entity = damagesource.getEntity();
2020-06-25 02:00:00 +02:00
- if (!this.world.isClientSide) {
+ // CraftBukkit start
+ boolean result = super.damageEntity(damagesource, f);
+
2020-06-25 02:00:00 +02:00
+ if (result && !this.world.isClientSide) {
this.bJ.l();
}
- return super.damageEntity(damagesource, f);
+ return result;
+ // CraftBukkit end
}
}
2020-06-25 02:00:00 +02:00
@@ -537,7 +541,7 @@
2019-12-10 23:00:00 +01:00
class d extends EntityBee.a {
private d() {
- super(null);
+ super(); // CraftBukkit - decompile error
}
@Override
2020-06-25 02:00:00 +02:00
@@ -597,7 +601,7 @@
2019-12-10 23:00:00 +01:00
class g extends EntityBee.a {
private g() {
- super(null);
+ super(); // CraftBukkit - decompile error
}
@Override
2020-06-25 02:00:00 +02:00
@@ -646,7 +650,7 @@
}
}
- if (flag) {
+ if (flag && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(EntityBee.this, blockposition, iblockdata.set(blockstateinteger, (Integer) iblockdata.get(blockstateinteger) + 1)).isCancelled()) { // Spigot
EntityBee.this.world.triggerEffect(2005, blockposition, 0);
EntityBee.this.world.setTypeUpdate(blockposition, (IBlockData) iblockdata.set(blockstateinteger, (Integer) iblockdata.get(blockstateinteger) + 1));
2020-06-25 02:00:00 +02:00
EntityBee.this.fj();
@@ -661,7 +665,7 @@
2019-12-10 23:00:00 +01:00
class i extends EntityBee.a {
private i() {
- super(null);
+ super(); // CraftBukkit - decompile error
}
@Override
2020-06-25 02:00:00 +02:00
@@ -725,7 +729,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));
}
2020-06-25 02:00:00 +02:00
@@ -909,7 +913,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));
}
2020-06-25 02:00:00 +02:00
@@ -967,7 +971,7 @@
private int f;
2019-12-10 23:00:00 +01:00
e() {
- super(null);
+ super(); // CraftBukkit - decompile error
this.c = EntityBee.this.world.random.nextInt(10);
this.d = Lists.newArrayList();
this.e = null;
2020-06-25 02:00:00 +02:00
@@ -1187,7 +1191,7 @@
2019-12-10 23:00:00 +01:00
@Override
protected void a(EntityInsentient entityinsentient, EntityLiving entityliving) {
2020-06-25 02:00:00 +02:00
if (entityinsentient instanceof EntityBee && this.e.hasLineOfSight(entityliving)) {
2019-12-10 23:00:00 +01:00
- entityinsentient.setGoalTarget(entityliving);
+ entityinsentient.setGoalTarget(entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit - reason
}
}