Skip to content

Commit

Permalink
fix: šŸ› Fixed stashing logic to be able to stash oversized stacks (larā€¦
Browse files Browse the repository at this point in the history
ā€¦ger than usual max stack size) with right click on them again
  • Loading branch information
P3pp3rF1y committed Oct 6, 2024
1 parent 678ad54 commit 1dfd791
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.daemon=false

mod_id=sophisticatedbackpacks
mod_group_id=sophisticatedbackpacks
mod_version=3.20.10
mod_version=3.20.11
sonar_project_key=sophisticatedbackpacks:SophisticatedBackpacks
github_package_url=https://maven.pkg.github.com/P3pp3rF1y/SophisticatedBackpacks

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,14 @@ public boolean overrideStackedOnOther(ItemStack storageStack, Slot slot, ClickAc
ItemStack stashResult = stash(storageStack, stackToStash, true);
if (stashResult.getCount() < stackToStash.getCount()) {
int countToTake = stackToStash.getCount() - stashResult.getCount();
ItemStack takeResult = slot.safeTake(countToTake, countToTake, player);
stash(storageStack, takeResult, false);
while (countToTake > 0) {
ItemStack takeResult = slot.safeTake(countToTake, countToTake, player);
if (takeResult.isEmpty()) {
break;
}
stash(storageStack, takeResult, false);
countToTake -= takeResult.getCount();
}
return true;
}

Expand Down

0 comments on commit 1dfd791

Please sign in to comment.