PaperMC/patches/server/0865-Missing-eating-regain-reason.patch
Nassim Jahnke 275173e538
Updated Upstream (Bukkit/CraftBukkit)
Upstream has released updates that appear to apply and compile correctly.
This update has not been tested by PaperMC and as with ANY update, please do your own testing

Bukkit Changes:
0c5d8709 SPIGOT-7400: Downgrade maven-resolver due to issues resolving certain depends
255c4fdb SPIGOT-7380: Add PlayerInteractEvent#getClickedPosition and ChiseledBookshelf#getSlot

CraftBukkit Changes:
b6b514b7e SPIGOT-7400: Downgrade maven-resolver due to issues resolving certain depends
fcff84de9 SPIGOT-7399: Revert null check in CraftMetaItem#safelyAdd
44a4b5649 SPIGOT-7380: Add PlayerInteractEvent#getClickedPosition and ChiseledBookshelf#getSlot
676969d01 SPIGOT-7389: Handle setting null items in ChiseledBookshelf Inventory
2023-06-18 13:18:11 +02:00

45 lines
2.8 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 438d7c26cc3a4a3b5a1affffbbe26e4d272b0c00..90ce201bc7c47cef9bc59d7b535a7453854bac75 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
@@ -386,7 +386,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
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 c853123c451c41beb42209c7edc14a5dcffa2a50..2030fdb3124f793d7b545135b1db32fe9be27050 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
@@ -386,7 +386,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();
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 4033945cb992e2c9bf42b8a7eda581319a6c6917..3bbb1455773570e3f7f6b8b144d3c589e2705b81 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
@@ -217,7 +217,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
flag = true;
}