2013-08-30 00:57:13 +02:00
|
|
|
package ic2.api.recipe;
|
|
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
|
|
|
|
import net.minecraftforge.oredict.OreDictionary;
|
|
|
|
|
|
|
|
public class RecipeInputOreDict implements IRecipeInput {
|
2014-02-14 23:55:34 +01:00
|
|
|
public RecipeInputOreDict(String input1) {
|
|
|
|
this(input1, 1);
|
2013-08-30 00:57:13 +02:00
|
|
|
}
|
|
|
|
|
2014-02-14 23:55:34 +01:00
|
|
|
public RecipeInputOreDict(String input1, int amount1) {
|
|
|
|
this.input = input1;
|
|
|
|
this.amount = amount1;
|
2013-08-30 00:57:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public boolean matches(ItemStack subject) {
|
|
|
|
List<ItemStack> inputs = OreDictionary.getOres(input);
|
|
|
|
|
2014-02-14 23:55:34 +01:00
|
|
|
for (ItemStack input1 : inputs) {
|
|
|
|
if (subject.itemID == input1.itemID &&
|
|
|
|
(subject.getItemDamage() == input1.getItemDamage() || input1.getItemDamage() == OreDictionary.WILDCARD_VALUE)) {
|
2013-08-30 00:57:13 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int getAmount() {
|
|
|
|
return amount;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public List<ItemStack> getInputs() {
|
|
|
|
return OreDictionary.getOres(input);
|
|
|
|
}
|
|
|
|
|
|
|
|
public final String input;
|
|
|
|
public final int amount;
|
|
|
|
}
|