Skip to content

Commit

Permalink
Update ItemStackUtils.java (#10626)
Browse files Browse the repository at this point in the history
Change method call order for obtaining food value
  • Loading branch information
Thodor12 authored Jan 31, 2025
1 parent e9d793a commit a3a9826
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/java/com/minecolonies/api/util/ItemStackUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -862,11 +862,10 @@ public static Set<ItemStack> allItemsPlusInventory(@NotNull final Player player)
public static void consumeFood(final ItemStack foodStack, final AbstractEntityCitizen citizen, final Inventory inventory)
{
final ICitizenData citizenData = citizen.getCitizenData();
ItemStack itemUseReturn = foodStack.finishUsingItem(citizen.level(), citizen);
final double satIncrease = FoodUtils.getFoodValue(foodStack, citizen);

citizenData.increaseSaturation(satIncrease);

ItemStack itemUseReturn = foodStack.finishUsingItem(citizen.level(), citizen);
// Special handling for these as those are stackable + have a return per item.
if (foodStack.getItem() instanceof HoneyBottleItem)
{
Expand Down

0 comments on commit a3a9826

Please sign in to comment.