use of me.desht.pneumaticcraft.common.block.tubes.TubeModule in project pnc-repressurized by TeamPneumatic.
the class TileEntityPressureTube method onNeighborTileUpdate.
@Override
public void onNeighborTileUpdate() {
super.onNeighborTileUpdate();
updateConnections();
for (TubeModule module : modules) {
if (module != null)
module.onNeighborTileUpdate();
}
}
use of me.desht.pneumaticcraft.common.block.tubes.TubeModule in project pnc-repressurized by TeamPneumatic.
the class TileEntityPressureTube method update.
@Override
public void update() {
super.update();
for (TubeModule module : modules) {
if (module != null) {
module.shouldDrop = true;
module.update();
}
}
List<Pair<EnumFacing, IAirHandler>> teList = getAirHandler(null).getConnectedPneumatics();
boolean hasModules = false;
for (TubeModule module : modules) {
if (module != null) {
hasModules = true;
break;
}
}
if (!hasModules && teList.size() == 1 && !getWorld().isRemote) {
for (Pair<EnumFacing, IAirHandler> entry : teList) {
if (entry.getKey() != null && modules[entry.getKey().getOpposite().ordinal()] == null && isConnectedTo(entry.getKey().getOpposite()))
getAirHandler(null).airLeak(entry.getKey().getOpposite());
}
}
}
Aggregations