-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArcFurnaceRecipeManager.java
More file actions
40 lines (33 loc) · 1.24 KB
/
ArcFurnaceRecipeManager.java
File metadata and controls
40 lines (33 loc) · 1.24 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
package LiquidMetals;
import java.util.ArrayList;
import net.minecraft.item.ItemStack;
import net.minecraftforge.liquids.LiquidStack;
import net.minecraftforge.oredict.OreDictionary;
public class ArcFurnaceRecipeManager {
ArrayList<ArcFurnaceRecipe> recipes = new ArrayList();
public static ArcFurnaceRecipeManager instance = new ArcFurnaceRecipeManager();
public static void addRecipe(String input, LiquidStack output) {
ArrayList<ItemStack> ores = OreDictionary.getOres(input);
for(int a = 0; a < ores.size(); a++) {
addRecipe(new ItemStack(ores.get(a).itemID, 1, ores.get(a).getItemDamage()), output);
}
}
public static void addRecipe(ItemStack input, LiquidStack output) {
instance.recipes.add(new ArcFurnaceRecipe(input, output));
}
public static ArcFurnaceRecipe getRecipe(ItemStack item) {
if(item == null) {
return null;
}
for(int a = 0; a < instance.recipes.size(); a++) {
if((instance.recipes.get(a).getInput().getItem().itemID == item.getItem().itemID) &&
(instance.recipes.get(a).getInput().getItemDamage() == item.getItemDamage())) {
int stackSize = item.stackSize;
if(stackSize >= instance.recipes.get(a).getInput().stackSize) {
return instance.recipes.get(a);
}
}
}
return null;
}
}