aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0940-Missing-eating-regain-reason.patch
blob: 1f8bd2bc7b7e055adff8f0eef6cfcfb81b125057 (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
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 ab86bfdaebe9b8791f0cfa6e0c61f80c8f891a93..745883a7b9c2590ae8e28db79e1bd0341a7e54bd 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
@@ -384,7 +384,7 @@ public class Cat extends TamableAnimal {
                     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
                             return InteractionResult.CONSUME;
                         }
 
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 5ffae9d3be22b5e78645da57a6bd0e7350749ef1..ed8dfabdad28e27054aa0679e06fcf87dc049f77 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
@@ -211,7 +211,7 @@ public class Llama extends AbstractChestedHorse implements RangedAttackMob {
         }
 
         if (this.getHealth() < this.getMaxHealth() && f > 0.0F) {
-            this.heal(f);
+            this.heal(f, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.EATING); // Paper
             flag = true;
         }