diff options
Diffstat (limited to 'Spigot-Server-Patches/0137-EntityRegainHealthEvent-isFastRegen-API.patch')
-rw-r--r-- | Spigot-Server-Patches/0137-EntityRegainHealthEvent-isFastRegen-API.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/Spigot-Server-Patches/0137-EntityRegainHealthEvent-isFastRegen-API.patch b/Spigot-Server-Patches/0137-EntityRegainHealthEvent-isFastRegen-API.patch new file mode 100644 index 0000000000..db672afcbb --- /dev/null +++ b/Spigot-Server-Patches/0137-EntityRegainHealthEvent-isFastRegen-API.patch @@ -0,0 +1,45 @@ +From 34d571332952449b1187a9afe61f565ac0575944 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/server/EntityLiving.java b/src/main/java/net/minecraft/server/EntityLiving.java +index df4d8d8..129bca8 100644 +--- a/src/main/java/net/minecraft/server/EntityLiving.java ++++ b/src/main/java/net/minecraft/server/EntityLiving.java +@@ -734,10 +734,16 @@ public abstract class EntityLiving extends Entity { + } + + 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 - Add isFastRegen + this.world.getServer().getPluginManager().callEvent(event); + + if (!event.isCancelled()) { +diff --git a/src/main/java/net/minecraft/server/FoodMetaData.java b/src/main/java/net/minecraft/server/FoodMetaData.java +index df5fbeb..ebadb37 100644 +--- a/src/main/java/net/minecraft/server/FoodMetaData.java ++++ b/src/main/java/net/minecraft/server/FoodMetaData.java +@@ -65,7 +65,7 @@ public class FoodMetaData { + if (this.foodTickTimer >= 10) { + float f = Math.min(this.saturationLevel, 4.0F); + +- entityhuman.heal(f / 4.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED); // CraftBukkit - added RegainReason ++ entityhuman.heal(f / 4.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED, true); // CraftBukkit - added RegainReason // Paper - This is fast regen + this.a(f); + this.foodTickTimer = 0; + } +-- +2.7.4 (Apple Git-66) + |