-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIngotFormerRecipeManager.java
More file actions
41 lines (34 loc) · 1.18 KB
/
IngotFormerRecipeManager.java
File metadata and controls
41 lines (34 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package LiquidMetals;
import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.oredict.OreDictionary;
public class IngotFormerRecipeManager {
ArrayList<IngotFormerRecipe> recipes = new ArrayList();
public static IngotFormerRecipeManager instance = new IngotFormerRecipeManager();
public static void addRecipe(LiquidStack input, ItemStack output) {
instance.recipes.add(new IngotFormerRecipe(input, output));
}
public static void addRecipe(LiquidStack input, String output) {
ArrayList<ItemStack> ores = OreDictionary.getOres(output);
if(ores.size() == 0){
return;
}
instance.recipes.add(new IngotFormerRecipe(input, ores.get(0)));
}
public static IngotFormerRecipe getRecipe(LiquidStack item) {
if(item == null) {
return null;
}
for(int a = 0; a < instance.recipes.size(); a++) {
if((instance.recipes.get(a).getInput().itemID == item.itemID) &&
(instance.recipes.get(a).getInput().itemMeta == item.itemMeta)) {
int stackSize = item.amount;
if(stackSize >= instance.recipes.get(a).getInput().amount) {
return instance.recipes.get(a);
}
}
}
return null;
}
}