diff options
Diffstat (limited to 'patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Parrot.java.patch')
-rw-r--r-- | patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Parrot.java.patch | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Parrot.java.patch b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Parrot.java.patch new file mode 100644 index 0000000000..e233a11dc5 --- /dev/null +++ b/patch-remap/mache-vineflower-stripped/net/minecraft/world/entity/animal/Parrot.java.patch @@ -0,0 +1,46 @@ +--- a/net/minecraft/world/entity/animal/Parrot.java ++++ b/net/minecraft/world/entity/animal/Parrot.java +@@ -271,7 +263,7 @@ + } + + if (!this.level().isClientSide) { +- if (this.random.nextInt(10) == 0) { ++ if (this.random.nextInt(10) == 0 && !org.bukkit.craftbukkit.event.CraftEventFactory.callEntityTameEvent(this, player).isCancelled()) { // CraftBukkit + this.tame(player); + this.level().broadcastEntityEvent(this, (byte)7); + } else { +@@ -285,7 +277,7 @@ + itemInHand.shrink(1); + } + +- this.addEffect(new MobEffectInstance(MobEffects.POISON, 900)); ++ this.addEffect(new MobEffectInstance(MobEffects.POISON, 900), org.bukkit.event.entity.EntityPotionEffectEvent.Cause.FOOD); // CraftBukkit + if (player.isCreative() || !this.isInvulnerable()) { + this.hurt(this.damageSources().playerAttack(player), Float.MAX_VALUE); + } +@@ -392,7 +384,7 @@ + + @Override + public boolean isPushable() { +- return true; ++ return super.isPushable(); // CraftBukkit - collidable API + } + + @Override +@@ -407,11 +399,14 @@ + if (this.isInvulnerableTo(source)) { + return false; + } else { +- if (!this.level().isClientSide) { ++ // CraftBukkit start ++ boolean result = super.hurt(source, amount); ++ if (!this.level().isClientSide && result) { ++ // CraftBukkit end + this.setOrderedToSit(false); + } + +- return super.hurt(source, amount); ++ return result; // CraftBukkit + } + } + |