diff options
author | Spottedleaf <[email protected]> | 2023-09-22 13:13:57 -0700 |
---|---|---|
committer | Spottedleaf <[email protected]> | 2023-09-22 13:13:57 -0700 |
commit | e88856dd75de742fa10099af4fe06a07500b34fd (patch) | |
tree | d06086449e85f9b65949e65b5c11f836a9328d36 /patches/server/0091-EntityRegainHealthEvent-isFastRegen-API.patch | |
parent | 896aa8b54acd288703bdc973aafdb176b8578095 (diff) | |
download | Paper-e88856dd75de742fa10099af4fe06a07500b34fd.tar.gz Paper-e88856dd75de742fa10099af4fe06a07500b34fd.zip |
Chunk system patch
Diffstat (limited to 'patches/server/0091-EntityRegainHealthEvent-isFastRegen-API.patch')
-rw-r--r-- | patches/server/0091-EntityRegainHealthEvent-isFastRegen-API.patch | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/patches/server/0091-EntityRegainHealthEvent-isFastRegen-API.patch b/patches/server/0091-EntityRegainHealthEvent-isFastRegen-API.patch deleted file mode 100644 index 5b58ce4afb..0000000000 --- a/patches/server/0091-EntityRegainHealthEvent-isFastRegen-API.patch +++ /dev/null @@ -1,42 +0,0 @@ -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 fa03c3a9debe419dd4e60764de4d9544de1ae0f3..c61ddc868fa2eed1dce72ebcf98940756cca401e 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 5ff0eba33f848de5172944274e14062090ab7407..2038df72f8d7d33d4105de8129628daf21de6f0f 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; |