SHARE
TWEET

Untitled

a guest Jun 17th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. LOGGER.info("Loading..."); //Working
  2.         List<Guild> guildList = EnhancedServer.getInstance().getJda().getGuilds();
  3.  
  4.         Runnable runnable = new Runnable() {
  5.             @Override
  6.             public void run() {
  7.                 LOGGER.info("Test2");//Working
  8.             }
  9.         };
  10.         runnable.run();
  11.  
  12.         FinishService finishService = new FinishService(() -> {
  13.             LOGGER.info("Loaded!"); //Not Working
  14.             System.out.println("Test"); //Working
  15.         }, guildList.size());
  16.      
  17. public class FinishService {
  18.  
  19.     private final Runnable runnable;
  20.     private final int runs;
  21.  
  22.     private int currentRun;
  23.  
  24.     public FinishService(@NonNull Runnable runnable, int runs) {
  25.         this.runnable = runnable;
  26.         this.runs = runs;
  27.     }
  28.  
  29.     public void increment() {
  30.         this.currentRun++;
  31.         if (this.currentRun == this.runs) {
  32.             this.runnable.run();
  33.         }
  34.     }
  35.  
  36. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top