Package net.minecraft.item.crafting

Examples of net.minecraft.item.crafting.ShapedRecipes


    ingredients = RecipeUtils.ingredients(
        Item.ingotIron, Item.ingotIron, null,
        Item.ingotIron, Block.workbench, chip,
        null, null, null
    );
    GameRegistry.addRecipe( new ShapedRecipes( 3, 2, ingredients, new ItemStack( itemCraftPad ) ) );

    // Machines
    for( Machines machine : Machines.values() ) {
      GameRegistry.addRecipe( machine.getMachineRecipe() );
    }
View Full Code Here


  }

  @SideOnly(Side.CLIENT)
  public void renderCraftingRecipe(IGuiLexiconEntry gui, IRecipe recipe) {
    if(recipe instanceof ShapedRecipes) {
      ShapedRecipes shaped = (ShapedRecipes)recipe;

      for(int y = 0; y < shaped.recipeHeight; y++)
        for(int x = 0; x < shaped.recipeWidth; x++)
          renderItemAtGridPos(gui, 1 + x, 1 + y, shaped.recipeItems[y * shaped.recipeWidth + x], true);
    } else if(recipe instanceof ShapedOreRecipe) {
      ShapedOreRecipe shaped = (ShapedOreRecipe) recipe;
      int width = (Integer) ReflectionHelper.getPrivateValue(ShapedOreRecipe.class, shaped, 4);
      int height = (Integer) ReflectionHelper.getPrivateValue(ShapedOreRecipe.class, shaped, 5);

      for(int y = 0; y < height; y++)
        for(int x = 0; x < width; x++) {
          Object input = shaped.getInput()[y * width + x];
          if(input != null)
            renderItemAtGridPos(gui, 1 + x, 1 + y, input instanceof ItemStack ? (ItemStack) input : ((ArrayList<ItemStack>) input).get(0), true);
        }

      oreDictRecipe = true;
View Full Code Here

       Object[] array = new Object[11];
       IRecipe rec = CompressorRecipes.getRecipeList().get(i);

       if (rec instanceof ShapedRecipes)
       {
         ShapedRecipes recipe = (ShapedRecipes) rec;

         for (int j = 0; j < recipe.recipeItems.length; j++)
         {
           ItemStack stack = recipe.recipeItems[j];

           array[j] = stack.copy();
         }
         array[9] = recipe.getRecipeOutput().copy();
       }
       else if (rec instanceof ShapelessOreRecipe)
       {
         ShapelessOreRecipe recipe = (ShapelessOreRecipe) rec;

         for (int j = 0; j < recipe.getInput().size(); j++)
         {
           Object obj = recipe.getInput().get(j);

           if (obj instanceof ItemStack) array[j] = ((ItemStack)obj).copy();
           else if (obj instanceof String) array[j] = OreDictionary.getOres((String)obj).clone();
           else if (obj instanceof ArrayList) array[j] = ((ArrayList)obj).clone();
         }
         array[9] = recipe.getRecipeOutput().copy();
       }

       array[10] = machine;
       generator.addRecipe(template, array);
     }
View Full Code Here

            HashMap<Integer, PositionedStack> input1 = new HashMap<Integer, PositionedStack>();
            IRecipe rec = CompressorRecipes.getRecipeList().get(i);

            if (rec instanceof ShapedRecipes)
            {
                ShapedRecipes recipe = (ShapedRecipes) rec;

                for (int j = 0; j < recipe.recipeItems.length; j++)
                {
                    ItemStack stack = recipe.recipeItems[j];

                    input1.put(j, new PositionedStack(stack, 21 + j % 3 * 18, 26 + j / 3 * 18));
                }
            }
            else if (rec instanceof ShapelessOreRecipe)
            {
                ShapelessOreRecipe recipe = (ShapelessOreRecipe) rec;

                for (int j = 0; j < recipe.getInput().size(); j++)
                {
                    Object obj = recipe.getInput().get(j);

                    input1.put(j, new PositionedStack(obj, 21 + j % 3 * 18, 26 + j / 3 * 18));
                }
            }

View Full Code Here

            {
                aitemstack[i1] = null;
            }
        }

        ShapedRecipes shapedrecipes = new ShapedRecipes(j, k, aitemstack, output);
        CompressorRecipes.recipes.add(shapedrecipes);
        return shapedrecipes;
    }
View Full Code Here

            {
                var15[var16] = null;
            }
        }

        ShapedRecipes var17 = new ShapedRecipes(var5, var6, var15, itemstack);
        recipeList.add(0, var17);
    }
View Full Code Here

        // Search vanilla recipes for recipes to replace
        for(Object obj : recipes)
        {
            if(obj instanceof ShapedRecipes)
            {
                ShapedRecipes recipe = (ShapedRecipes)obj;
                ItemStack output = recipe.getRecipeOutput();
                if (output != null && containsMatch(false, exclusions, output))
                {
                    continue;
                }

                if(containsMatch(true, recipe.recipeItems, replaceStacks))
                {
                    recipesToRemove.add(recipe);
                    recipesToAdd.add(new ShapedOreRecipe(recipe, replacements));
                }
            }
            else if(obj instanceof ShapelessRecipes)
            {
                ShapelessRecipes recipe = (ShapelessRecipes)obj;
                ItemStack output = recipe.getRecipeOutput();
                if (output != null && containsMatch(false, exclusions, output))
                {
                    continue;
                }
View Full Code Here

            } else {
                recipeArray[i1] = null;
            }
        }

        recipes.add(new ShapedRecipes(j, k, recipeArray, output));
    }
View Full Code Here

    {
        ArrayList<WrappedStack> recipeInputs = new ArrayList<WrappedStack>();

        if (recipe instanceof ShapedRecipes)
        {
            ShapedRecipes shapedRecipe = (ShapedRecipes) recipe;

            for (int i = 0; i < shapedRecipe.recipeItems.length; i++)
            {
                if (shapedRecipe.recipeItems[i] instanceof ItemStack)
                {
View Full Code Here

     */
    public static void addPressureChamberStorageBlockRecipes(){
        List<IRecipe> recipes = CraftingManager.getInstance().getRecipeList();
        for(IRecipe recipe : recipes) {
            if(recipe instanceof ShapedRecipes) {
                ShapedRecipes shaped = (ShapedRecipes)recipe;
                ItemStack[] input = shaped.recipeItems;
                ItemStack ref = input[0];
                if(ref == null || input.length < 9) continue;
                boolean valid = true;
                for(int i = 0; i < 9; i++) {
                    if(input[i] == null || !input[i].isItemEqual(ref)) {
                        valid = false;
                        break;
                    }
                }
                if(valid) {
                    ItemStack inputStack = ref.copy();
                    inputStack.stackSize = 9;
                    PressureChamberRecipe.chamberRecipes.add(new PressureChamberRecipe(new ItemStack[]{inputStack}, 1.0F, new ItemStack[]{shaped.getRecipeOutput()}, false));

                    ItemStack inputStack2 = shaped.getRecipeOutput().copy();
                    inputStack2.stackSize = 1;
                    PressureChamberRecipe.chamberRecipes.add(new PressureChamberRecipe(new ItemStack[]{inputStack2}, -0.5F, new ItemStack[]{inputStack}, false));

                }
            }
View Full Code Here

TOP

Related Classes of net.minecraft.item.crafting.ShapedRecipes

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.