use of pneumaticCraft.api.tileentity.IPneumaticMachine in project PneumaticCraft by MineMaarten.
the class TileEntityVacuumPump method getConnectedPneumatics.
@Override
public List<Pair<ForgeDirection, IAirHandler>> getConnectedPneumatics() {
List<Pair<ForgeDirection, IAirHandler>> teList = new ArrayList<Pair<ForgeDirection, IAirHandler>>();
ForgeDirection direction = getInputSide();
TileEntity te = getTileCache()[direction.ordinal()].getTileEntity();
IPneumaticMachine machine = ModInteractionUtils.getInstance().getMachine(te);
if (machine != null && isConnectedTo(direction) && machine.isConnectedTo(direction.getOpposite())) {
teList.add(new ImmutablePair(direction, machine.getAirHandler()));
} else if (te instanceof ISidedPneumaticMachine) {
IAirHandler handler = ((ISidedPneumaticMachine) te).getAirHandler(direction);
if (handler != null) {
teList.add(new ImmutablePair(direction, handler));
}
}
return teList;
}
Aggregations