当前位置: 首页>>代码示例>>Java>>正文


Java IOreDictEntry类代码示例

本文整理汇总了Java中minetweaker.api.oredict.IOreDictEntry的典型用法代码示例。如果您正苦于以下问题:Java IOreDictEntry类的具体用法?Java IOreDictEntry怎么用?Java IOreDictEntry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


IOreDictEntry类属于minetweaker.api.oredict包,在下文中一共展示了IOreDictEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getGreggedItem

import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@ZenGetter("greggedItem")
public static IItemStack getGreggedItem(IOreDictEntry oreDictEntry) {
       List<IItemStack> matchedItems = new ArrayList<IItemStack>();
       
       for (IItemStack item : oreDictEntry.getItems()) {
           //TODO: how to determine GT's items better?
           if (item.getDefinition().getId().startsWith(MOD_ID)) {
               matchedItems.add(item);
           }
       }
       
       if (matchedItems.size() > 1) {
           MineTweakerAPI.logError("An ore dictionary <ore:" + oreDictEntry.getName() + "> has multiple items owned by GregTech");
       } else if (matchedItems.size() == 0) {
           MineTweakerAPI.logError("An ore dictionary <ore:" + oreDictEntry.getName() + "> has not items owned by GregTech");
           return null;
       }
       
       return matchedItems.get(0); //there can be only one
}
 
开发者ID:GTNewHorizons,项目名称:Minetweaker-Gregtech-5-Addon,代码行数:21,代码来源:OreDictEntryExpansion.java

示例2: convertIngredients

import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
private static OreRecipeElement[][] convertIngredients(IIngredient[][] inputs)
{
	OreRecipeElement[][] convertedIngredients = new OreRecipeElement[3][3];
	for(int row = 0; row < 3; row++)
	{
		for(int col = 0; col < 3; col++)
		{
			IIngredient ingredient = inputs[row][col];
			
			if(ingredient instanceof IOreDictEntry)
			{
				convertedIngredients[row][col] = new OreRecipeElement(((IOreDictEntry) ingredient).getName(), ingredient.getAmount());
			}
			else if(ingredient instanceof IngredientOreDict)
			{
				convertedIngredients[row][col] = new OreRecipeElement((String) ingredient.getInternal(), ingredient.getAmount());
			}
			else if(ingredient instanceof IItemStack)
			{
				convertedIngredients[row][col] = new OreRecipeElement(MineTweakerMC.getItemStack(ingredient));
			}
		}
	}
	return convertedIngredients;
}
 
开发者ID:einsteinsci,项目名称:betterbeginnings-MC1.7,代码行数:26,代码来源:AdvancedCraftingTweaker.java

示例3: convertCatalysts

import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
private static OreRecipeElement[] convertCatalysts(IIngredient[] catalysts)
{
	OreRecipeElement[] convertedCatalysts = new OreRecipeElement[catalysts.length];
	for(int i = 0; i < catalysts.length; i++)
	{
		IIngredient ingredient = catalysts[i];
		if(ingredient instanceof IOreDictEntry)
		{
			convertedCatalysts[i] = new OreRecipeElement(((IOreDictEntry) ingredient).getName(), ingredient.getAmount());
		}
		else if(ingredient instanceof IItemStack)
		{
			convertedCatalysts[i] = new OreRecipeElement(MineTweakerMC.getItemStack(ingredient));
		}
		else if (ingredient instanceof IngredientStack)
		{
			ItemStack[] validItems = MineTweakerMC.getItemStacks(ingredient.getItems());
			for(ItemStack stack : validItems)
			{
				stack.stackSize = ingredient.getAmount();
			}
			convertedCatalysts[i] = new OreRecipeElement(validItems, ingredient.getAmount());
		}
	}
	return convertedCatalysts;
}
 
开发者ID:einsteinsci,项目名称:betterbeginnings-MC1.7,代码行数:27,代码来源:AdvancedCraftingTweaker.java

示例4: convertShapedIngredients

import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
private static OreRecipeElement[][] convertShapedIngredients(IIngredient[][] inputs)
{
	OreRecipeElement[][] convertedIngredients = new OreRecipeElement[3][3];
	for(int row = 0; row < 3; row++)
	{
		for(int col = 0; col < 3; col++)
		{
			IIngredient ingredient = inputs[row][col];
			if(ingredient instanceof IOreDictEntry)
			{
				convertedIngredients[row][col] = new OreRecipeElement(((IOreDictEntry) ingredient).getName(), 1);
			}
			else if(ingredient instanceof IItemStack)
			{
				convertedIngredients[row][col] = new OreRecipeElement(MineTweakerMC.getItemStack(ingredient));
			}
		}
	}
	return convertedIngredients;
}
 
开发者ID:einsteinsci,项目名称:betterbeginnings-MC1.7,代码行数:21,代码来源:OvenTweaker.java

示例5: convertShapelessIngredients

import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
private static OreRecipeElement[] convertShapelessIngredients(IIngredient[] inputs)
{	
	OreRecipeElement[] convertedIngredients = new OreRecipeElement[inputs.length];
	for(int i = 0; i < inputs.length; i++)
	{
		IIngredient ingredient = inputs[i];
		if(ingredient instanceof IOreDictEntry)
		{
			convertedIngredients[i] = new OreRecipeElement(((IOreDictEntry) ingredient).getName(), 1);
		}
		else if(ingredient instanceof IItemStack)
		{
			convertedIngredients[i] = new OreRecipeElement(MineTweakerMC.getItemStack(ingredient));
		}
	}
	return convertedIngredients;
}
 
开发者ID:einsteinsci,项目名称:betterbeginnings-MC1.7,代码行数:18,代码来源:OvenTweaker.java

示例6: apply

import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@Override
public void apply() 
{
	if(input instanceof IOreDictEntry)
	{
		inputAsORE = new OreRecipeElement(((IOreDictEntry) input).getName(), 1);
		KilnRecipes.getSmeltingList().put(inputAsORE, output);
		KilnRecipes.getXPList().put(output, xp);
	}
	else
	{
		inputAsORE = new OreRecipeElement(MineTweakerMC.getItemStack(input));
		KilnRecipes.getSmeltingList().put(inputAsORE, output);
		KilnRecipes.getXPList().put(output, xp);
	}
}
 
开发者ID:einsteinsci,项目名称:betterbeginnings-MC1.7,代码行数:17,代码来源:KilnTweaker.java

示例7: undo

import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@Override
public void undo() 
{
	if(input instanceof IOreDictEntry)
	{
		inputAsORE = new OreRecipeElement(((IOreDictEntry) input).getName(), 1);
		KilnRecipes.getSmeltingList().put(inputAsORE, output);
		KilnRecipes.getXPList().put(output, xp);
	}
	else
	{
		inputAsORE = new OreRecipeElement(MineTweakerMC.getItemStack(input));
		KilnRecipes.getSmeltingList().put(inputAsORE, output);
		KilnRecipes.getXPList().put(output, xp);
	}
}
 
开发者ID:einsteinsci,项目名称:betterbeginnings-MC1.7,代码行数:17,代码来源:KilnTweaker.java

示例8: toObject

import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
public static Object toObject(IIngredient iStack) {
    if (iStack == null)
        return null;
    else {
        if (iStack instanceof IOreDictEntry) {
            return toString((IOreDictEntry) iStack);
        } else if (iStack instanceof IItemStack) {
            return toStack((IItemStack) iStack);
        } else if (iStack instanceof MatchTypeEntry) {
            return (MatchType) iStack.getInternal();
        } else if (iStack instanceof MaterialEntry) {
            return (MaterialInfo) iStack.getInternal();
        } else
            return null;
    }
}
 
开发者ID:GoryMoon,项目名称:MoarSigns,代码行数:17,代码来源:Signs.java

示例9: addRecipe

import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@ZenMethod
   public static void addRecipe(IItemStack output, IOreDictEntry oredictentry, double heat, double specHeat) 
{
       if (oredictentry != null && oredictentry.getAmount() > 0)
       {
       	List<IItemStack> oreEntries = oredictentry.getItems();
       	for(int i = 0; i < oreEntries.size(); i++)
       	{
       		addRecipe(output, oreEntries.get(i), heat, specHeat);
       	}
       }
   }
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:13,代码来源:ItemHeat.java

示例10: toObject

import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
public static Object toObject(IIngredient iStack, boolean trim) {
    if (iStack == null) return null;
    else {
        if (iStack instanceof IOreDictEntry) {
            return toString((IOreDictEntry) iStack);
        } else if (iStack instanceof IItemStack) {
            return toStack((IItemStack) iStack, trim);
        } else return null;
    }
}
 
开发者ID:Belgabor,项目名称:ExtraTweaker,代码行数:11,代码来源:InputHelper.java

示例11: toObject

import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
public static Object toObject(IIngredient iStack) {
	if (iStack == null)
		return null;
	if (iStack instanceof IOreDictEntry)
		return ((IOreDictEntry) iStack).getName();
	if (iStack instanceof IItemStack)
		return toStack((IItemStack) iStack);
	if (iStack instanceof IngredientStack) {
		IIngredient ingr = ReflectionHelper.getPrivateValue(IngredientStack.class, (IngredientStack) iStack, "ingredient");
		return toObject(ingr);
	}
	return null;
}
 
开发者ID:TeamWizardry,项目名称:TMT-Refraction,代码行数:14,代码来源:MTRefractionPlugin.java

示例12: describe

import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@Override
public String describe() 
{
	String inputIDString = (input instanceof IOreDictEntry) ? ((IOreDictEntry) input).getName() : MineTweakerMC.getItemStack(input).getDisplayName();
	return "Adding recipe " + inputIDString 
			+ " -> " + output.getDisplayName() + " * "  + output.stackSize + " to Smelter";
}
 
开发者ID:einsteinsci,项目名称:betterbeginnings-MC1.7,代码行数:8,代码来源:SmelterTweaker.java

示例13: describeUndo

import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@Override
public String describeUndo() 
{
	String inputIDString = (input instanceof IOreDictEntry) ? ((IOreDictEntry) input).getName() : MineTweakerMC.getItemStack(input).getDisplayName();
	return "Removing recipe " + inputIDString 
			+ " -> " + output.getDisplayName() + " * "  + output.stackSize + " from Smelter";
}
 
开发者ID:einsteinsci,项目名称:betterbeginnings-MC1.7,代码行数:8,代码来源:SmelterTweaker.java

示例14: apply

import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@Override
public void apply() 
{
	if(isPanRecipe)
	{
		if(input instanceof IOreDictEntry)
		{
			inputAsORE = new OreRecipeElement(((IOreDictEntry) input).getName(), 1);
			CampfirePanRecipes.getSmeltingList().put(inputAsORE, output);
			CampfirePanRecipes.getXPList().put(output, xp);
		}
		else if(input instanceof IIngredient)
		{
			inputAsORE = new OreRecipeElement(MineTweakerMC.getItemStack(input));
			CampfirePanRecipes.getSmeltingList().put(inputAsORE, output);
			CampfirePanRecipes.getXPList().put(output, xp);
		}
	}
	else
	{
		if(input instanceof IOreDictEntry)
		{
			inputAsORE = new OreRecipeElement(((IOreDictEntry) input).getName(), 1);
			CampfireRecipes.getSmeltingList().put(inputAsORE, output);
			CampfireRecipes.getXPList().put(output, xp);
		}
		else if(input instanceof IIngredient)
		{
			inputAsORE = new OreRecipeElement(MineTweakerMC.getItemStack(input));
			CampfireRecipes.getSmeltingList().put(inputAsORE, output);
			CampfireRecipes.getXPList().put(output, xp);
		}
	}
}
 
开发者ID:einsteinsci,项目名称:betterbeginnings-MC1.7,代码行数:35,代码来源:CampfireTweaker.java

示例15: describe

import minetweaker.api.oredict.IOreDictEntry; //导入依赖的package包/类
@Override
public String describe() 
{
	String inputIDString = (input instanceof IOreDictEntry) ? ((IOreDictEntry) input).getName() : MineTweakerMC.getItemStack(input).getDisplayName();
	return "Adding recipe " + inputIDString 
			+ " -> " + output.getDisplayName() + " * "  + output.stackSize + " to Campfire";
}
 
开发者ID:einsteinsci,项目名称:betterbeginnings-MC1.7,代码行数:8,代码来源:CampfireTweaker.java


注:本文中的minetweaker.api.oredict.IOreDictEntry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。