package squeek.wailaharvestability.helpers;

import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;

public class OreHelper
{
	public static boolean isBlockAnOre(Block block)
	{
		return isBlockAnOre(block, 0);
	}

	public static boolean isBlockAnOre(Block block, int metadata)
	{
		return isItemAnOre(new ItemStack(block, 1, metadata));
	}

	public static boolean isItemAnOre(ItemStack itemStack)
	{
		// check the ore dictionary to see if it starts with "ore"
		int oreID = -1;
		if ((oreID = OreDictionary.getOreID(itemStack)) != -1 && OreDictionary.getOreName(oreID).startsWith("ore"))
			return true;

		// ore in the display name (but not part of another word)
		if (itemStack.getDisplayName().matches(".*(^|\\s)([oO]re)($|\\s).*"))
			return true;

		// ore as the start of the unlocalized name
		if (itemStack.getUnlocalizedName().startsWith("ore"))
			return true;

		return false;
	}
}

@@ -529,33 +529,17 @@
 %09int
- oreID = -1;%0A%09%09if ((
+%5B%5D 
 oreID
+s
  = O
@@ -559,16 +559,17 @@
 getOreID
+s
 (itemSta
@@ -575,19 +575,48 @@
 ack)
-) != -1 && 
+;%0A%09%09for (int oreID : oreIDs)%0A%09%09%7B%0A%09%09%09if (
 OreD
@@ -657,32 +657,33 @@
 With(%22ore%22))%0A%09%09%09
+%09
 return true;%0A%0A%09%09
@@ -670,32 +670,36 @@
 %09%09%09%09return true;
+%0A%09%09%7D
 %0A%0A%09%09// ore in th

Fix 'is ore' check not handling multiple oredict registrations properly