GregTechCEu / GregTech-Modern

GregTech CE Unofficial for modern versions
GNU Lesser General Public License v3.0
266 stars 157 forks source link

Hopper Extracts From Ingredient Slot #273

Closed Phoupraw closed 1 year ago

Phoupraw commented 1 year ago

GregTech CEu Version

fabric-1.20.1-1.0.10-build_132

Recipe Viewer Installed

EMI

Environment

Singleplayer

Cross-Mod Interaction

Unsure

Expected Behavior

Hopper can only extract items from result slots

Actual Behavior

Hopper extracts items from ingredient slot.

Steps to Reproduce

  1. Place a low pressure steam macerator.
  2. Provide steam power.
  3. Put some ingredients into its ingredient slot.
  4. Place a hopper beneath it.
  5. The hopper is extracting items from its ingredient slot.

Additional Information

Ingredient slot: image

Phoupraw commented 1 year ago

I fixed it by mixin:

@Pseudo
@Mixin(targets = "com/lowdragmc/lowdraglib/side/item/fabric/ItemTransferHelperImpl$2")
abstract class MItemTransferHelperImpl_2 extends SingleStackStorage {

    @Shadow
    @Final
    IItemTransfer val$itemTransfer;

    @Shadow
    @Final
    int val$slot;

    @Override
    protected boolean canInsert(ItemVariant itemVariant) {
        return this.val$itemTransfer.insertItem(this.val$slot, itemVariant.toStack(), true).isEmpty();
    }

    @Override
    protected boolean canExtract(ItemVariant itemVariant) {
        return !this.val$itemTransfer.extractItem(this.val$slot, Integer.MAX_VALUE, true).isEmpty();
    }

}
screret commented 1 year ago

this doesn't happen for me at all. feel free to reopen if the issue occurs with only GT.