Search in sources :

Example 6 with IOreDictEntry

use of minetweaker.api.oredict.IOreDictEntry in project CraftTweaker by CraftTweaker.

the class OreBracketHandler method getOreList.

public static List<IOreDictEntry> getOreList(String wildcardName) {
    List<IOreDictEntry> result = new ArrayList<>();
    Pattern wildcardPattern = Pattern.compile(wildcardName.replaceAll("\\*", ".+"));
    for (IOreDictEntry someOreDict : MineTweakerAPI.oreDict.getEntries()) {
        String oreDictName = someOreDict.getName();
        if (wildcardPattern.matcher(oreDictName).matches()) {
            result.add(getOre(oreDictName));
        }
    }
    return result;
}
Also used : Pattern(java.util.regex.Pattern) IOreDictEntry(minetweaker.api.oredict.IOreDictEntry)

Aggregations

IOreDictEntry (minetweaker.api.oredict.IOreDictEntry)6 IItemStack (minetweaker.api.item.IItemStack)4 ItemStack (net.minecraft.item.ItemStack)4 IngredientStack (minetweaker.api.item.IngredientStack)3 ArrayList (java.util.ArrayList)2 Pattern (java.util.regex.Pattern)2 PotionChemical (minechem.potion.PotionChemical)1 IIngredient (minetweaker.api.item.IIngredient)1