Paper/patches/server/0891-Missing-eating-regain-reason.patch

46 lines
2.8 KiB
Diff
Raw Normal View History

2022-09-18 05:24:28 +02:00
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
2022-12-07 23:05:32 +01:00
index a0dd4a58937a4e49e430d8c1470fe84b709e8044..0114c1cf3b6b0500149a77ebc190cb7fa2832184 100644
2022-09-18 05:24:28 +02:00
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
2022-12-07 23:05:32 +01:00
@@ -389,7 +389,7 @@ public class Cat extends TamableAnimal implements VariantHolder<CatVariant> {
2022-09-18 05:24:28 +02:00
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/camel/Camel.java b/src/main/java/net/minecraft/world/entity/animal/camel/Camel.java
index 136da73e372b59f37665743c70833e815cd0070b..d9104d996c854cce1ff167706c93747cd69c3969 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
@@ -361,7 +361,7 @@ public class Camel extends AbstractHorse implements PlayerRideableJumping, Rider
} 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
}
boolean bl2 = this.isTamed() && this.getAge() == 0 && this.canFallInLove();
2022-09-18 05:24:28 +02:00
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
2022-12-07 23:05:32 +01:00
index 39c6b9b74e072953abe6398ecfcdd444e6d8f194..7ae0e4b3aa8e861500ddc7b38aa671258b532fcd 100644
2022-09-18 05:24:28 +02:00
--- a/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
+++ b/src/main/java/net/minecraft/world/entity/animal/horse/Llama.java
2022-12-07 23:05:32 +01:00
@@ -217,7 +217,7 @@ public class Llama extends AbstractChestedHorse implements VariantHolder<Llama.V
2022-09-18 05:24:28 +02:00
}
if (this.getHealth() < this.getMaxHealth() && f > 0.0F) {
- this.heal(f);
+ this.heal(f, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.EATING); // Paper
flag = true;
}