Some convenience and safety changes.

This commit is contained in:
CovertJaguar 2012-08-09 21:37:52 -07:00
parent f741f74e08
commit bff14c9134

View file

@ -28,9 +28,9 @@ public abstract class LiquidDictionary
{
LiquidStack existing = liquids.get(name);
if(existing != null) {
return existing;
return existing.copy();
}
liquids.put(name, liquid);
liquids.put(name, liquid.copy());
return liquid;
}
@ -41,10 +41,17 @@ public abstract class LiquidDictionary
* Can return null.
*
* @param name the name of the liquid
* @param amount the amout of liquid
* @return
*/
public static LiquidStack getLiquid(String name)
public static LiquidStack getLiquid(String name, int amount)
{
return liquids.get(name);
LiquidStack liquid = liquids.get(name);
if(liquid == null)
return null;
liquid = liquid.copy();
liquid.amount = amount;
return liquid;
}
}