Guest User

Untitled

a guest
Sep 6th, 2021
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. public class ExampleThread implements IBukkitRunnable {
  2.  
  3.     public void asyncMessage(Player player) {
  4.         KronosChain.createCompletedKronosChain().runAsync(() -> {
  5.             System.out.println("This code is being ran Async!");
  6.             MessageAPI.sendFormattedMessage("This code is being ran Async!", player);
  7.         });
  8.     }
  9.  
  10.     public void asyncMessage() {
  11.         runTaskLater(IThreadContext.ASYNC, (t) -> {
  12.             System.out.println("This code is being ran Async!");
  13.             //Broadcasts
  14.             MessageAPI.sendFormattedMessage("This code is being ran Async!");
  15.         }, 20 * 5);
  16.     }
  17. }
  18.  
Advertisement
Add Comment
Please, Sign In to add comment