Package net.minecraft.item.crafting

Examples of net.minecraft.item.crafting.IRecipe.matches()


    } 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


    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 );
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

                ItemStack currentItem = craftMatrix.getStackInSlot( x );
                if ( currentItem != null )
                {
                  ic.setInventorySlotContents( x, currentItem );
                  ItemStack newItemStack = r.matches( ic, pmp.worldObj ) ? r.getCraftingResult( ic ) : null;
                  ic.setInventorySlotContents( x, PatternItem );

                  if ( newItemStack == null || !Platform.isSameItemPrecise( newItemStack, is ) )
                  {
                    IAEItemStack in = AEItemStack.create( currentItem );
View Full Code Here

    @Override
    public ItemStack findMatchingRecipe(InventoryCrafting inv, World world) {
        for(int k = 0; k < recipes.size(); k++) {
            IRecipe irecipe = (IRecipe)recipes.get(k);
            if(irecipe.matches(inv, world)) {
                return irecipe.getCraftingResult(inv);
            }
        }

        return null;
View Full Code Here

          List recipes = CraftingManager.getInstance().getRecipeList();
      for (int index = 0; index < recipes.size(); ++index) {
                IRecipe currentRecipe = (IRecipe) recipes.get(index);

        if (currentRecipe.matches(par1InventoryCrafting, par2World)) {
                    return currentRecipe;
                }
            }

            return null;
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.