aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/unapplied/server/0092-EntityRegainHealthEvent-isFastRegen-API.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/unapplied/server/0092-EntityRegainHealthEvent-isFastRegen-API.patch')
-rw-r--r--patches/unapplied/server/0092-EntityRegainHealthEvent-isFastRegen-API.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/patches/unapplied/server/0092-EntityRegainHealthEvent-isFastRegen-API.patch b/patches/unapplied/server/0092-EntityRegainHealthEvent-isFastRegen-API.patch
new file mode 100644
index 0000000000..67a7dd2586
--- /dev/null
+++ b/patches/unapplied/server/0092-EntityRegainHealthEvent-isFastRegen-API.patch
@@ -0,0 +1,42 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Zach Brown <[email protected]>
+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/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
+index 2cf9d80494c6b70992d8ec74fe1697c6522bd952..b60e970c604ae778cc0b5eb54cdfebceef91b2df 100644
+--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
++++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
+@@ -1323,10 +1323,16 @@ public abstract class LivingEntity extends Entity implements Attackable {
+ }
+
+ 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);
++ EntityRegainHealthEvent event = new EntityRegainHealthEvent(this.getBukkitEntity(), f, regainReason, isFastRegen); // Paper
+ // Suppress during worldgen
+ if (this.valid) {
+ this.level().getCraftServer().getPluginManager().callEvent(event);
+diff --git a/src/main/java/net/minecraft/world/food/FoodData.java b/src/main/java/net/minecraft/world/food/FoodData.java
+index 14b2c31909adc0e8e828d9a563ce7d33d73b2a5a..c3448707fd8a632b457cc97b35d08a9c6933d5ee 100644
+--- a/src/main/java/net/minecraft/world/food/FoodData.java
++++ b/src/main/java/net/minecraft/world/food/FoodData.java
+@@ -83,7 +83,7 @@ public class FoodData {
+ if (this.tickTimer >= this.saturatedRegenRate) { // CraftBukkit
+ float f = Math.min(this.saturationLevel, 6.0F);
+
+- player.heal(f / 6.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED); // CraftBukkit - added RegainReason
++ player.heal(f / 6.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED, true); // CraftBukkit - added RegainReason // Paper - This is fast regen
+ // this.addExhaustion(f); CraftBukkit - EntityExhaustionEvent
+ player.causeFoodExhaustion(f, org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.REGEN); // CraftBukkit - EntityExhaustionEvent
+ this.tickTimer = 0;