Examples of InventoryCrafting


Examples of net.minecraft.inventory.InventoryCrafting

    if (!doRemove) {
      inv = new InventoryCopy(robot);
    }

    InventoryCrafting invCraft = new InventoryCrafting(new Container() {

      @Override
      public boolean canInteractWith(EntityPlayer player) {
        // TODO Auto-generated method stub
        return false;
      }
    }, 3, 3);

    for (int i = 0; i < items.length; ++i) {
      Object tmp = items [i];

      if (tmp == null) {
        continue;
      }

      int qty = 0;
      ArrayStackFilter filter;

      if (tmp instanceof ItemStack) {
        ItemStack stack = (ItemStack) tmp;
        qty = stack.stackSize;
        filter = new ArrayStackFilter(stack);
      } else {
        ArrayList<ItemStack> stacks = (ArrayList<ItemStack>) tmp;
        qty = stacks.get(0).stackSize;
        filter = new ArrayStackFilter(stacks.toArray(new ItemStack[stacks.size()]));
      }

      for (IInvSlot s : InventoryIterator.getIterable(inv)) {
        if (filter.matches(s.getStackInSlot())) {
          ItemStack removed = s.decreaseStackInSlot(qty);

          qty = qty - removed.stackSize;

          if (invCraft.getStackInSlot(i) != null) {
            invCraft.getStackInSlot(i).stackSize += qty;
          } else {
            invCraft.setInventorySlotContents(i, removed);
          }

          invCraft.setInventorySlotContents(i, removed);

          if (removed.stackSize == 0) {
            break;
          }
        }
View Full Code Here

Examples of net.minecraft.src.InventoryCrafting

  public ContainerClevercraft(EntityPlayer aPlayer, TileEntityCraftingTableII tile)
  {
    worldObj = tile.worldObj;
    theTile = tile;
    thePlayer = aPlayer;
    craftMatrix = new InventoryCrafting(this, 3, 3);
        craftableRecipes = new InventoryCraftingTableII(1000);
        recipeList = Collections.unmodifiableList( CraftingManager.getInstance().getRecipeList() );
   
    for(int l2 = 0; l2 < 5; l2++)
        {
View Full Code Here

Examples of net.minecraft.src.InventoryCrafting

      {
        return new Object[] {false, ThePlayerBefore, SlotCount, InternalBefore}; //Look into this effecting player in some recipes
      }
      Internal = (IInventory) iTemp[1];
      if (UpdateWorld){
        InventoryCrafting TempMatrix =GenCraftingMatrix(ContainerClevercraft.getRecipeIngredientsOLD(TheItem.iRecipe));
        TheItem.toItemStack().onCrafting(ThePlayer.player.worldObj, ThePlayer.player, 1);
        ModLoader.takenFromCrafting(ThePlayer.player, TheItem.toItemStack(), TempMatrix);
        ForgeHooks.onTakenFromCrafting(ThePlayer.player, TheItem.toItemStack(), TempMatrix);
        HandleCraftingMaxtrix(TempMatrix, ThePlayer);
      }
View Full Code Here

Examples of net.minecraft.src.InventoryCrafting

      }
    }
  }
  public static InventoryCrafting GenCraftingMatrix(ItemStack[] Items)
  {
    InventoryCrafting Temp = new InventoryCrafting(new ContainerNull(), 3, 3);
    for (int i=0; i<Items.length; i++)
    {
      if (Items[i] != null) {
        Items[i].stackSize = 1;
        Temp.setInventorySlotContents(i, Items[i]);
      }
    }
    return Temp;
  }
View Full Code Here

Examples of net.minecraft.src.InventoryCrafting

      {
        return new Object[] {false, ThePlayerBefore, SlotCount, InternalBefore}; //Look into this effecting player in some recipes
      }
      Internal = (IInventory) iTemp[1];
      if (UpdateWorld){
        InventoryCrafting TempMatrix =GenCraftingMatrix(ContainerClevercraft.getRecipeIngredientsOLD(TheItem.iRecipe));
        TheItem.toItemStack().onCrafting(ThePlayer.player.worldObj, ThePlayer.player, 1);
        ModLoader.takenFromCrafting(ThePlayer.player, TheItem.toItemStack(), TempMatrix);
        ForgeHooks.onTakenFromCrafting(ThePlayer.player, TheItem.toItemStack(), TempMatrix);
        HandleCraftingMaxtrix(TempMatrix, ThePlayer);
      }
View Full Code Here

Examples of net.minecraft.src.InventoryCrafting

      }
    }
  }
  public static InventoryCrafting GenCraftingMatrix(ItemStack[] Items)
  {
    InventoryCrafting Temp = new InventoryCrafting(new ContainerNull(), 3, 3);
    for (int i=0; i<Items.length; i++)
    {
      if (Items[i] != null) {
        Items[i].stackSize = 1;
        Temp.setInventorySlotContents(i, Items[i]);
      }
    }
    return Temp;
  }
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.