Fixed infinite fuel production.

This commit is contained in:
SirSengir 2012-07-14 18:04:30 +02:00
parent 760dcf1d17
commit 8b8471fca2
2 changed files with 13 additions and 2 deletions

View file

@ -92,6 +92,17 @@ public class LiquidStack {
return itemID == other.itemID && itemMeta == other.itemMeta;
}
/**
* @param other
* @return true if this LiquidStack contains the other liquid (liquids are equal and amount >= other.amount).
*/
public boolean containsLiquid(LiquidStack other) {
if(!isLiquidEqual(other))
return false;
return amount >= other.amount;
}
/**
* @param other ItemStack containing liquids.
* @return true if this LiquidStack contains the same liquid as the one passed in.
@ -102,7 +113,7 @@ public class LiquidStack {
return itemID == other.itemID && itemMeta == other.getItemDamage();
}
/**
* @return ItemStack representation of this LiquidStack
*/

View file

@ -286,7 +286,7 @@ public class TileRefinery extends TileMachine implements ILiquidContainer, IPowe
if(liquid == null)
return true;
return liquid.isLiquidEqual(new LiquidStack(slot1.liquidId, slot1.quantity, 0)) || liquid.isLiquidEqual(new LiquidStack(slot2.liquidId, slot2.quantity, 0));
return new LiquidStack(slot1.liquidId, slot1.quantity, 0).containsLiquid(liquid) || new LiquidStack(slot2.liquidId, slot2.quantity, 0).containsLiquid(liquid);
}
private boolean consumeInput(LiquidStack liquid) {