World returns null

Discussion in 'Plugin Development' started by i3ick, Mar 26, 2014.

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

    i3ick

    Hey, I try to create a location but the world returns null, even though the "name" is valid
    Code:java
    1. String name = config.getString("Worlds." + "World");
    2. WinterSlashMain.getInstance().getLogger().info(name + "this be name");
    3. World world = Bukkit.getServer().getWorld(name);

    I create the location with: Location joinLocation = new Location(world, joinX, joinY, joinZ);
    and also print it, the name alone printed is fine, but it somehow turns to null when used for location

    output:
    What's going on here?
     
  2. Offline

    Wolfey

    Maybe there is no world with that name.
     
  3. Offline

    i3ick

    @Wilfey
    no, there is. I checked
     
  4. Offline

    L33m4n123

    Is it loaded upon server start? if not try something along

    Code:
    WorldCreator c = new WorldCreator("worldName");
    c.createWorld();
    
    this loads the map if it does exist else it creates it
     
  5. i3ick Are you sure the name isn't world without a capital 'w'
    I'm pretty sure it's case sensitive.
     
  6. Offline

    i3ick

    L33m4n123

    You were right, I wasn't loading in the world. Thanks, all fixed now!
    :)
     
Thread Status:
Not open for further replies.

Share This Page