Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void createArenaSpawns(String filename, String worldName, int spawnNmb, Location loc, Player player){
- if(checkFiles(filename,worldName) == true){
- if(spawnNmb <= getMaxPlayers(filename,worldName)){
- File file = new File(plugin.getDataFolder() + File.separator + worldName, filename + ".yml");
- config.set("maxPlayers", getMaxPlayers(filename,worldName));
- config.set("currentPlayers", getCurrentPlayers(filename, worldName));
- config.set("p" + spawnNmb + ".x", loc.getBlockX());
- config.set("p" + spawnNmb + ".y", loc.getBlockY());
- config.set("p" + spawnNmb + ".z", loc.getBlockZ());
- config.set("p" + spawnNmb + ".isTaken", false);
- try {
- config.save(file);
- player.sendMessage(ChatColor.AQUA + "Successfully set spawn " + ChatColor.RED + "p" + spawnNmb + ChatColor.AQUA + " in arena " + ChatColor.RED + filename);
- } catch (IOException e) {
- e.printStackTrace();
- }
- } else {
- player.sendMessage(ChatColor.RED + "Invalid Playerspawn-number. Its higher than the max supported Players.");
- return;
- }
- } else {
- player.sendMessage(ChatColor.RED + "That Arena does not exist.");
- return;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement