Fix Gas Tanks filling from the wrong type of gas.

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

No files matched your search

+1 -1
View File
@@ -79,7 +79,7 @@ public class GasTank
*/
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;
}
@@ -145,7 +145,7 @@ public abstract class TileEntityAdvancedElectricMachine<RECIPE extends AdvancedM
GasStack stack = getItemGas(inventory[1]);
int gasNeeded = gasTank.getNeeded();
if(stack != null && stack.amount <= gasNeeded)
if(stack != null && gasTank.canReceive(stack.getGas()) && gasNeeded >= stack.amount)
{
gasTank.receive(stack, true);