mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-29 12:27:59 +01:00
46 lines
2.7 KiB
Diff
46 lines
2.7 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
|
|
Date: Fri, 5 Aug 2022 12:16:51 +0200
|
|
Subject: [PATCH] Missing eating regain reason
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
|
index 9a67dfe214d3eb89d1f4371e716df759651ceb1b..989b7be74eaeba7f40eac87c7ee7f252cb0c05c9 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
|
@@ -406,7 +406,7 @@ public class Cat extends TamableAnimal implements VariantHolder<Holder<CatVarian
|
|
this.usePlayerItem(player, hand, itemstack);
|
|
FoodProperties foodinfo = (FoodProperties) itemstack.get(DataComponents.FOOD);
|
|
|
|
- this.heal(foodinfo != null ? (float) foodinfo.nutrition() : 1.0F);
|
|
+ this.heal(foodinfo != null ? (float) foodinfo.nutrition() : 1.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.EATING); // Paper - Add missing regain reason
|
|
this.playEatingSound();
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
|
index dc10449a3bdff694ad872a1ff61c90046aa7954a..b6baa40dac6d6bf40c4ee7ee75b8a8e6f60733a1 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
|
|
@@ -389,7 +389,7 @@ public class Camel extends AbstractHorse {
|
|
boolean flag = this.getHealth() < this.getMaxHealth();
|
|
|
|
if (flag) {
|
|
- this.heal(2.0F);
|
|
+ this.heal(2.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.EATING); // Paper - Add missing regain reason
|
|
}
|
|
|
|
boolean flag1 = this.isTamed() && this.getAge() == 0 && this.canFallInLove();
|
|
diff --git a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
|
|
index d5808d0c190877554a4a8191f68e8b4a36f2ff46..4da66867109394c8966e27551d20b4bcdf4bc9be 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
|
|
@@ -182,7 +182,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
|
|
}
|
|
|
|
if (this.getHealth() < this.getMaxHealth() && f > 0.0F) {
|
|
- this.heal(f);
|
|
+ this.heal(f, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.EATING); // Paper - Add missing regain reason
|
|
flag = true;
|
|
}
|
|
|