use of me.desht.pneumaticcraft.api.tileentity.IPneumaticMachine in project pnc-repressurized by TeamPneumatic.
the class AirHandler method getConnectedPneumatics.
/**
* Retrieves a list of all the connecting pneumatics. It takes sides in account.
*
* @return a list of face->air-handler pairs
*/
@Override
public List<Pair<EnumFacing, IAirHandler>> getConnectedPneumatics() {
List<Pair<EnumFacing, IAirHandler>> teList = new ArrayList<>();
for (IAirHandler specialConnection : specialConnectedHandlers) {
teList.add(new ImmutablePair<>(null, specialConnection));
}
for (EnumFacing direction : EnumFacing.VALUES) {
TileEntity te = getTileCache()[direction.ordinal()].getTileEntity();
IPneumaticMachine machine = ModInteractionUtils.getInstance().getMachine(te);
if (machine != null && parentPneumatic.getAirHandler(direction) == this && machine.getAirHandler(direction.getOpposite()) != null) {
teList.add(new ImmutablePair<>(direction, machine.getAirHandler(direction.getOpposite())));
}
}
if (airListener != null)
airListener.addConnectedPneumatics(teList);
return teList;
}
Aggregations