Skip to content

Commit

Permalink
Fix food with negative hunger being inedible when modifyFoodEatingSpe…
Browse files Browse the repository at this point in the history
…ed is true
  • Loading branch information
squeek502 committed Dec 29, 2014
1 parent 1d6dffc commit 7b71da7
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ public void onFoodStartEating(PlayerUseItemEvent.Start event)
{
if (IguanaConfig.modifyFoodEatingSpeed && event.item != null && event.item.getItem() instanceof ItemFood)
{
event.duration = FoodValues.get(event.item).hunger * 8 + 8;
int hunger = FoodValues.get(event.item).hunger;
if (hunger > 0)
event.duration = hunger * 8 + 8;
}
}
}

0 comments on commit 7b71da7

Please sign in to comment.