Skip to content

Commit

Permalink
fix: 🐛 Fixed feeding upgrade to only put original main hand item into…
Browse files Browse the repository at this point in the history
… player's hand after all of its logic is done because some foods shrink the stack only in finishUsingItem which was taking from whatever item player had in hand
  • Loading branch information
P3pp3rF1y committed Jan 4, 2025
1 parent ecbcffe commit 84dc604
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ loader_version_range=[4,)
mod_id=sophisticatedcore
mod_name=Sophisticated Core
mod_license=GNU General Public License v3.0
mod_version=1.0.12
mod_version=1.0.13
mod_group_id=sophisticatedcore
mod_authors=P3pp3rF1y
mod_description=A library / shared functionality mod for Sophisticated Storage and Backpacks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ private boolean tryFeedingStack(Level level, int hungerLevel, Player player, Int
singleItemCopy.setCount(1);

if (singleItemCopy.use(level, player, InteractionHand.MAIN_HAND).getResult() == InteractionResult.CONSUME) {
player.getInventory().items.set(player.getInventory().selected, mainHandItem);

stack.shrink(1);
inventory.setStackInSlot(slot, stack);

Expand All @@ -100,6 +98,8 @@ private boolean tryFeedingStack(Level level, int hungerLevel, Player player, Int
InventoryHelper.insertOrDropItem(player, insertResult, playerInventory));
}
}

player.getInventory().items.set(player.getInventory().selected, mainHandItem);
return true;
}
player.getInventory().items.set(player.getInventory().selected, mainHandItem);
Expand Down

0 comments on commit 84dc604

Please sign in to comment.