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
Assignees

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);
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants