createWorld function gives nullpointer

Discussion in 'Plugin Development' started by calthor, Aug 10, 2011.

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


    i've been at this all day long without any succes so far, so decided to ask for help...
    i'm trying to create terrain generator, but i can't get my plugin to create a new world.
    when the world already exists, but doesn't have anything in the region folder, the generator works fine. without the world, i keep getting a nullpointerexception and i can't figure out where it comes from.
    23:24:54 [SEVERE] Error occurred while enabling WasteLandsv0.0 (Is it up to dat
    e?): null
            at net.minecraft.server.World.c(
            at net.minecraft.server.World.<init>(
            at net.minecraft.server.WorldServer.<init>(
            at org.bukkit.craftbukkit.CraftServer.createWorld(
            at org.bukkit.craftbukkit.CraftServer.createWorld(
            at cx.calthor.wastelands.WasteLands.onEnable(
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(
            at org.bukkit.craftbukkit.CraftServer.enablePlugins(
            at net.minecraft.server.MinecraftServer.e(
            at net.minecraft.server.MinecraftServer.a(
            at net.minecraft.server.MinecraftServer.init(

    the console says it's in this line:
    getServer().createWorld(new String("WasteLands"), org.bukkit.World.Environment.NORMAL, new Generator());
    i've been trying to get rid of the nullpointer in that line, and checked the generator for nullpointers, but didn't find any
    if source is needed i can post it, i'll give source when it's finished anyway
    help apreciated.
  2. Offline


    Something might be missing in Generator. Im not sure, but I dont think its the String. :)

    Btw, why use new String("bleh"), when "bleh" is already a String?
  3. Offline


    i tried that because i can't figure out what it is.
    but you're right, i can remove the new String stuff and place the normal string there.
    just cleared my generator, so that it doesn't generate anything (just air). i removed all fields and functions except for the generate function. still had the same result
  4. Offline


    If you want help, please just post your source so we don't have to guess.
  5. Offline


    sorry for the late response, fell asleep...
    i figured out the generator returns a null when instantiated :\
    guess i've still got an error in that one somewhere
Thread Status:
Not open for further replies.

Share This Page