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


Java CrucibleRecipe类代码示例

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


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

示例1: scan

import thaumcraft.api.crafting.CrucibleRecipe; //导入依赖的package包/类
@Override
public void scan() {
    for (Object r : ThaumcraftApi.getCraftingRecipes()) {
        if (r instanceof CrucibleRecipe) {
            CrucibleRecipe crucibleRecipe = (CrucibleRecipe) r;
            ItemStack result = crucibleRecipe.getRecipeOutput();
            Object input = crucibleRecipe.catalyst;

            if (input instanceof ItemStack) {
                addCatalyst(new VanillaStackWrapper(result), (ItemStack)input);
            } else if (input instanceof List<?>) {
                addCatalyst(new VanillaStackWrapper(result), (ItemStack[]) ((List) input).toArray(new ItemStack[((List) input).size()]));
            }
        }
    }
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:17,代码来源:ThaumcraftCrucibleScanner.java

示例2: loadCraftingRecipes

import thaumcraft.api.crafting.CrucibleRecipe; //导入依赖的package包/类
@Override
public void loadCraftingRecipes(ItemStack result) {
	List recipes = ThaumcraftApi.getCraftingRecipes();
	for (int i = 0; i < recipes.size(); i++){//Sorry, no enhanced for loop here :P
		if (recipes.get(i) instanceof CrucibleRecipe) {
			CrucibleRecipe recipe = (CrucibleRecipe) recipes.get(i);
			if (ThaumcraftApiHelper.isResearchComplete(Reference.PLAYER_NAME, recipe.key) || Config.cheatMode){
				if (recipe.getRecipeOutput().isItemEqual(result)) {
					if (checkDupe(recipe)) {
						this.arecipes.add(new CachedCrucibleRecipe(recipe));
					}
				}
			}
		}
	}
}
 
开发者ID:austinv11,项目名称:Thaumic-NEI,代码行数:17,代码来源:CrucibleHandler.java

示例3: getCrucibleRecipe

import thaumcraft.api.crafting.CrucibleRecipe; //导入依赖的package包/类
/**
 * @param stack
 *        the recipe result
 * @return the recipe
 */
public static CrucibleRecipe getCrucibleRecipe(ItemStack stack) {
	for (Object r : getCraftingRecipes()) {
		if (r instanceof CrucibleRecipe) {
			if ( ((CrucibleRecipe) r).getRecipeOutput().isItemEqual(stack)) {
				return (CrucibleRecipe) r;
			}
		}
	}
	return null;
}
 
开发者ID:PrincessRTFM,项目名称:TweakCraft,代码行数:16,代码来源:ThaumcraftApi.java

示例4: getCrucibleRecipeFromHash

import thaumcraft.api.crafting.CrucibleRecipe; //导入依赖的package包/类
/**
 * @param hash
 *        the unique recipe code
 * @return the recipe
 */
public static CrucibleRecipe getCrucibleRecipeFromHash(int hash) {
	for (Object r : getCraftingRecipes()) {
		if (r instanceof CrucibleRecipe) {
			if ( ((CrucibleRecipe) r).hash == hash) {
				return (CrucibleRecipe) r;
			}
		}
	}
	return null;
}
 
开发者ID:PrincessRTFM,项目名称:TweakCraft,代码行数:16,代码来源:ThaumcraftApi.java

示例5: getCrucibleRecipe

import thaumcraft.api.crafting.CrucibleRecipe; //导入依赖的package包/类
/**
 * @param stack the recipe result
 * @return the recipe
 */
public static CrucibleRecipe getCrucibleRecipe(ItemStack stack) {
	for (Object r:getCraftingRecipes()) {
		if (r instanceof CrucibleRecipe) {
			if (((CrucibleRecipe)r).getRecipeOutput().isItemEqual(stack))
				return (CrucibleRecipe)r;
		}
	}
	return null;
}
 
开发者ID:Brandomine,项目名称:Augury,代码行数:14,代码来源:ThaumcraftApi.java

示例6: getCrucibleRecipeFromHash

import thaumcraft.api.crafting.CrucibleRecipe; //导入依赖的package包/类
/**
 * @param hash the unique recipe code
 * @return the recipe
 */
public static CrucibleRecipe getCrucibleRecipeFromHash(int hash) {
	for (Object r:getCraftingRecipes()) {
		if (r instanceof CrucibleRecipe) {
			if (((CrucibleRecipe)r).hash==hash)
				return (CrucibleRecipe)r;
		}
	}
	return null;
}
 
开发者ID:Brandomine,项目名称:Augury,代码行数:14,代码来源:ThaumcraftApi.java

示例7: getCraftingRecipeKey

import thaumcraft.api.crafting.CrucibleRecipe; //导入依赖的package包/类
public static Object[] getCraftingRecipeKey(EntityPlayer player, ItemStack stack) {
	int[] key = new int[] {Item.getIdFromItem(stack.getItem()),stack.getItemDamage()};
	if (keyCache.containsKey(key)) {
		if (keyCache.get(key)==null) return null;
		if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), (String)(keyCache.get(key))[0]))
			return keyCache.get(key);
		else 
			return null;
	}
	for (ResearchCategoryList rcl:ResearchCategories.researchCategories.values()) {
		for (ResearchItem ri:rcl.research.values()) {
			if (ri.getPages()==null) continue;
			for (int a=0;a<ri.getPages().length;a++) {
				ResearchPage page = ri.getPages()[a];
				if (page.recipe!=null && page.recipe instanceof CrucibleRecipe[]) {
					CrucibleRecipe[] crs = (CrucibleRecipe[]) page.recipe;
					for (CrucibleRecipe cr:crs) {
						if (cr.getRecipeOutput().isItemEqual(stack)) {
							keyCache.put(key,new Object[] {ri.key,a});
							if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), ri.key))
								return new Object[] {ri.key,a};
						}
					}
				} else
				if (page.recipeOutput!=null && stack !=null && page.recipeOutput.isItemEqual(stack)) {
					keyCache.put(key,new Object[] {ri.key,a});
					if (ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), ri.key))
						return new Object[] {ri.key,a};
					else 
						return null;
				}
			}
		}
	}
	keyCache.put(key,null);
	return null;
}
 
开发者ID:Brandomine,项目名称:Augury,代码行数:38,代码来源:ThaumcraftApi.java

示例8: ResearchPage

import thaumcraft.api.crafting.CrucibleRecipe; //导入依赖的package包/类
/**
 * @param recipe an alchemy crafting recipe.
 */
public ResearchPage(CrucibleRecipe recipe)
{
    this.type = PageType.CRUCIBLE_CRAFTING;
    this.recipe = recipe;
    this.recipeOutput = recipe.getRecipeOutput();
}
 
开发者ID:J3FF97,项目名称:Steel-Industries,代码行数:10,代码来源:ResearchPage.java

示例9: getCrucibleRecipe

import thaumcraft.api.crafting.CrucibleRecipe; //导入依赖的package包/类
/**
 * @param stack the recipe result
 * @return the recipe
 */
public static CrucibleRecipe getCrucibleRecipe(ItemStack stack) {
    for (Object r : getCraftingRecipes()) {
        if (r instanceof CrucibleRecipe) {
            if (((CrucibleRecipe) r).getRecipeOutput().isItemEqual(stack)) {
                return (CrucibleRecipe) r;
            }
        }
    }
    return null;
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:15,代码来源:ThaumcraftApi.java

示例10: getCrucibleRecipeFromHash

import thaumcraft.api.crafting.CrucibleRecipe; //导入依赖的package包/类
/**
 * @param hash the unique recipe code
 * @return the recipe
 */
public static CrucibleRecipe getCrucibleRecipeFromHash(int hash) {
    for (Object r : getCraftingRecipes()) {
        if (r instanceof CrucibleRecipe) {
            if (((CrucibleRecipe) r).hash == hash) {
                return (CrucibleRecipe) r;
            }
        }
    }
    return null;
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:15,代码来源:ThaumcraftApi.java


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