#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

@@ -15,6 +15,15 @@
}
}
@@ -240,7 +246,7 @@
public void a(World world, EntityHuman entityhuman, BlockPosition blockposition, IBlockData iblockdata, @Nullable TileEntity tileentity, ItemStack itemstack) {
entityhuman.b(StatisticList.BLOCK_MINED.b(this));
- entityhuman.applyExhaustion(0.005F);
+ entityhuman.applyExhaustion(0.005F, org.bukkit.event.entity.EntityExhaustionEvent.ExhaustionReason.BLOCK_MINED); // CraftBukkit - EntityExhaustionEvent
dropItems(iblockdata, world, blockposition, tileentity, entityhuman, itemstack);
}
@@ -336,6 +342,12 @@
return this;
}