Package net.minecraft.item.crafting

Examples of net.minecraft.item.crafting.IRecipe


      int var9 = var13 + var8 + theItem.getMaxDamage() * 5 / 100;
      int var10 = Math.max(0, theItem.getMaxDamage() - var9);

      return new ItemStack(dmgItems[0].getItem(), 1, var10);
    } else {
      IRecipe recipe;
      for (int i = 0; i < CraftingManager.getInstance().getRecipeList().size(); i++) {
        recipe = (IRecipe) CraftingManager.getInstance().getRecipeList().get(i);

        if (recipe.matches(inv, world)) {
          return recipe.getCraftingResult(inv);
        }
      }
      return null;
    }
  }
View Full Code Here


public class RecipeUtils {


  public static boolean matchesIngredient(CraftRecipe recipe, int ingredientIndex, ItemStack otherStack, World world) {
    try {
      IRecipe iRecipe = recipe.getRecipePointer().getIRecipe();

      InventoryCrafting craftingGrid = simulateGrid( recipe, ingredientIndex, otherStack );

      if( !iRecipe.matches( craftingGrid, world ) )
        return false;

      ItemStack nominalResult = recipe.getResult();
      ItemStack realResult = iRecipe.getCraftingResult( craftingGrid );

      return InventoryUtils.similarStacks( nominalResult, realResult, nominalResult.hasTagCompound() );
    } catch( NullPointerException npe ) {
      return false;
    }
View Full Code Here

  public static RecipePointer getRecipeFrom(InventoryCrafting gridInv, World world) {
    ArrayList recipeList = (ArrayList) CraftingManager.getInstance().getRecipeList();

    for( int i = 0; i < recipeList.size(); i++ ) {
      IRecipe currentRecipe = (IRecipe) recipeList.get( i );
      if( currentRecipe.matches( gridInv, world ) )
        return RecipePointer.getRecipe( i );
    }
    return null;
  }
View Full Code Here

      //travel staff
      ItemStack travelStaff = new ItemStack(EnderIO.itemTravelStaff);
      EnderIO.itemTravelStaff.setEnergy(travelStaff, 0);
      ItemStack endCry = new ItemStack(EnderIO.itemMaterial, 1, Material.ENDER_CRYSTAL.ordinal());
      ItemStack darkSteel = new ItemStack(EnderIO.itemAlloy, 1, Alloy.DARK_STEEL.ordinal());
      IRecipe rec = GameRegistry
          .addShapedRecipe(travelStaff, "  e", " s ", "s  ", 's', darkSteel, 'c', enderCapacitor, 'e', endCry);
           
    }
  }
View Full Code Here

  @Override
  @SideOnly(Side.CLIENT)
  public void renderRecipe(IGuiLexiconEntry gui, int mx, int my) {
    oreDictRecipe = shapelessRecipe = false;

    IRecipe recipe = recipes.get(recipeAt);
    renderCraftingRecipe(gui, recipe);


    TextureManager render = Minecraft.getMinecraft().renderEngine;
    render.bindTexture(craftingOverlay);
View Full Code Here

     RecipeTemplate template = generator.createRecipeTemplate(slots, machine);

     for (int i = 0; i < CompressorRecipes.getRecipeList().size(); i++)
     {
       Object[] array = new Object[11];
       IRecipe rec = CompressorRecipes.getRecipeList().get(i);

       if (rec instanceof ShapedRecipes)
       {
         ShapedRecipes recipe = (ShapedRecipes) rec;
View Full Code Here

    private void addIngotCompressorRecipes()
    {
        for (int i = 0; i < CompressorRecipes.getRecipeList().size(); i++)
        {
            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));
                }
            }

            this.registerIngotCompressorRecipe(input1, new PositionedStack(rec.getRecipeOutput(), 140, 46));
        }
    }
View Full Code Here

        }
        else
        {
            for (j = 0; j < CompressorRecipes.recipes.size(); ++j)
            {
                IRecipe irecipe = CompressorRecipes.recipes.get(j);

                if (irecipe instanceof ShapedRecipes && CompressorRecipes.matches((ShapedRecipes) irecipe, inventory, par2World))
                {
                    return irecipe.getRecipeOutput().copy();
                }
                else if (irecipe instanceof ShapelessOreRecipe && CompressorRecipes.matchesShapeless((ShapelessOreRecipe) irecipe, inventory, par2World))
                {
                    return irecipe.getRecipeOutput().copy();
                }
            }

            return null;
        }
View Full Code Here

  }

    private static void writeWaterPantRecipes() {
      if(!Element.WATERPLANT.isPresent()) return;
     
      final IRecipe recipe = new ShapelessOreRecipe(new ItemStack(Items.dye, 1, 2), Element.WATERPLANT.get());
      Extrabiomes.proxy.addRecipe(recipe);
    }
View Full Code Here

        continue;
      }
     
      if (!seed_element.isPresent() || !crop_element.isPresent()) continue;

      final IRecipe recipe = new ShapelessOreRecipe(seed_element.get(),
          crop_element.get());
      Extrabiomes.proxy.addRecipe(recipe);
    }
    }
View Full Code Here

TOP

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

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.