Merge pull request #963 from spookydonut/development

Made Electrolytic Separators vent excess gas by default
This commit is contained in:
Aidan 2014-02-04 14:48:53 -08:00
commit 5d494a8d8d
4 changed files with 29 additions and 0 deletions

View file

@ -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

View file

@ -87,6 +87,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)
{
drawCreativeTabHoveringText(tileEntity.fluidTank.getFluid() != null ? tileEntity.fluidTank.getFluid().getFluid().getLocalizedName() + ": " + tileEntity.fluidTank.getFluidAmount() + "mB" : MekanismUtils.localize("gui.empty"), xAxis, yAxis);
@ -124,6 +127,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;
if(tileEntity.fluidTank.getFluid() != null)

View file

@ -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);
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB