Interface MachineOperation

All Known Implementing Classes:
CraftingOperation, FuelOperation, GEOMiningOperation, MiningOperation

public interface MachineOperation
This represents a MachineOperation which is handled by a MachineProcessor.
Author:
TheBusyBiscuit
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addProgress(int ticks)
    This method adds the given amount of ticks to the progress.
    int
    This returns the amount of progress that has been made.
    default int
    This returns the amount of remaining ticks until the MachineOperation finishes.
    int
    This returns the amount of total ticks this MachineOperation takes to complete.
    default boolean
    This returns whether this MachineOperation has finished.
    default void
    onCancel(io.github.bakedlibs.dough.blocks.BlockPosition position)
    This method is called when a MachineOperation is interrupted before finishing.
  • Method Details

    • addProgress

      void addProgress(int ticks)
      This method adds the given amount of ticks to the progress.
      Parameters:
      ticks - The amount of ticks to add to the progress
    • getProgress

      int getProgress()
      This returns the amount of progress that has been made. It's basically the amount of elapsed ticks since the MachineOperation has started.
      Returns:
      The amount of elapsed ticks
    • getTotalTicks

      int getTotalTicks()
      This returns the amount of total ticks this MachineOperation takes to complete.
      Returns:
      The amount of total ticks required.
    • getRemainingTicks

      default int getRemainingTicks()
      This returns the amount of remaining ticks until the MachineOperation finishes.
      Returns:
      The amount of remaining ticks.
    • isFinished

      default boolean isFinished()
      This returns whether this MachineOperation has finished.
      Returns:
      Whether this has finished or not.
    • onCancel

      default void onCancel(io.github.bakedlibs.dough.blocks.BlockPosition position)
      This method is called when a MachineOperation is interrupted before finishing. Implement to specify behaviour that should happen in this case.