當前位置: 首頁>>代碼示例>>Java>>正文


Java OreDictionary.doesOreNameExist方法代碼示例

本文整理匯總了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);
				}
			}
		}
	}
}
 
開發者ID:the-realest-stu,項目名稱:Adventurers-Toolbox,代碼行數:14,代碼來源:ModMaterials.java

示例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;
}
 
開發者ID:elytra,項目名稱:Thermionics,代碼行數:11,代碼來源:ToolHelper.java

示例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);
}
 
開發者ID:elytra,項目名稱:Thermionics,代碼行數:12,代碼來源:OreItems.java

示例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));
		}
	}
}
 
開發者ID:elytra,項目名稱:Thermionics,代碼行數:15,代碼來源:ThermionicsRecipes.java

示例5: isValid

import net.minecraftforge.oredict.OreDictionary; //導入方法依賴的package包/類
public boolean isValid()
{
    return isOreDictionary ? OreDictionary.doesOreNameExist(itemName) : RegistryUtil.getItemFromRegistry(itemName) != null; 
}
 
開發者ID:einsteinsci,項目名稱:BetterBeginningsReborn,代碼行數:5,代碼來源:JsonLoadedItem.java


注:本文中的net.minecraftforge.oredict.OreDictionary.doesOreNameExist方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。