Package pneumaticCraft.api.recipe

Examples of pneumaticCraft.api.recipe.AssemblyRecipe


        for(AssemblyRecipe firstRecipe : firstRecipeList) {
            for(AssemblyRecipe secondRecipe : secondRecipeList) {
                if(firstRecipe.getOutput().isItemEqual(secondRecipe.getInput()) && firstRecipe.getOutput().stackSize % secondRecipe.getInput().stackSize == 0 && secondRecipe.getOutput().getMaxStackSize() >= secondRecipe.getOutput().stackSize * (firstRecipe.getOutput().stackSize / secondRecipe.getInput().stackSize)) {
                    ItemStack output = secondRecipe.getOutput().copy();
                    output.stackSize = output.stackSize * (firstRecipe.getOutput().stackSize / secondRecipe.getInput().stackSize);
                    totalRecipeList.add(new AssemblyRecipe(firstRecipe.getInput(), output));
                }
            }
        }
    }
View Full Code Here


        } else super.loadCraftingRecipes(outputId, results);
    }

    protected MultipleInputOutputRecipe getShape(int programMetadata, int recipeIndex){
        AssemblyProgram program = ItemAssemblyProgram.getProgramFromItem(programMetadata);
        AssemblyRecipe recipe = program.getRecipeList().get(recipeIndex);
        MultipleInputOutputRecipe shape = new MultipleInputOutputRecipe();
        ItemStack[] inputStacks = new ItemStack[]{recipe.getInput()};//for now not useful to put it in an array, but supports when adding multiple input/output.
        for(int i = 0; i < inputStacks.length; i++) {
            PositionedStack stack = new PositionedStack(inputStacks[i], 29 + i % 2 * 18, 66 + i / 2 * 18);
            shape.addIngredient(stack);
        }

        ItemStack[] outputStacks = new ItemStack[]{recipe.getOutput()};
        for(int i = 0; i < outputStacks.length; i++) {
            PositionedStack stack = new PositionedStack(outputStacks[i], 96 + i % 2 * 18, 66 + i / 2 * 18);
            shape.addOutput(stack);
        }
        shape.addIngredient(new PositionedStack(new ItemStack(Itemss.assemblyProgram, 1, programMetadata), 133, 22));
View Full Code Here

            }
        }

        int[] hits = new int[]{recipeIndex};
        int program = ItemAssemblyProgram.DRILL_LASER_DAMAGE;
        AssemblyRecipe foundRecipe = findRecipe(hits, AssemblyRecipe.drillRecipes, arguments[2]);
        if(foundRecipe == null) {
            foundRecipe = findRecipe(hits, AssemblyRecipe.laserRecipes, arguments[2]);
        } else {
            program = ItemAssemblyProgram.DRILL_DAMAGE;
        }

        if(foundRecipe == null) {
            foundRecipe = findRecipe(hits, AssemblyRecipe.drillLaserRecipes, arguments[2]);
        } else {
            program = ItemAssemblyProgram.LASER_DAMAGE;
        }

        if(foundRecipe == null) throw new IllegalArgumentException("No recipe found for the string " + arguments[2] + " and the requested index " + recipeIndex + ".");

        locatedStacks.add(new LocatedStack(foundRecipe.getInput(), (int)(GuiWiki.TEXT_SCALE * x) + 1, (int)(GuiWiki.TEXT_SCALE * y) + 46));
        locatedStacks.add(new LocatedStack(foundRecipe.getOutput(), (int)(GuiWiki.TEXT_SCALE * x) + 68, (int)(GuiWiki.TEXT_SCALE * y) + 46));
        locatedStacks.add(new LocatedStack(new ItemStack(Itemss.assemblyProgram, 1, program), (int)(GuiWiki.TEXT_SCALE * x) + 78, (int)(GuiWiki.TEXT_SCALE * y) + 15));

        locatedStrings.add(new LocatedString("Program:", x + 150, y + 5, 0xFF000000, false));
        locatedStrings.add(new LocatedString("Assembly Line", x + 40, y + 30, 0xFF000000, false));
    }
View Full Code Here

TOP

Related Classes of pneumaticCraft.api.recipe.AssemblyRecipe

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.