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


Java ShapedArcaneRecipe类代码示例

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


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

示例1: replaceRecipeIngredientWithGroup

import thaumcraft.api.crafting.ShapedArcaneRecipe; //导入依赖的package包/类
/**
 * Helper function to replace a single item with a group of items in a
 * recipe.
 *
 * @param recipe
 * @param ingredient
 * @param group
 */
private void replaceRecipeIngredientWithGroup( final ShapedArcaneRecipe recipe, final ItemStack ingredient, final ArrayList<ItemStack> group )
{
	// Get the input
	Object[] input = recipe.getInput();

	// For every listed slot change the input to the group
	for( int index = 0; index < input.length; index++ )
	{
		Object slot = input[index];

		// Is this slot an itemstack?
		if( slot instanceof ItemStack )
		{
			// Does it match the stack to replace?
			if( ingredient.isItemEqual( (ItemStack)slot ) )
			{
				// Replace it
				input[index] = group;
			}
		}
	}
}
 
开发者ID:Nividica,项目名称:ThaumicEnergistics,代码行数:31,代码来源:FeatureCells.java

示例2: loadCraftingRecipes

import thaumcraft.api.crafting.ShapedArcaneRecipe; //导入依赖的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 ShapedArcaneRecipe) {
			ShapedArcaneRecipe recipe = (ShapedArcaneRecipe) recipes.get(i);
			if (ThaumcraftApiHelper.isResearchComplete(Reference.PLAYER_NAME, recipe.getResearch()) || Config.cheatMode){
				if (recipe.getRecipeOutput().isItemEqual(result)) {
					if (checkDupe(recipe)) {
						this.arecipes.add(new CachedShapedArcaneWorkbenchRecipe(recipe));
					}
				}
			}
		}
	}
}
 
开发者ID:austinv11,项目名称:Thaumic-NEI,代码行数:17,代码来源:ShapedArcaneWorkbenchHandler.java

示例3: loadUsageRecipes

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

示例4: addArcaneCraftingRecipe

import thaumcraft.api.crafting.ShapedArcaneRecipe; //导入依赖的package包/类
/**
 * @param research the research key required for this recipe to work. Leave blank if it will work without research
 * @param result the recipe output
 * @param aspects the vis cost per aspect. 
 * @param recipe The recipe. Format is exactly the same as vanilla recipes. Input itemstacks are NBT sensitive.
 */
public static ShapedArcaneRecipe addArcaneCraftingRecipe(String research, ItemStack result, AspectList aspects, Object ... recipe)
   {
	ShapedArcaneRecipe r= new ShapedArcaneRecipe(research, result, aspects, recipe);
       craftingRecipes.add(r);
	return r;
   }
 
开发者ID:Brandomine,项目名称:Augury,代码行数:13,代码来源:ThaumcraftApi.java

示例5: scan

import thaumcraft.api.crafting.ShapedArcaneRecipe; //导入依赖的package包/类
@Override
public void scan() {
    for (IRecipe recipe : (List<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
        VanillaStackWrapper stackWrapper = new VanillaStackWrapper(recipe.getRecipeOutput());
        if (recipe instanceof ShapedArcaneRecipe) {
            addRecipe(stackWrapper, new CachedRecipe(((ShapedArcaneRecipe) recipe).getInput()).setResult(new VanillaStackWrapper(recipe.getRecipeOutput())));
        } else if (recipe instanceof ShapelessArcaneRecipe) {
            addRecipe(stackWrapper, new CachedRecipe(((ShapelessArcaneRecipe) recipe).getInput()).setResult(new VanillaStackWrapper(recipe.getRecipeOutput())));
        }
    }
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:12,代码来源:ThaumcraftCraftingScanner.java

示例6: checkDupe

import thaumcraft.api.crafting.ShapedArcaneRecipe; //导入依赖的package包/类
private boolean checkDupe(ShapedArcaneRecipe recipe) {
	for (Object o : this.arecipes.toArray()){
		if (o instanceof CachedShapedArcaneWorkbenchRecipe){
			CachedShapedArcaneWorkbenchRecipe r = (CachedShapedArcaneWorkbenchRecipe) o;
			if (r.recipe.getInput() == recipe.getInput()){
				if (r.recipe.getRecipeOutput().isItemEqual(recipe.getRecipeOutput())) {
					return false;
				}
			}
		}
	}
	return true;
}
 
开发者ID:austinv11,项目名称:Thaumic-NEI,代码行数:14,代码来源:ShapedArcaneWorkbenchHandler.java

示例7: getRecipeComponents

import thaumcraft.api.crafting.ShapedArcaneRecipe; //导入依赖的package包/类
@Override
public ItemStack[] getRecipeComponents(Object recipe) {
	if (!(recipe instanceof ShapedArcaneRecipe)) { return null; }
	ShapedArcaneRecipe r = (ShapedArcaneRecipe)recipe;
	
	Object[] objects = r.getInput();
	ItemStack[] items = new ItemStack[objects.length];
	
	for (int i=0; i<objects.length; i++) {
		if (objects[i] == null) { continue; }
		items[i] = PhysisToolMaterial.getRecipeCompStack(objects[i]);
	}
	
	return items;
}
 
开发者ID:TTFTCUTS,项目名称:ShadowsOfPhysis,代码行数:16,代码来源:ShapedArcaneRecipeCT.java

示例8: registerRecipe

import thaumcraft.api.crafting.ShapedArcaneRecipe; //导入依赖的package包/类
@Override
public void registerRecipe(Object sourceRecipe, ItemStack output, Object... inputs) {
	if (!(sourceRecipe instanceof ShapedArcaneRecipe)) { return; }
	ShapedArcaneRecipe r = (ShapedArcaneRecipe)sourceRecipe;
	
	AspectList aspectList = r.getAspects().copy();
	for(Entry<Aspect, Integer> aspect : aspectList.aspects.entrySet()) {
		aspect.setValue((int)Math.round(0.4 * aspect.getValue()));
	}
	
	ThaumcraftApi.addArcaneCraftingRecipe(r.research, output, aspectList, inputs);
}
 
开发者ID:TTFTCUTS,项目名称:ShadowsOfPhysis,代码行数:13,代码来源:ShapedArcaneRecipeCT.java

示例9: initEnd

import thaumcraft.api.crafting.ShapedArcaneRecipe; //导入依赖的package包/类
@Override
public void initEnd(FMLInitializationEvent event, boolean client) {
	thaumcraftRecipeList = new RecipeListGetter() {
		@Override
		public Iterator<?> getIterator() {
			return ThaumcraftApi.getCraftingRecipes().listIterator();
		}
	};
	RecipeHelper.registerRecipeListGetter(thaumcraftRecipeList);
	RecipeHelper.addRecipeComponentTranslator(thaumcraftRecipeList, ShapedArcaneRecipe.class, new ShapedArcaneRecipeCT());
}
 
开发者ID:TTFTCUTS,项目名称:ShadowsOfPhysis,代码行数:12,代码来源:CompatThaumcraft.java

示例10: CachedShapedArcaneWorkbenchRecipe

import thaumcraft.api.crafting.ShapedArcaneRecipe; //导入依赖的package包/类
public CachedShapedArcaneWorkbenchRecipe(ShapedArcaneRecipe recipe){//Wow that's a long class name!
	this.aspects = recipe.getAspects();
	this.output = new PositionedStack(recipe.getRecipeOutput(), outCoords[0], outCoords[1]);
	this.recipe = recipe;
	Object[] input = recipe.getInput();
	int i = 0;
	for (Object inputItem : input){
		//if (inputItem != null){
			//if (inputItem instanceof ItemStack) {
		switch (i) {
			case 0:
				if (inputItem != null) {

						this.inputs.add(new PositionedStack(inputItem, inCoords[0], inCoords[0]));
				}
				break;
			case 1:
				if (inputItem != null){
						this.inputs.add(new PositionedStack(inputItem, inCoords[1], inCoords[0]));
				}
				break;
			case 2:
				if (inputItem != null){
						this.inputs.add(new PositionedStack(inputItem, inCoords[2], inCoords[0]));

				}
				break;
			case 3:
				if (inputItem != null){
						this.inputs.add(new PositionedStack(inputItem, inCoords[0], inCoords[1]));

				}
				break;
			case 4:
				if (inputItem != null){
						this.inputs.add(new PositionedStack(inputItem, inCoords[1], inCoords[1]));

				}
				break;
			case 5:
				if (inputItem != null){
						this.inputs.add(new PositionedStack(inputItem, inCoords[2], inCoords[1]));

				}
				break;
			case 6:
				if (inputItem != null){
						this.inputs.add(new PositionedStack(inputItem, inCoords[0], inCoords[2]));

				}
				break;
			case 7:
				if (inputItem != null){
						this.inputs.add(new PositionedStack(inputItem, inCoords[1], inCoords[2]));

				}
				break;
			case 8:
				if (inputItem != null){

						this.inputs.add(new PositionedStack(inputItem, inCoords[2], inCoords[2]));

				}
				break;
		}
		//	}
			i++;
		//}
	}
}
 
开发者ID:austinv11,项目名称:Thaumic-NEI,代码行数:71,代码来源:ShapedArcaneWorkbenchHandler.java

示例11: getRecipeOutput

import thaumcraft.api.crafting.ShapedArcaneRecipe; //导入依赖的package包/类
@Override
public ItemStack getRecipeOutput(Object recipe) {
	if (!(recipe instanceof ShapedArcaneRecipe)) { return null; }
	return ((ShapedArcaneRecipe)recipe).getRecipeOutput();
}
 
开发者ID:TTFTCUTS,项目名称:ShadowsOfPhysis,代码行数:6,代码来源:ShapedArcaneRecipeCT.java

示例12: addArcaneCraftingRecipe

import thaumcraft.api.crafting.ShapedArcaneRecipe; //导入依赖的package包/类
/**
 * @param research
 *        the research key required for this recipe to work. Leave blank if it will work without
 *        research
 * @param result
 *        the recipe output
 * @param aspects
 *        the vis cost per aspect.
 * @param recipe
 *        The recipe. Format is exactly the same as vanilla recipes. Input itemstacks are NBT
 *        sensitive.
 */
public static ShapedArcaneRecipe addArcaneCraftingRecipe(String research, ItemStack result, AspectList aspects, Object... recipe) {
	ShapedArcaneRecipe r = new ShapedArcaneRecipe(research, result, aspects, recipe);
	craftingRecipes.add(r);
	return r;
}
 
开发者ID:PrincessRTFM,项目名称:TweakCraft,代码行数:18,代码来源:ThaumcraftApi.java

示例13: addArcaneCraftingRecipe

import thaumcraft.api.crafting.ShapedArcaneRecipe; //导入依赖的package包/类
/**
 * @param research the research key required for this recipe to work. Leave blank if it will work without research
 * @param result the recipe output
 * @param aspects the vis cost per aspect.
 * @param recipe The recipe. Format is exactly the same as vanilla recipes. Input itemstacks are NBT sensitive.
 */
public static ShapedArcaneRecipe addArcaneCraftingRecipe(String research, ItemStack result, AspectList aspects, Object... recipe) {
    ShapedArcaneRecipe r = new ShapedArcaneRecipe(research, result, aspects, recipe);
    craftingRecipes.add(r);
    return r;
}
 
开发者ID:AgileMods,项目名称:MateriaMuto,代码行数:12,代码来源:ThaumcraftApi.java

示例14: addArcaneCraftingRecipe

import thaumcraft.api.crafting.ShapedArcaneRecipe; //导入依赖的package包/类
/**
 * @param research
 *            the research key required for this recipe to work. Leave blank
 *            if it will work without research
 * @param result
 *            the recipe output
 * @param aspects
 *            the vis cost per aspect.
 * @param recipe
 *            The recipe. Format is exactly the same as vanilla recipes.
 *            Input itemstacks are NBT sensitive.
 */
public static ShapedArcaneRecipe addArcaneCraftingRecipe(String research, ItemStack result, AspectList aspects, Object... recipe) {
	ShapedArcaneRecipe r = new ShapedArcaneRecipe(research, result, aspects, recipe);
	craftingRecipes.add(r);
	return r;
}
 
开发者ID:jaredlll08,项目名称:MysticalTrinkets,代码行数:18,代码来源:ThaumcraftApi.java


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