aboutsummaryrefslogtreecommitdiffhomepage
path: root/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Parrot.java.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Parrot.java.patch')
-rw-r--r--patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Parrot.java.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Parrot.java.patch b/patch-remap/mache-spigotflower-stripped/net/minecraft/world/entity/animal/Parrot.java.patch
new file mode 100644
index 0000000000..b0d4b5f8a0
--- /dev/null
+++ b/patch-remap/mache-spigotflower-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
+@@ -272,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 {
+@@ -286,7 +277,7 @@
+ itemstack.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);
+ }
+@@ -407,7 +384,7 @@
+ @Override
+ @Override
+ public boolean isPushable() {
+- return true;
++ return super.isPushable(); // CraftBukkit - collidable API
+ }
+
+ @Override
+@@ -424,11 +399,14 @@
+ if (this.isInvulnerableTo(damagesource)) {
+ 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(damagesource, f);
++ return result; // CraftBukkit
+ }
+ }
+