diff --git a/gradle.properties b/gradle.properties index 064766f3..5d2c1b76 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,7 +13,7 @@ loader_version_range=[4,) mod_id=sophisticatedbackpacks mod_name=Sophisticated Backpacks mod_license=GNU General Public License v3.0 -mod_version=3.20.16 +mod_version=3.20.17 mod_group_id=sophisticatedbackpacks mod_authors=P3pp3rF1y, Ridanisaurus mod_description=Fancy and functional backpacks. diff --git a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/backpack/BackpackItem.java b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/backpack/BackpackItem.java index ac3fe7a6..95dfa2df 100644 --- a/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/backpack/BackpackItem.java +++ b/src/main/java/net/p3pp3rf1y/sophisticatedbackpacks/backpack/BackpackItem.java @@ -336,8 +336,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; }