Skip to content

Commit

Permalink
Fix ME Output & QC Rack filling (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
RecursivePineapple authored Feb 18, 2025
1 parent cd760d4 commit 1f267e8
Showing 1 changed file with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,40 @@

import net.minecraftforge.common.util.ForgeDirection;

import gregtech.api.interfaces.metatileentity.IMetaTileEntity;
import gregtech.api.interfaces.tileentity.IGregTechTileEntity;
import gregtech.api.interfaces.tileentity.IHasInventory;

import com.google.common.collect.ImmutableList;
import com.recursive_pineapple.matter_manipulator.MMMod;
import com.recursive_pineapple.matter_manipulator.asm.Optional;
import com.recursive_pineapple.matter_manipulator.common.utils.Mods.Names;
import gregtech.common.tileentities.machines.MTEHatchOutputBusME;
import gregtech.common.tileentities.machines.MTEHatchOutputME;
import tectech.thing.metaTileEntity.hatch.MTEHatchRack;

public enum InventoryAdapter {

GTUnrestricted {
@Override
public boolean canHandle(IInventory inv) {
return GregTech.isModLoaded() && canHandleImpl(inv);
}

@Optional(Names.GREG_TECH)
private boolean canHandleImpl(IInventory inv) {
if (inv instanceof IGregTechTileEntity igte) {
IMetaTileEntity imte = igte.getMetaTileEntity();

if (imte instanceof MTEHatchOutputBusME) return true;
if (imte instanceof MTEHatchOutputME) return true;
if (imte instanceof MTEHatchRack) return true;
}

return false;
}
},

GT {

@Override
Expand Down

0 comments on commit 1f267e8

Please sign in to comment.