Delays
Waits for game ticks or for a condition.
ClassRLPlugins API
public class DelaysCall these only from VitaPlugin.loop(). On the game thread, for example in a @Subscribe method, they never return and the game freezes.
Members
Static methods
- voidtick()
Sleeps the thread for x1 tick.
- voidtick(int)
Sleeps the thread for x ticks.
- voidwaitUntil(Supplier<Boolean>)
Waits until the specified condition is true.
- booleanwaitUntil(Supplier<Boolean>, int)
Waits until the specified condition is true or the timeout is reached.
- booleanwaitUntil(Supplier<Boolean>, long)
Waits until the specified condition is true or the timeout is reached.
- voidwaitUntilIdle()
Waits until your player is idle.
- voidwaitUntilOnTile(int, int)
Waits until your player stands on this tile.
tick()static
public static void tick()Sleeps the thread for x1 tick.
tick(int)static
public static void tick(int ticks)Sleeps the thread for x ticks.
Parameters
ticks- Ticks.
waitUntil(Supplier<Boolean>)static
public static void waitUntil(Supplier<Boolean> condition)Waits until the specified condition is true.
Parameters
condition- The condition to be met.
waitUntil(Supplier<Boolean>, int)static
public static boolean waitUntil(Supplier<Boolean> condition, int ticks)Waits until the specified condition is true or the timeout is reached.
Parameters
condition- The condition to be met.
ticks- The maximum time to wait in game ticks.
Returns
True if the condition was met, false if the timeout was reached.
waitUntil(Supplier<Boolean>, long)static
public static boolean waitUntil(Supplier<Boolean> condition, long timeoutMS)Waits until the specified condition is true or the timeout is reached.
Parameters
condition- The condition to be met.
timeoutMS- The maximum time to wait in milliseconds.
Returns
True if the condition was met, false if the timeout was reached.
waitUntilIdle()static
public static void waitUntilIdle()Waits until your player is idle.
waitUntilOnTile(int, int)static
public static void waitUntilOnTile(int worldX, int worldY)Waits until your player stands on this tile.
Parameters
worldX- World x.
worldY- World y.
Also allowed
Every class has these, as in plain Java.
equals, toString