2015-05-25 12:37:24 +02:00
|
|
|
--- a/net/minecraft/server/BlockCake.java
|
|
|
|
+++ b/net/minecraft/server/BlockCake.java
|
2016-11-17 02:41:03 +01:00
|
|
|
@@ -40,7 +40,18 @@
|
|
|
|
return false;
|
|
|
|
} else {
|
2016-12-20 21:00:00 +01:00
|
|
|
entityhuman.b(StatisticList.H);
|
2014-11-25 22:32:16 +01:00
|
|
|
- entityhuman.getFoodData().eat(2, 0.1F);
|
|
|
|
+ // CraftBukkit start
|
|
|
|
+ // entityhuman.getFoodData().eat(2, 0.1F);
|
|
|
|
+ int oldFoodLevel = entityhuman.getFoodData().foodLevel;
|
|
|
|
+
|
|
|
|
+ org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callFoodLevelChangeEvent(entityhuman, 2 + oldFoodLevel);
|
|
|
|
+
|
|
|
|
+ if (!event.isCancelled()) {
|
|
|
|
+ entityhuman.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, 0.1F);
|
|
|
|
+ }
|
|
|
|
+
|
2016-07-01 03:20:31 +02:00
|
|
|
+ ((EntityPlayer) entityhuman).getBukkitEntity().sendHealthUpdate();
|
2014-11-25 22:32:16 +01:00
|
|
|
+ // CraftBukkit end
|
|
|
|
int i = ((Integer) iblockdata.get(BlockCake.BITES)).intValue();
|
|
|
|
|
|
|
|
if (i < 6) {
|