Skip to content

Commit

Permalink
Adding missed check + use .copy() (#32)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
0hwx and github-actions[bot] authored Jan 8, 2025
1 parent ac21169 commit f3b55cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public static void moveAllItems(EntityPlayer player, Container container, ISlot
} else {
int inserted = stackInSlot.stackSize - remainder.stackSize;
if (inserted > 0) {
slot1.bogo$putStack(remainder.stackSize > 0 ? remainder : null);
slot1.bogo$putStack(remainder.copy());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ public static boolean damageItemHook(ItemStack itemStack, EntityPlayer player) {
if (!playerConfig.enableAutoRefill || playerConfig.autoRefillDamageThreshold <= 0) return false;

if (RefillHandler.shouldHandleRefill(player, itemStack) && isNotArmor(itemStack)) {
ItemStack handItem = player.getHeldItem();
if (handItem != itemStack) {
return false;
}
int durabilityLeft = itemStack.getMaxDamage() - itemStack.getItemDamage();
if (durabilityLeft >= 0 && durabilityLeft < playerConfig.autoRefillDamageThreshold) {
return RefillHandler.handle(player.inventory.currentItem, itemStack, player, true);
Expand Down

0 comments on commit f3b55cc

Please sign in to comment.