mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-22 02:25:28 +01:00
Missing eating regain reason (#8244)
This commit is contained in:
parent
b826065a4b
commit
34777cdcbe
@ -174,6 +174,19 @@ index 1119e26e270bb45f517955b19d95a9ec3d113634..4631647c64c89ffdde2d9b63bdab974a
|
||||
* @param sz The new size of the slime.
|
||||
*/
|
||||
public void setSize(int sz);
|
||||
diff --git a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java
|
||||
index d51d2ec1d04d9ea8a25a70d0d856f2355ebfcb4a..7ecff9fcee19fc94be784474fea620e5dd434731 100644
|
||||
--- a/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java
|
||||
+++ b/src/main/java/org/bukkit/event/entity/EntityRegainHealthEvent.java
|
||||
@@ -105,7 +105,7 @@ public class EntityRegainHealthEvent extends EntityEvent implements Cancellable
|
||||
*/
|
||||
SATIATED,
|
||||
/**
|
||||
- * When a player regains health from eating consumables
|
||||
+ * When an animal regains health from eating consumables
|
||||
*/
|
||||
EATING,
|
||||
/**
|
||||
diff --git a/src/main/java/org/bukkit/inventory/EntityEquipment.java b/src/main/java/org/bukkit/inventory/EntityEquipment.java
|
||||
index d5b50a4a954fed35d37f03f1a277cc173ca106df..a91fa5386afd7a1137adb921ad5adb798604772f 100644
|
||||
--- a/src/main/java/org/bukkit/inventory/EntityEquipment.java
|
||||
|
32
patches/server/0940-Missing-eating-regain-reason.patch
Normal file
32
patches/server/0940-Missing-eating-regain-reason.patch
Normal file
@ -0,0 +1,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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user