Examples of IRecipe


Examples of crazypants.enderio.machine.recipe.IRecipe

  public void addRecipe(Recipe recipe) {
    if(recipe == null || !recipe.isValid()) {
      Log.debug("Could not add invalid recipe: " + recipe);
      return;
    }
    IRecipe rec = getRecipeForInput(getInput(recipe));
    if(rec != null) {
      Log.warn("Not adding supplied recipe as a recipe already exists for the input: " + getInput(recipe));
      return;
    }
    recipes.add(recipe);
View Full Code Here

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

Examples of net.minecraft.item.crafting.IRecipe

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

Examples of net.minecraft.item.crafting.IRecipe

  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

Examples of net.minecraft.item.crafting.IRecipe

      //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

Examples of net.minecraft.item.crafting.IRecipe

  @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

Examples of net.minecraft.item.crafting.IRecipe

     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

Examples of net.minecraft.item.crafting.IRecipe

    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

Examples of net.minecraft.item.crafting.IRecipe

        }
        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

Examples of net.minecraft.item.crafting.IRecipe

  }

    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
TOP
Copyright © 2018 www.massapi.com. 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.