[ REG ] Map Cycle

Discussion in 'Archived: Plugin Requests' started by AshhMorgan, Apr 10, 2012.

  1. Offline

    AshhMorgan

    Hi, I would love to see a plugin where players could vote the change the map.
    But i want the map to be the fresh one
    like say i had hunger games on it started a new map
    Thanks FFactions.com Owner
     
  2. Offline

    Harry8550

    So your looking for a world generator to generate a world, teleport every player to that world and then delete the old world?
     
  3. Offline

    Phiwa

    Basically you would want the plugin the use a Multiverse-Command to create a new world, teleport the players there and delete the old one.

    /mv create <Random name> NORMAL
    Teleport all players in the world to new the world (List<Player> players = player.getWorld().getPlayers(); etc.))
    /mv delete <Name of the old World>

    Think there will be someone who can do that for you, but I do not have enough time to maintain another plugin. ;)

    EDIT:

    You need to create the new world with the random name and then fire this method (player is the Player which started the vote and randomname the name which was used to create the new world)
    Code:
    public void teleportPlayersToNewWorld(Player player, String randomname) {
        String randomname;
        World world = player.getServer().getWorld(randomname);
                Location loc = world.getSpawnLocation();
                List<Player> players = player.getWorld().getPlayers();
                int size = players.size();
                int i = 0;
                for(i = 1;i >= size;i++) {
                    players.get(i).teleport(loc);
                }
    }
    
    Don't know if it works, but I think it should... ;)
     

Share This Page