Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler(priority=EventPriority.HIGH)
- public void onPlayerJoin(UltimateArenaJoinEvent event) {
- ArrayList<Integer> signList = new ArrayList<Integer>();
- int activePlayers = event.getArena().getActivePlayers();
- String arena = event.getArena().getName();
- signList = getSigns(arena);
- for (int coords : signList) {
- int players = getConfig().getInt("Signs." + coords + ".players");
- players = players + 1;
- System.out.println("Manual Players: " + players + " Auto Players: " + activePlayers); //------DEBUG------
- String worldName = getConfig().getString("Signs." + coords + ".world");
- World world = Bukkit.getServer().getWorld(worldName);
- int x = getConfig().getInt("Signs." + coords + ".x");
- int y = getConfig().getInt("Signs." + coords + ".y");
- int z = getConfig().getInt("Signs." + coords + ".z");
- Location location = new Location(world, x, y, z);
- this.getConfig().set("Signs." + coords + ".players", players);
- this.getConfig().set("Signs." + coords + ".game", "in");
- this.saveConfig();
- if(location.getBlock().getState() instanceof Sign){
- Sign s = (Sign)location.getBlock().getState();
- if (s.getLine(0).equals("§l[Arena Stats]")) {
- s.setLine(2, "Loading");
- s.setLine(3, "Loading");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement