[Resolved] Getting World from Config

Discussion in 'Plugin Development' started by A5H73Y, Aug 7, 2012.

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

    A5H73Y

    Code:
    String worldconfig = plugin.getConfig().get(arenain + ".world");
    World worldset = worldconfig;
    Location Course = new Location(worldset, posx, posy, posz);
    I tried to mess about with no luck, btw posx / y / z are fine.
     
  2. Offline

    sd5

    Your code is curios but I think you mean:
    Code:
    World worldset = Bukkit.getWorld(worldconfig);
     
  3. Offline

    A5H73Y

    It helped but didnt work:
    Code:
    String worldconfig = [B](String)[/B] plugin.getConfig().get(arenain + ".world");
                        World worldset = Bukkit.getWorld(worldconfig);
                        Location Course = new Location(worldset, posx, posy, posz);
    It made be add ((String) Seen in Bold). It sends error to console when the event in run. I know my code works because I used to use
    Code:
    Location Course = new Location(player.getLocation().getWorld(), posx, posy, posz);
     
  4. Offline

    pzxc

    use getConfig().getString(key) if you are getting a string
    Then use getServer().getWorld(worldname) to change the string into a World object
     
  5. Offline

    A5H73Y

    I had already fixed it.
    But thanks for your help :)
     
Thread Status:
Not open for further replies.

Share This Page