Interface TickAdapter

All Known Subinterfaces:
AsyncExecutor, SyncExecutor, TaskExecutor
All Known Implementing Classes:
AbstractSyncExecutor, SimpleAsyncExecutor

public interface TickAdapter
Allows converting time to game ticks.
  • Method Summary

    Modifier and Type
    Method
    Description
    default long
    convert(int ticks, TimeUnit unit)
    Convert ticks to a unit of time.
    default long
    toMillis(int ticks)
    Convert game ticks to TimeUnit.MILLISECONDS.
    default int
    toTicks(long time, TimeUnit unit)
    Convert the given time to game ticks.
  • Method Details

    • toTicks

      default int toTicks(long time, TimeUnit unit)
      Convert the given time to game ticks.
      Parameters:
      time - the amount of time
      unit - the time unit
      Returns:
      the result in game ticks
    • toMillis

      default long toMillis(int ticks)
      Convert game ticks to TimeUnit.MILLISECONDS.
      Parameters:
      ticks - the amount of game ticks
      Returns:
      the result in milliseconds.
    • convert

      default long convert(int ticks, TimeUnit unit)
      Convert ticks to a unit of time.
      Parameters:
      ticks - the amount of game ticks
      unit - the time unit to convert to
      Returns:
      the result in the provided unit