Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix miscalculation of max parallel by output for non-64 stacked items #2305

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ public int insertStackedItemStack(@NotNull ItemStack stack, int amountToInsert)
initSlot(i);
// if it's the same item or there is no item in the slot
ItemStack slotKey = this.slots[i].getItemStack();
if (slotKey.isEmpty() || ItemStackHashStrategy.comparingAllButCount().equals(slotKey, stack)) {
if (slotKey.isEmpty() || ItemStack.isSameItemSameTags(slotKey, stack)) {
// if the slot is not full
int canInsertUpTo = this.slots[i].getSlotLimit() - this.slots[i].getCount();
int canInsertUpTo = Math.min(this.slots[i].getSlotLimit() - this.slots[i].getCount(),
stack.getMaxStackSize());
if (canInsertUpTo > 0) {
int insertedAmount = Math.min(canInsertUpTo, amountToInsert);
this.slots[i].setItemStack(stack.copy()); // this copy may not be need, needs further tests
Expand Down Expand Up @@ -139,7 +140,7 @@ public ItemStack getItemStack() {
}

public void setItemStack(@NotNull ItemStack itemStack) {
if (!ItemStackHashStrategy.comparingAllButCount().equals(this.itemStack, itemStack)) {
if (!ItemStack.isSameItemSameTags(this.itemStack, itemStack)) {
this.itemStack = itemStack;
this.slotLimit = Math.min(itemStack.getMaxStackSize(), slotLimit);
}
Expand Down