Merge pull request #963 from spookydonut/development
Made Electrolytic Separators vent excess gas by default
This commit is contained in:
commit
5d494a8d8d
4 changed files with 29 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
|
||||
|
|
6
common/mekanism/client/gui/GuiElectrolyticSeparator.java
Normal file → Executable file
6
common/mekanism/client/gui/GuiElectrolyticSeparator.java
Normal file → Executable file
|
@ -86,6 +86,9 @@ public class GuiElectrolyticSeparator extends GuiMekanism
|
|||
|
||||
name = tileEntity.dumpRight ? "Dumping..." : tileEntity.rightTank.getGas() == null ? MekanismUtils.localize("gui.none") : tileEntity.rightTank.getGas().getGas().getLocalizedName();
|
||||
fontRenderer.drawString(name, 156-fontRenderer.getStringWidth(name), 73, 0x404040);
|
||||
|
||||
name = tileEntity.dumpExcess ? "Dumping Excess" : "Stop when full";
|
||||
fontRenderer.drawString(name, 97, 6, 0x404040);
|
||||
|
||||
if(xAxis >= 6 && xAxis <= 22 && yAxis >= 11 && yAxis <= 69)
|
||||
{
|
||||
|
@ -123,6 +126,9 @@ public class GuiElectrolyticSeparator extends GuiMekanism
|
|||
|
||||
int rightDisplay = tileEntity.dumpRight ? 60 : 52;
|
||||
drawTexturedModalRect(guiWidth + 160, guiHeight + 73, 176, rightDisplay, 8, 8);
|
||||
|
||||
int dumpDisplay = tileEntity.dumpExcess ? 60 : 52;
|
||||
drawTexturedModalRect(guiWidth + 84, guiHeight + 6, 176, dumpDisplay, 8, 8);
|
||||
|
||||
int displayInt;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.7 KiB |
Loading…
Reference in a new issue