aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0780-Missing-eating-regain-reason.patch
blob: d03459459f467b4fd6cdbd57d85ce0a6e20b935a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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 1d0c424be2b67cad0f8bca85070a9c46a6b283da..f760ce7d9df79ef58f8963de3e901cba3e12fcaa 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
@@ -387,7 +387,7 @@ public class Cat extends TamableAnimal implements VariantHolder<CatVariant> {
                     if (!(item instanceof DyeItem)) {
                         if (item.isEdible() && this.isFood(itemstack) && this.getHealth() < this.getMaxHealth()) {
                             this.usePlayerItem(player, hand, itemstack);
-                            this.heal((float) item.getFoodProperties().getNutrition());
+                            this.heal((float) item.getFoodProperties().getNutrition(), org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.EATING); // Paper - Add missing regain reason
                             return InteractionResult.CONSUME;
                         }
 
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 95e5d1d707e610c930b6098a86c5162fd29bf602..be8e056f82e348d7cd14bb22a873207cddfb3044 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
@@ -384,7 +384,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Saddl
         } else {
             boolean bl = this.getHealth() < this.getMaxHealth();
             if (bl) {
-                this.heal(2.0F);
+                this.heal(2.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.EATING); // Paper - Add missing regain reason
             }
 
             boolean bl2 = 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 91fb62807b3c5600c83d4dc8d3fadf36e94e2133..9b5b894d43f25566ab9c3698705e978ab823a0d2 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
@@ -196,7 +196,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;
         }