Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void onPlayerJoin(PlayerJoinEvent e) {
- new Thread(new Runnable() {
- public void run() {
- ArrayList<String> keys = new ArrayList<>(config.getConfigurationSection("config").getKeys(false));
- int count = keys.size();
- Player p = e.getPlayer();
- for(int i = 0; i < count; i++){
- 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"));
- try {
- Thread.sleep(config.getInt("config." + keys.get(i) + ".sleep"));
- } catch (InterruptedException e1) {
- e1.printStackTrace();
- }
- }
- }
- }).start();
- }
Advertisement
Add Comment
Please, Sign In to add comment