More work in the quest for greater recipe efficiency.

This commit is contained in:
Ben Spiers committed 2014-09-05 04:20:12 +01:00
1 parent c6a77f9cfa
commit c7a429177b
87 files changed
+1416 -1106

No files matched your search

@@ -0,0 +1,34 @@
package mekanism.common;
import mekanism.api.infuse.InfuseType;
public class InfuseStorage
{
public InfuseType type;
public int amount;
public InfuseStorage() {}
public InfuseStorage(InfuseType infuseType, int infuseAmount)
{
type = infuseType;
amount = infuseAmount;
}
public boolean contains(InfuseStorage storage)
{
return type == storage.type && amount >= storage.amount;
}
public void subtract(InfuseStorage storage)
{
if(contains(storage))
{
amount -= storage.amount;
} else if(type == storage.type)
{
amount = 0;
}
}
}