Examples of IRecipeInput


Examples of net.mcft.copy.betterstorage.api.crafting.IRecipeInput

     
      ingridients.clear();
      for (int x = 0; x < 3; x++)
        for (int y = 0; y < 3; y++) {
          int index = x + y * 3;
          IRecipeInput input = inputArray[index];
          if (input == null) continue;
          List<ItemStack> possibleMatches = input.getPossibleMatches();
          ingridients.add(new PositionedStack(possibleMatches, x * 18 + 12, y * 18 + 6));
          stackArray[index] = possibleMatches.get(0);
        }
     
      StationCrafting crafting = recipe.checkMatch(stackArray, new RecipeBounds(stackArray));
View Full Code Here

Examples of net.mcft.copy.betterstorage.api.crafting.IRecipeInput

    ItemStack[] crafting = (simulate ? this.crafting.clone() : this.crafting);
    boolean success = true;
    craftingLoop:
    for (int i = 0; i < crafting.length; i++) {
      ItemStack stack = crafting[i];
      IRecipeInput required = requiredInput[i];
      if (required != null) {
        int currentAmount = 0;
        if ((stack != null) && simulate)
          stack = craftSlot(stack, required, null, true);
        if (stack != null) {
          if (!required.matches(stack)) return false;
          currentAmount = stack.stackSize;
        }
        int requiredAmount = (required.getAmount() - currentAmount);
        if (requiredAmount <= 0) continue;
        for (int j = 0; j < contents.length; j++) {
          ItemStack contentsStack = contents[j];
          if (contentsStack == null) continue;
          if ((stack == null) ? required.matches(contentsStack)
                              : StackUtils.matches(stack, contentsStack)) {
            int amount = Math.min(contentsStack.stackSize, requiredAmount);
            crafting[i] = stack = StackUtils.copyStack(contentsStack, (currentAmount += amount));
            contents[j] =         StackUtils.copyStack(contentsStack, contentsStack.stackSize - amount);
            if ((requiredAmount -= amount) <= 0)
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.