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

Items are lost during transfer via Item Conduits #898

Open
1 task done
DuraBrite opened this issue Nov 17, 2024 · 2 comments · May be fixed by #899
Open
1 task done

Items are lost during transfer via Item Conduits #898

DuraBrite opened this issue Nov 17, 2024 · 2 comments · May be fixed by #899
Labels
Area-Conduits Everything involving conduits MC-1.21.1 Status-Triage A Triage Member should take a look at this Type-Bug There is a problem.

Comments

@DuraBrite
Copy link

Is there an existing issue for this?

  • I did not find any existing issues.

Current Behavior

When transferring items using EnderIO Item Conduits, some items are lost during the process. This occurs in both of the current versions for 1.20.1 and 1.21.1.

Expected Behavior

All items transferred through the Item Conduits should arrive in the destination inventory without any losses.

How to Test

A video is attached to demonstrate the setup and how the bug can be reproduced. 10 Red Wool and 10 Cyan Wool are transfered but only 10 Red and 8 Cyan arrive.

enderio_item_conduit.mp4

Local Environment

- **Operating System**: tested on Windows and Linux Server
- **Java version**: 17.0.12
- **Minecraft Version**: Forge: 1.20.1 (47.3.12) and NeoForge: 1.21.1
- **Version**: Forge: 6.2.2 and NeoForge: 7.0.9
- **Other Mods**: none

Any Additional Information?

No response

@DuraBrite DuraBrite added Status-Triage A Triage Member should take a look at this Type-Bug There is a problem. labels Nov 17, 2024
@github-project-automation github-project-automation bot moved this to To triage in Ender IO Bugs Nov 17, 2024
@DuraBrite
Copy link
Author

I adjusted the code and this worked for me. Maybe this can assist you.
The issue might be caused by a mismatch between the amount extracted and the amount successfully inserted. The method extractHandler.extractItem should only extract the exact quantity that was successfully inserted.

com/enderio/conduits/common/conduit/type/item/ItemConduitTicker.java:79

ItemStack notInserted = ItemHandlerHelper.insertItem(insert.capability, extractedItem, false);
int successfullyInserted = extractedItem.getCount() - notInserted.getCount();

if (successfullyInserted > 0) {
    extracted += successfullyInserted;
    extractHandler.extractItem(i, successfullyInserted, false);
    if (extracted >= speed) {
        if (sidedExtractData.isRoundRobin) {
            sidedExtractData.rotatingIndex = insertIndex + 1;
        }
        continue toNextExtract;
    } else {
        continue nextItem;
    }
}

@CitiesXL2815
Copy link
Collaborator

I adjusted the code and this worked for me. Maybe this can assist you. The issue might be caused by a mismatch between the amount extracted and the amount successfully inserted. The method extractHandler.extractItem should only extract the exact quantity that was successfully inserted.

com/enderio/conduits/common/conduit/type/item/ItemConduitTicker.java:79

ItemStack notInserted = ItemHandlerHelper.insertItem(insert.capability, extractedItem, false);
int successfullyInserted = extractedItem.getCount() - notInserted.getCount();

if (successfullyInserted > 0) {
    extracted += successfullyInserted;
    extractHandler.extractItem(i, successfullyInserted, false);
    if (extracted >= speed) {
        if (sidedExtractData.isRoundRobin) {
            sidedExtractData.rotatingIndex = insertIndex + 1;
        }
        continue toNextExtract;
    } else {
        continue nextItem;
    }
}

@DuraBrite Make a Pull Request can also help us as well, so we can just merge it to the build

@CitiesXL2815 CitiesXL2815 added Area-Conduits Everything involving conduits MC-1.21.1 labels Nov 17, 2024
@DuraBrite DuraBrite linked a pull request Nov 19, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Conduits Everything involving conduits MC-1.21.1 Status-Triage A Triage Member should take a look at this Type-Bug There is a problem.
Projects
Status: To triage
Development

Successfully merging a pull request may close this issue.

2 participants