public static boolean matches(Item item, String oredict) {
int copperId = OreDictionary.getOreID(oredict);
for (int id : OreDictionary.getOreIDs(new ItemStack(item))) {
if (id == copperId) {
return true;
}
}
return false;
}
// usage:
if (matches(item, "ingotCopper")) {
System.out.println("the item is copper, wowsies");
}