当前位置: 首页>>代码示例>>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;未经允许,请勿转载。