Made Electrolytic Separators vent excess gas by default
This commit is contained in:
parent
c8002dda5f
commit
6400dfe3bb
2 changed files with 23 additions and 0 deletions
|
@ -115,6 +115,21 @@ public class GasTank
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this GasTank can receive the specified type of gas. Will return TRUE if this tank does not need anymore gas.
|
||||
* @param gas - gas to check
|
||||
* @return if this GasTank can accept the defined gas
|
||||
*/
|
||||
public boolean canReceiveType(Gas gas)
|
||||
{
|
||||
if(stored != null && (gas != null && gas != stored.getGas()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* If this GasTank can be drawn of the specified type of gas. Will return false if this tank does not contain any gas.
|
||||
* @param gas - gas to check
|
||||
|
|
|
@ -63,6 +63,9 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
/** Type type of gas this block is dumping. */
|
||||
public boolean dumpRight = false;
|
||||
|
||||
/** Whether to dump excess gas when a tank is full */
|
||||
public boolean dumpExcess = true; // default to true until gui elements added
|
||||
|
||||
public TileEntityElectrolyticSeparator()
|
||||
{
|
||||
super("ElectrolyticSeparator", MachineType.ELECTROLYTIC_SEPARATOR.baseEnergy);
|
||||
|
@ -199,6 +202,11 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp
|
|||
|
||||
public boolean canFill(ChemicalPair gases)
|
||||
{
|
||||
if(dumpExcess)
|
||||
{
|
||||
return (leftTank.canReceiveType(gases.leftGas.getGas()) && rightTank.canReceiveType(gases.rightGas.getGas()))
|
||||
}
|
||||
|
||||
return (leftTank.canReceive(gases.leftGas.getGas()) && leftTank.getNeeded() >= gases.leftGas.amount
|
||||
&& rightTank.canReceive(gases.rightGas.getGas()) && rightTank.getNeeded() >= gases.rightGas.amount);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue