本文整理汇总了Java中net.minecraftforge.oredict.OreDictionary.doesOreNameExist方法的典型用法代码示例。如果您正苦于以下问题:Java OreDictionary.doesOreNameExist方法的具体用法?Java OreDictionary.doesOreNameExist怎么用?Java OreDictionary.doesOreNameExist使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.oredict.OreDictionary
的用法示例。
在下文中一共展示了OreDictionary.doesOreNameExist方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initHeadRepairItems
import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public static void initHeadRepairItems() {
for (HeadMaterial mat : Materials.head_registry.values()) {
if (mat.getRepairItem().isEmpty()) {
if (OreDictionary.doesOreNameExist(mat.getCraftingItem())) {
NonNullList<ItemStack> ores = OreDictionary.getOres(mat.getCraftingItem());
if (ores.size() > 0) {
ItemStack repairItem = OreDictionary.getOres(mat.getCraftingItem()).get(0);
mat.setRepairItem(repairItem);
}
}
}
}
}
示例2: matchesOreName
import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public static boolean matchesOreName(String oreName, ItemStack stack) {
if (!OreDictionary.doesOreNameExist(oreName)) return false;
NonNullList<ItemStack> oreItems = OreDictionary.getOres(oreName);
for(ItemStack oreItem : oreItems) {
if (OreDictionary.itemMatches(stack, oreItem, false)) return true;
}
return false;
}
示例3: matches
import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public static final boolean matches(String template, ItemStack item) {
boolean templatePresent = template!=null && !template.isEmpty();
boolean itemPresent = item!=null && !item.isEmpty();
if (!templatePresent && itemPresent) return false; // Empty != NonEmpty
if ( templatePresent && !itemPresent) return false; // NonEmpty != Empty
if (!templatePresent && !itemPresent) return true; // Empty == Empty
if (!OreDictionary.doesOreNameExist(template)) return false;
NonNullList<ItemStack> ores = OreDictionary.getOres(template);
return OreDictionary.containsMatch(false, ores, item);
}
示例4: millRecipes
import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public static void millRecipes(String key) {
if (OreDictionary.doesOreNameExist("dust"+key) && !OreDictionary.getOres("dust"+key).isEmpty()) {
//System.out.println("Found dust for "+key+". Registering mill recipes.");
NonNullList<ItemStack> dusts = OreDictionary.getOres("dust"+key);
if (!dusts.isEmpty()) {
ItemStack oneDust = dusts.get(0).copy();
ItemStack twoDust = oneDust.copy(); twoDust.setCount(2);
//if (OreDictionary.doesOreNameExist("ore"+key) && !OreDictionary.getOres("ore"+key).isEmpty()) {
HammerMillRecipes.registerRecipe(new RotaryOreRecipe("ore"+key, twoDust, 10f, 30f));
//}
HammerMillRecipes.registerRecipe(new RotaryOreRecipe("ingot"+key, oneDust, 10f, 10f));
}
}
}
示例5: isValid
import net.minecraftforge.oredict.OreDictionary; //导入方法依赖的package包/类
public boolean isValid()
{
return isOreDictionary ? OreDictionary.doesOreNameExist(itemName) : RegistryUtil.getItemFromRegistry(itemName) != null;
}