2019-04-27 03:05:36 +00:00
From c246fe0efb76eae003ec61c0992ff8c4e4f3ae07 Mon Sep 17 00:00:00 2001
2018-07-15 01:53:17 +00:00
From: Zach Brown <zach.brown@destroystokyo.com>
Date: Fri, 22 Apr 2016 01:43:11 -0500
Subject: [PATCH] EntityRegainHealthEvent isFastRegen API
Don't even get me started
diff --git a/src/main/java/net/minecraft/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java
2019-04-27 03:05:36 +00:00
index 5ae701488..780287f91 100644
2018-07-15 01:53:17 +00:00
--- a/src/main/java/net/minecraft/server/EntityLiving.java
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
2019-04-27 03:05:36 +00:00
@@ -963,10 +963,16 @@ public abstract class EntityLiving extends Entity {
2018-07-15 01:53:17 +00:00
}
public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason) {
+ // Paper start - Forward
+ heal(f, regainReason, false);
+ }
+
+ public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason, boolean isFastRegen) {
+ // Paper end
float f1 = this.getHealth();
if (f1 > 0.0F) {
- EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), f, regainReason);
2019-04-27 03:05:36 +00:00
+ EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), f, regainReason, isFastRegen);
// Suppress during worldgen
if (this.valid) {
this.world.getServer().getPluginManager().callEvent(event);
2018-07-15 01:53:17 +00:00
diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/java/net/minecraft/server/FoodMetaData.java
2019-04-27 03:05:36 +00:00
index da07530d9..d184422fb 100644
2018-07-15 01:53:17 +00:00
--- a/src/main/java/net/minecraft/server/FoodMetaData.java
+++ b/src/main/java/net/minecraft/server/FoodMetaData.java
2019-04-27 03:05:36 +00:00
@@ -69,7 +69,7 @@ public class FoodMetaData {
2018-07-15 01:53:17 +00:00
if (this.foodTickTimer >= 10) {
float f = Math.min(this.saturationLevel, 6.0F);
- entityhuman.heal(f / 6.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED); // CraftBukkit - added RegainReason
+ entityhuman.heal(f / 6.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED, true); // CraftBukkit - added RegainReason // Paper - This is fast regen
this.a(f);
this.foodTickTimer = 0;
}
--
2019-04-23 04:47:07 +00:00
2.21.0
2018-07-15 01:53:17 +00:00