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 TypeMethodDescriptionvoid
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 theMachineOperation
finishes.int
This returns the amount of total ticks thisMachineOperation
takes to complete.default boolean
This returns whether thisMachineOperation
has finished.default void
onCancel
(io.github.bakedlibs.dough.blocks.BlockPosition position) This method is called when aMachineOperation
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 theMachineOperation
has started.- Returns:
- The amount of elapsed ticks
-
getTotalTicks
int getTotalTicks()This returns the amount of total ticks thisMachineOperation
takes to complete.- Returns:
- The amount of total ticks required.
-
getRemainingTicks
default int getRemainingTicks()This returns the amount of remaining ticks until theMachineOperation
finishes.- Returns:
- The amount of remaining ticks.
-
isFinished
default boolean isFinished()This returns whether thisMachineOperation
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 aMachineOperation
is interrupted before finishing. Implement to specify behaviour that should happen in this case.
-