mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-10 12:02:36 +01:00
9ee989ea81
By: md_5 <git@md-5.net>
56 lines
2.6 KiB
Diff
56 lines
2.6 KiB
Diff
--- a/net/minecraft/world/entity/animal/EntityBee.java
|
|
+++ b/net/minecraft/world/entity/animal/EntityBee.java
|
|
@@ -242,7 +242,7 @@
|
|
}
|
|
|
|
if (b0 > 0) {
|
|
- ((EntityLiving) entity).addEffect(new MobEffect(MobEffects.POISON, b0 * 20, 0), this);
|
|
+ ((EntityLiving) entity).addEffect(new MobEffect(MobEffects.POISON, b0 * 20, 0), this, org.bukkit.event.entity.EntityPotionEffectEvent.Cause.ATTACK); // CraftBukkit
|
|
}
|
|
}
|
|
|
|
@@ -642,11 +642,15 @@
|
|
if (this.isInvulnerableTo(damagesource)) {
|
|
return false;
|
|
} else {
|
|
- if (!this.level.isClientSide) {
|
|
+ // CraftBukkit start
|
|
+ boolean result = super.hurt(damagesource, f);
|
|
+
|
|
+ if (result && !this.level.isClientSide) {
|
|
this.beePollinateGoal.stopPollinating();
|
|
}
|
|
|
|
- return super.hurt(damagesource, f);
|
|
+ return result;
|
|
+ // CraftBukkit end
|
|
}
|
|
}
|
|
|
|
@@ -1222,7 +1226,7 @@
|
|
}
|
|
}
|
|
|
|
- if (flag) {
|
|
+ if (flag && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityChangeBlockEvent(EntityBee.this, blockposition, iblockdata.setValue(blockstateinteger, (Integer) iblockdata.getValue(blockstateinteger) + 1)).isCancelled()) { // Spigot
|
|
EntityBee.this.level.levelEvent(2005, blockposition, 0);
|
|
EntityBee.this.level.setBlockAndUpdate(blockposition, (IBlockData) iblockdata.setValue(blockstateinteger, (Integer) iblockdata.getValue(blockstateinteger) + 1));
|
|
EntityBee.this.incrementNumCropsGrownSincePollination();
|
|
@@ -1295,7 +1299,7 @@
|
|
@Override
|
|
protected void alertOther(EntityInsentient entityinsentient, EntityLiving entityliving) {
|
|
if (entityinsentient instanceof EntityBee && this.mob.hasLineOfSight(entityliving)) {
|
|
- entityinsentient.setTarget(entityliving);
|
|
+ entityinsentient.setTarget(entityliving, org.bukkit.event.entity.EntityTargetEvent.TargetReason.TARGET_ATTACKED_ENTITY, true); // CraftBukkit - reason
|
|
}
|
|
|
|
}
|
|
@@ -1304,7 +1308,7 @@
|
|
private static class c extends PathfinderGoalNearestAttackableTarget<EntityHuman> {
|
|
|
|
c(EntityBee entitybee) {
|
|
- Objects.requireNonNull(entitybee);
|
|
+ // Objects.requireNonNull(entitybee); // CraftBukkit - decompile error
|
|
super(entitybee, EntityHuman.class, 10, true, false, entitybee::isAngryAt);
|
|
}
|
|
|