diff options
Diffstat (limited to 'src/main/java/net/minecraft/server/ItemFood.java')
-rw-r--r-- | src/main/java/net/minecraft/server/ItemFood.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/ItemFood.java b/src/main/java/net/minecraft/server/ItemFood.java index f870e814..43990a9a 100644 --- a/src/main/java/net/minecraft/server/ItemFood.java +++ b/src/main/java/net/minecraft/server/ItemFood.java @@ -1,7 +1,5 @@ package net.minecraft.server; -import org.bukkit.event.entity.FoodLevelChangeEvent; // CraftBukkit - public class ItemFood extends Item { public final int a; @@ -31,8 +29,7 @@ public class ItemFood extends Item { // CraftBukkit start int oldFoodLevel = entityhuman.getFoodData().foodLevel; - FoodLevelChangeEvent event = new FoodLevelChangeEvent(entityhuman.getBukkitEntity(), Math.min(this.getNutrition() + entityhuman.getFoodData().foodLevel, 20)); - entityhuman.world.getServer().getPluginManager().callEvent(event); + org.bukkit.event.entity.FoodLevelChangeEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callFoodLevelChangeEvent(entityhuman, Math.min(this.getNutrition() + oldFoodLevel, 20)); if (!event.isCancelled()) { entityhuman.getFoodData().eat(event.getFoodLevel() - oldFoodLevel, this.getSaturationModifier()); |