Ender IO

Ender IO

92M Downloads

Items are lost during transfer via Item Conduits

DuraBrite opened this issue ยท 2 comments

commented

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

commented

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;
    }
}
commented

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