if(tank.isFull()) {
return false;
}
IGasHandler extTank = getTankContainer(advancedGasConduit, dir);
if(extTank != null) {
int maxExtract = Math.min(maxExtractPerTick, tank.getAvailableSpace());
if(gasType == null || !tank.containsValidGas()) {
GasStack drained = extTank.drawGas(dir.getOpposite(), maxExtract);
if(drained == null || drained.amount <= 0) {
return false;
}
setGasType(drained);
tank.setGas(drained.copy());
return true;
}
GasStack couldDrain = gasType.copy();
couldDrain.amount = maxExtract;
// GasStack drained = extTank.drain(dir.getOpposite(), couldDrain, true);
// if(drained == null || drained.amount <= 0) {
// return false;
// }
// tank.addAmount(drained.amount);
//Have to use this 'double handle' approach to work around an issue with TiC
GasStack drained = extTank.drawGas(dir.getOpposite(), maxExtract);
if(drained == null || drained.amount == 0) {
return false;
} else {
if(drained.isGasEqual(getGasType())) {
tank.addAmount(drained.amount);