本文整理匯總了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;
}