SPIGOT-1893: Wrong RegainReason for eating.

This commit is contained in:
md_5 2016-03-12 11:12:38 +11:00
parent 1fefbf9b98
commit 75286088fe

View File

@ -55,13 +55,20 @@
}
}
@@ -46,7 +72,8 @@
@@ -39,14 +65,14 @@
if (this.foodTickTimer >= 10) {
float f = Math.min(this.saturationLevel, 4.0F);
- entityhuman.heal(f / 4.0F);
+ entityhuman.heal(f / 4.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED); // CraftBukkit - added RegainReason
this.a(f);
this.foodTickTimer = 0;
}
} else if (flag && this.foodLevel >= 18 && entityhuman.cT()) {
++this.foodTickTimer;
if (this.foodTickTimer >= 80) {
- entityhuman.heal(1.0F);
+ // CraftBukkit - added RegainReason
+ entityhuman.heal(1.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED);
+ entityhuman.heal(1.0F, org.bukkit.event.entity.EntityRegainHealthEvent.RegainReason.SATIATED); // CraftBukkit - added RegainReason
this.a(4.0F);
this.foodTickTimer = 0;
}