Package pneumaticCraft.common.recipes.programs

Examples of pneumaticCraft.common.recipes.programs.AssemblyProgram


            referencePrograms = new AssemblyProgram[PROGRAMS_AMOUNT];
            for(int i = 0; i < PROGRAMS_AMOUNT; i++) {
                referencePrograms[i] = getProgramFromItem(i);
            }
        }
        AssemblyProgram program = referencePrograms[Math.min(stack.getItemDamage(), PROGRAMS_AMOUNT - 1)];
        AssemblyProgram.EnumMachine[] requiredMachines = program.getRequiredMachines();
        for(AssemblyProgram.EnumMachine machine : requiredMachines) {
            switch(machine){
                case PLATFORM:
                    infoList.add("-" + Blockss.assemblyPlatform.getLocalizedName());
                    break;
View Full Code Here


    @Override
    public void loadCraftingRecipes(String outputId, Object... results){
        if(outputId.equals(getRecipesID())) {
            for(int i = 0; i < ItemAssemblyProgram.PROGRAMS_AMOUNT; i++) {
                AssemblyProgram program = ItemAssemblyProgram.getProgramFromItem(i);
                for(int j = 0; j < program.getRecipeList().size(); j++)
                    arecipes.add(getShape(i, j));
            }
        } else super.loadCraftingRecipes(outputId, results);
    }
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));
        ItemStack[] requiredMachines = getMachinesFromEnum(program.getRequiredMachines());
        for(int i = 0; i < requiredMachines.length; i++) {
            shape.addIngredient(new PositionedStack(requiredMachines[i], 5 + i * 18, 25));
        }

        return shape;
View Full Code Here

    }

    @Override
    public void loadCraftingRecipes(ItemStack result){
        for(int i = 0; i < ItemAssemblyProgram.PROGRAMS_AMOUNT; i++) {
            AssemblyProgram program = ItemAssemblyProgram.getProgramFromItem(i);
            for(int j = 0; j < program.getRecipeList().size(); j++) {
                if(NEIClientUtils.areStacksSameTypeCrafting(program.getRecipeList().get(j).getOutput(), result)) {
                    arecipes.add(getShape(i, j));
                    break;
                }
            }
        }
View Full Code Here

    }

    @Override
    public void loadUsageRecipes(ItemStack ingredient){
        for(int i = 0; i < ItemAssemblyProgram.PROGRAMS_AMOUNT; i++) {
            AssemblyProgram program = ItemAssemblyProgram.getProgramFromItem(i);
            boolean[] addedRecipe = new boolean[program.getRecipeList().size()];
            for(int j = 0; j < program.getRecipeList().size(); j++) {
                if(NEIClientUtils.areStacksSameTypeCrafting(program.getRecipeList().get(j).getInput(), ingredient)) {
                    arecipes.add(getShape(i, j));
                    addedRecipe[j] = true;
                }
            }
            if(ingredient.getItem() == Itemss.assemblyProgram && ingredient.getItemDamage() == i) {
                for(int j = 0; j < program.getRecipeList().size(); j++)
                    if(!addedRecipe[j]) arecipes.add(getShape(i, j));
            } else {
                for(ItemStack machine : getMachinesFromEnum(program.getRequiredMachines())) {
                    if(NEIClientUtils.areStacksSameTypeCrafting(machine, ingredient)) {
                        for(int j = 0; j < program.getRecipeList().size(); j++)
                            if(!addedRecipe[j]) arecipes.add(getShape(i, j));
                        break;
                    }
                }
            }
View Full Code Here

            oldDisplayedText = displayedText;
            if(firstRun) {
                updateConnections();
            }
            if(curProgram == null && !goingToHomePosition && inventory[PROGRAM_INVENTORY_INDEX] != null && inventory[PROGRAM_INVENTORY_INDEX].getItem() == Itemss.assemblyProgram) {
                AssemblyProgram program = ItemAssemblyProgram.getProgramFromItem(inventory[PROGRAM_INVENTORY_INDEX].getItemDamage());
                curProgram = program;
            } else if(curProgram != null && (inventory[PROGRAM_INVENTORY_INDEX] == null || curProgram.getClass() != ItemAssemblyProgram.getProgramFromItem(inventory[PROGRAM_INVENTORY_INDEX].getItemDamage()).getClass())) {
                curProgram = null;
                goingToHomePosition = true;
            }
View Full Code Here

TOP

Related Classes of pneumaticCraft.common.recipes.programs.AssemblyProgram

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.