mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-22 04:52:25 +00:00
More work in the quest for greater recipe efficiency.
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user