Loading worlds

Discussion in 'Plugin Development' started by lightlord323, Mar 26, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    lightlord323

    hello guys, so i've been trying to teleport players between worlds but it gives me an error, because it is not loaded. I have no idea how to load it and that's where you come in.

    Code:
    Code:
        public void TeleportToRed(Player p, String map) {
    
            Location loc = new Location(Bukkit.getWorld(config.getString(map+".RED.world")),
                    config.getDouble(map+".RED.x"),
                    config.getDouble(map+".RED.y"),
                    config.getDouble(map+".RED.z"));
            p.teleport(loc);
        }
       
        public void TeleportToSpawn(Player p) {
           
            Location loc = new Location(Bukkit.getWorld(config.getString("server.world")),
                    config.getDouble("server.x"),
                    config.getDouble("server.y"),
                    config.getDouble("server.z"));
            p.teleport(loc);
        }
    
    public void TeleportToBlue(Player p, String map) {
           
            Location loc = new Location(Bukkit.getWorld(config.getString(map+".BLUE.world")),
                    config.getDouble(map+".BLUE.x"),
                    config.getDouble(map+".BLUE.y"),
                    config.getDouble(map+".BLUE.z"));
            p.teleport(loc);
        }
     
  2. Offline

    mine-care

  3. Offline

    lightlord323

    the thing is i've searched every where and used every single method, i used the world creator and even used the multiversecore loadWorld() method with no luck :/

    oh and also thanks for telling me about the mistake in the signature xD
     
  4. Offline

    Konato_K

    @lightlord323 The WorldCreator class works fine, if it doesn't work for you it means you're doing something wrong.

    Also you shouldn't create a new location every time you teleport a player... also please use methods starting with lowerCase
     
  5. Offline

    teej107

    On the contrary, error logs do actually help. Please post the stacktrace.
     
Thread Status:
Not open for further replies.

Share This Page