Guest User

Untitled

a guest
Nov 20th, 2017
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.80 KB | None | 0 0
  1. void onPlayerJoin(PlayerJoinEvent e) {
  2.        
  3.         new Thread(new Runnable() {
  4.        
  5.             public void run() {
  6.                
  7.                 ArrayList<String> keys = new ArrayList<>(config.getConfigurationSection("config").getKeys(false));
  8.                 int count = keys.size();
  9.                 Player p = e.getPlayer();
  10.                 for(int i = 0; i < count; i++){
  11.                     p.sendTitle(config.getString("config." + keys.get(i) + ".title"), config.getString("config." + keys.get(i) + ".subtitle"), config.getInt("config." + keys.get(i) + ".fadeIn"), config.getInt("config." + keys.get(i) + ".stay"), config.getInt("config." + keys.get(i) + ".fadeOut"));
  12.                     try {
  13.                         Thread.sleep(config.getInt("config." + keys.get(i) + ".sleep"));
  14.                     } catch (InterruptedException e1) {
  15.                         e1.printStackTrace();
  16.                     }
  17.                    
  18.                 }
  19.                
  20.             }
  21.            
  22.         }).start();
  23.        
  24.        
  25.     }
Advertisement
Add Comment
Please, Sign In to add comment