mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-23 11:06:29 +01:00
b170e8cedb
Remove two features added upstream
46 lines
2.2 KiB
Diff
46 lines
2.2 KiB
Diff
From 276d9bba1ea00717e239ff3ad5cfe5d1e7440043 Mon Sep 17 00:00:00 2001
|
|
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
|
|
index d66e766..526a608 100644
|
|
--- a/src/main/java/net/minecraft/server/EntityLiving.java
|
|
+++ b/src/main/java/net/minecraft/server/EntityLiving.java
|
|
@@ -741,10 +741,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 3a7ce8d..46acda8 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.9.2.windows.1
|
|
|