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

Change the ItemStack in the CountedItemStackList Constructor #6992

Open
BeneHenke opened this issue Sep 25, 2024 · 0 comments · May be fixed by #7055
Open

Change the ItemStack in the CountedItemStackList Constructor #6992

BeneHenke opened this issue Sep 25, 2024 · 0 comments · May be fixed by #7055
Labels
status: fixed in next release Issue will be fixed in the next release type: bug Issue where something isn't working

Comments

@BeneHenke
Copy link

BeneHenke commented Sep 25, 2024

Currently the Display Link does not work with mods that increase the stack size in chests like Sophisticated Storage.
To get the right number of items the extractItem value could be changed to use the inventory.getStackInSlot(slot); method as this one does not check the max stack size of the item. This has worked for me but I am not sure if there is a reason to use inventory.extractItem(slot, inventory.getSlotLimit(slot), true).

public CountedItemStackList(IItemHandler inventory, FilteringBehaviour filteringBehaviour) {
        for (int slot = 0; slot < inventory.getSlots(); slot++) {
            //ItemStack extractItem = inventory.extractItem(slot, inventory.getSlotLimit(slot), true);
            ItemStack extractItem = inventory.getStackInSlot(slot);

            if (filteringBehaviour.test(extractItem))
                add(extractItem);
        }
    }
@IThundxr IThundxr self-assigned this Oct 7, 2024
@IThundxr IThundxr removed their assignment Dec 16, 2024
@IThundxr IThundxr added type: bug Issue where something isn't working status: fixed in next release Issue will be fixed in the next release labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: fixed in next release Issue will be fixed in the next release type: bug Issue where something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants