Package net.minecraft.item.crafting

Examples of net.minecraft.item.crafting.IRecipe


      for (int x = 0; x < 9; x++)
      {
        ic.setInventorySlotContents( x, packetPatternSlot.pattern[x] == null ? null : packetPatternSlot.pattern[x].getItemStack() );
      }

      IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj );

      if ( r == null )
        return;

      IMEMonitor<IAEItemStack> storage = ct.getItemInventory();
      IItemList<IAEItemStack> all = storage.getStorageList();

      ItemStack is = r.getCraftingResult( ic );

      for (int x = 0; x < ic.getSizeInventory(); x++)
      {
        if ( ic.getStackInSlot( x ) != null )
        {
          ItemStack pulled = Platform.extractItemsByRecipe( powerSrc, mySrc, storage, p.worldObj, r, is, ic, ic.getStackInSlot( x ), x, all,
              Actionable.MODULATE, ItemViewCell.createFilter( getViewCells() ) );
          real.setInventorySlotContents( x, pulled );
        }
      }

      IRecipe rr = Platform.findMatchingRecipe( real, p.worldObj );

      if ( rr == r && Platform.isSameItemPrecise( rr.getCraftingResult( real ), is ) )
      {
        SlotCrafting sc = new SlotCrafting( p, real, cOut, 0, 0, 0 );
        sc.onPickupFromSlot( p, is );

        for (int x = 0; x < real.getSizeInventory(); x++)
View Full Code Here


            "II",
            "II",
            'I', Items.iron_ingot});

        // Steel Plate
        IRecipe recipe = new ShapedOreRecipe(new ItemStack(this, 4, 1), new Object[]{
            "II",
            "II",
            'I', "ingotSteel"});
        RollingMachineCraftingManager.getInstance().getRecipeList().add(recipe);
View Full Code Here

      {
        InventoryCrafting ic = new InventoryCrafting( new ContainerNull(), 3, 3 );
        for ( int x = 0; x < 9; x++ )
          ic.setInventorySlotContents( x, pattern.getStackInSlot( x ) );

        IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj );

        if ( r == null )
        {
          Item target = request.getItem();
          if ( target.isDamageable() && target.isRepairable() )
          {
            boolean isBad = false;
            for ( int x = 0; x < ic.getSizeInventory(); x++ )
            {
              ItemStack pis = ic.getStackInSlot( x );
              if ( pis == null )
                continue;
              if ( pis.getItem() != target )
                isBad = true;
            }
            if ( !isBad )
            {
              super.onPickupFromSlot( p, is );
              // actually necessary to cleanup this case...
              p.openContainer.onCraftMatrixChanged( getCraftingMatrix() );
              return request;
            }
          }
          return null;
        }

        is = r.getCraftingResult( ic );

        if ( inv != null )
        {
          for ( int x = 0; x < pattern.getSizeInventory(); x++ )
          {
View Full Code Here

            {
              ic.setInventorySlotContents( x, recipe[x][0] );
            }
          }

          IRecipe r = Platform.findMatchingRecipe( ic, pmp.worldObj );

          if ( r != null && security.hasPermission( player, SecurityPermissions.EXTRACT ) )
          {
            ItemStack is = r.getCraftingResult( ic );

            if ( is != null )
            {
              IMEMonitor<IAEItemStack> storage = inv.getItemInventory();
              IItemList all = storage.getStorageList();
              IPartitionList<IAEItemStack> filter = ItemViewCell.createFilter( cct.getViewCells() );

              for (int x = 0; x < craftMatrix.getSizeInventory(); x++)
              {
                ItemStack PatternItem = ic.getStackInSlot( x );

                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

    for (Object o : recipes)
    {
      try
      {
        IRecipe recipe = (IRecipe) o;

        Object[] items = generator.getCraftingRecipe( recipe, true );

        if ( items.length == 5 )
        {
View Full Code Here

                    " I ",
                    'T', BlockRailcraftSlab.getItem(EnumBlockMaterial.IRON),
                    'I', EnumPost.METAL.getItem());

            stack = EnumPost.METAL.getItem(32);
            IRecipe recipe = new ShapedOreRecipe(stack,
                    "III",
                    " I ",
                    "III",
                    'I', "ingotSteel");
            RollingMachineCraftingManager.getInstance().getRecipeList().add(recipe);
View Full Code Here

                    'T', RailcraftItem.plate.getRecipeObject(EnumPlate.STEEL));
        }
    }

    private void paintLocomotive(ItemStack base) {
        IRecipe recipe = new LocomotivePaintingRecipe(base);
        CraftingPlugin.addRecipe(recipe);
    }
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

            MinecraftForge.ORE_GEN_BUS.register(new PoorTinGenerator());
        if (RailcraftConfig.isWorldGenEnabled("lead") && EnumOre.POOR_LEAD.isEnabled())
            MinecraftForge.ORE_GEN_BUS.register(new PoorLeadGenerator());

        if (RailcraftConfig.getRecipeConfig("railcraft.misc.gunpowder")) {
            IRecipe recipe = new ShapelessOreRecipe(new ItemStack(Items.gunpowder, 2), "dustSaltpeter", "dustSaltpeter", "dustSulfur", "dustCharcoal");
            CraftingManager.getInstance().getRecipeList().add(recipe);
        }

        if (RailcraftConfig.getRecipeConfig("forestry.misc.fertilizer")) {
            ItemStack fert = ForestryPlugin.getItem("fertilizerCompound");
View Full Code Here

                "I I",
                "I I",
                "I I",
                'I', Items.iron_ingot);

        IRecipe recipe = new ShapedOreRecipe(item.getStack(6, EnumRail.STANDARD),
                "I I",
                "I I",
                "I I",
                'I', "ingotBronze");
        RollingMachineCraftingManager.getInstance().getRecipeList().add(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.