Fix Gas Tanks filling from the wrong type of gas.

(eg. in a Chemical Injection Chamber.)
This commit is contained in:
Ben Spiers 2014-09-07 00:15:00 +01:00
parent b75ff5d9a1
commit bafdb18756
2 changed files with 2 additions and 2 deletions

View file

@ -79,7 +79,7 @@ public class GasTank
*/ */
public int receive(GasStack amount, boolean doReceive) public int receive(GasStack amount, boolean doReceive)
{ {
if(amount == null || (stored != null && stored.amount == getMaxGas())) if(amount == null || (stored != null && !(stored.amount != getMaxGas() && stored.isGasEqual(amount))))
{ {
return 0; return 0;
} }

View file

@ -145,7 +145,7 @@ public abstract class TileEntityAdvancedElectricMachine<RECIPE extends AdvancedM
GasStack stack = getItemGas(inventory[1]); GasStack stack = getItemGas(inventory[1]);
int gasNeeded = gasTank.getNeeded(); int gasNeeded = gasTank.getNeeded();
if(stack != null && stack.amount <= gasNeeded) if(stack != null && gasTank.canReceive(stack.getGas()) && gasNeeded >= stack.amount)
{ {
gasTank.receive(stack, true); gasTank.receive(stack, true);