本文整理汇总了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()]));
}
}
}
}
示例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));
}
}
}
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}