Advertisement
Guest User

Untitled

a guest
Jul 28th, 2013
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 KB | None | 0 0
  1. @EventHandler(priority=EventPriority.HIGH)
  2. public void onPlayerJoin(UltimateArenaJoinEvent event) {
  3. ArrayList<Integer> signList = new ArrayList<Integer>();
  4. int activePlayers = event.getArena().getActivePlayers();
  5. String arena = event.getArena().getName();
  6. signList = getSigns(arena);
  7.  
  8. for (int coords : signList) {
  9.  
  10. int players = getConfig().getInt("Signs." + coords + ".players");
  11. players = players + 1;
  12. System.out.println("Manual Players: " + players + " Auto Players: " + activePlayers); //------DEBUG------
  13.  
  14. String worldName = getConfig().getString("Signs." + coords + ".world");
  15. World world = Bukkit.getServer().getWorld(worldName);
  16.  
  17. int x = getConfig().getInt("Signs." + coords + ".x");
  18. int y = getConfig().getInt("Signs." + coords + ".y");
  19. int z = getConfig().getInt("Signs." + coords + ".z");
  20. Location location = new Location(world, x, y, z);
  21.  
  22. this.getConfig().set("Signs." + coords + ".players", players);
  23. this.getConfig().set("Signs." + coords + ".game", "in");
  24. this.saveConfig();
  25.  
  26. if(location.getBlock().getState() instanceof Sign){
  27. Sign s = (Sign)location.getBlock().getState();
  28. if (s.getLine(0).equals("§l[Arena Stats]")) {
  29. s.setLine(2, "Loading");
  30. s.setLine(3, "Loading");
  31. }
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement