#792: Add EntityExhaustionEvent

By: Martoph <sager1018@gmail.com>
This commit is contained in:
CraftBukkit/Spigot
2021-03-04 08:28:05 +11:00
parent b65d70e9ea
commit 69c16ea666
6 changed files with 145 additions and 29 deletions

View File

@@ -729,7 +729,7 @@
+ if (f > 0 || !human) {
+ if (human) {
+ // PAIL: Be sure to drag all this code from the EntityHuman subclass each update.
+ ((EntityHuman) this).applyExhaustion(damagesource.getExhaustionCost());
+ ((EntityHuman) this).applyExhaustion(damagesource.getExhaustionCost(), org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.DAMAGED); // CraftBukkit - EntityExhaustionEvent
+ if (f < 3.4028235E37F) {
+ ((EntityHuman) this).a(StatisticList.DAMAGE_TAKEN, Math.round(f * 10.0F));
+ }