mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-28 15:46:01 +00:00
Made Electrolytic Separators vent excess gas by default
This commit is contained in:
1 parent
c8002dda5f
commit
6400dfe3bb
2 files changed
+23
No files matched your search
@@ -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
|
||||
|
||||
@@ -62,6 +62,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()
|
||||
{
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user