java.lang.Object
io.github.thebusybiscuit.slimefun4.implementation.operations.CraftingOperation
All Implemented Interfaces:
MachineOperation

public class CraftingOperation extends Object implements MachineOperation
This MachineOperation represents a crafting process.
Author:
TheBusyBiscuit
  • Constructor Details

    • CraftingOperation

      public CraftingOperation(@Nonnull MachineRecipe recipe)
    • CraftingOperation

      public CraftingOperation(@Nonnull ItemStack[] ingredients, @Nonnull ItemStack[] results, int totalTicks)
  • Method Details

    • addProgress

      public void addProgress(int num)
      Description copied from interface: MachineOperation
      This method adds the given amount of ticks to the progress.
      Specified by:
      addProgress in interface MachineOperation
      Parameters:
      num - The amount of ticks to add to the progress
    • getIngredients

      @Nonnull public ItemStack[] getIngredients()
    • getResults

      @Nonnull public ItemStack[] getResults()
    • getProgress

      public int getProgress()
      Description copied from interface: MachineOperation
      This returns the amount of progress that has been made. It's basically the amount of elapsed ticks since the MachineOperation has started.
      Specified by:
      getProgress in interface MachineOperation
      Returns:
      The amount of elapsed ticks
    • getTotalTicks

      public int getTotalTicks()
      Description copied from interface: MachineOperation
      This returns the amount of total ticks this MachineOperation takes to complete.
      Specified by:
      getTotalTicks in interface MachineOperation
      Returns:
      The amount of total ticks required.