Examples of IRecipe


Examples of net.minecraft.item.crafting.IRecipe

                }

                if(containsMatch(true, (ItemStack[])recipe.recipeItems.toArray(new ItemStack[recipe.recipeItems.size()]), replaceStacks))
                {
                    recipesToRemove.add((IRecipe)obj);
                    IRecipe newRecipe = new ShapelessOreRecipe(recipe, replacements);
                    recipesToAdd.add(newRecipe);
                }
            }
        }
View Full Code Here

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

Examples of net.minecraft.item.crafting.IRecipe

            "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

Examples of net.minecraft.item.crafting.IRecipe

      {
        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

Examples of net.minecraft.item.crafting.IRecipe

            {
              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

Examples of net.minecraft.item.crafting.IRecipe

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

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

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

Examples of net.minecraft.item.crafting.IRecipe

                    " 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

Examples of net.minecraft.item.crafting.IRecipe

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

    private void paintLocomotive(ItemStack base) {
        IRecipe recipe = new LocomotivePaintingRecipe(base);
        CraftingPlugin.addRecipe(recipe);
    }
View Full Code Here

Examples of net.minecraft.item.crafting.IRecipe

    }

    @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

Examples of net.minecraft.item.crafting.IRecipe

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