Generate a World

Discussion in 'Plugin Development' started by surtic, Mar 30, 2012.

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

    surtic

    Hi all,

    I be working on a Plugin that needs Generate World while the Server is running. Now i had Implement the generation of the World. But every Time i make this i have a big Laaag.

    Now i generate the World in a SyncTask and i have Testet it with a AsyncTask but then i get the error for with the TickNextTick :(

    Code:
    14:49:47 [INFO] [Hardcore] GenerateWorldTask Before World Gen
    14:49:48 [INFO] Preparing start region for level 2 (Seed: -472604657436997866)
    14:49:48 [SCHWERWIEGEND] java.lang.IllegalStateException: TickNextTick list out of synch
    14:49:48 [SCHWERWIEGEND]    at net.minecraft.server.World.a(World.java:2383)
    14:49:48 [SCHWERWIEGEND]    at net.minecraft.server.World.doTick(World.java:1758)
    14:49:48 [SCHWERWIEGEND]    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:541)
    14:49:48 [SCHWERWIEGEND]    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
    14:49:48 [SCHWERWIEGEND]    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    14:49:48 [SCHWERWIEGEND] Unexpected exception
    java.lang.IllegalStateException: TickNextTick list out of synch
        at net.minecraft.server.World.a(World.java:2383)
        at net.minecraft.server.World.doTick(World.java:1758)
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:541)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    14:49:49 [INFO] Preparing spawn area for hc_test, 12%
    14:49:50 [INFO] Preparing spawn area for hc_test, 24%
    14:49:51 [INFO] Preparing spawn area for hc_test, 40%
    14:49:52 [INFO] Preparing spawn area for hc_test, 56%
    14:49:53 [INFO] Preparing spawn area for hc_test, 69%
    14:49:54 [INFO] Preparing spawn area for hc_test, 85%
    14:49:55 [INFO] Preparing spawn area for hc_test, 97%
    14:49:55 [INFO] [Hardcore] StartGameTask After World Gen
    Any Idea? I need to split the Code in more Task?
     
  2. Offline

    sd5

    Please post the code which generates the world...
     
  3. use an Sync task, instead of an aSync
     
  4. Offline

    surtic

    ferrybig : I make it with a SyncTask but than Freez the Server for 20Sec.
     
  5. Offline

    nisovin

    There's nothing you can do about that except upgrade your server hardware.
     
  6. Offline

    surtic

    i think its not the server hardware... the generation of a world stops all...

    server is a i 7 prozessor with 8gb ram..
     
  7. the server can to 1 thing at a time, making the world, or listening to the other things from al player, if you try to do both things, it gives errors
     
  8. Offline

    surtic

    ferrybig : but i cant remamber that multiverse have the same problem by generating a new world.
     
  9. they must have the same problemn, or else they have the same errors like you have
     
  10. Offline

    sd5

    Try out the WorldCreator: Here

    Code:
    WorldCreator wc = new WorldCreator(String); //Name of the world.
    wc.seed(long); //Seed of the world.
    wc.generateStructures(boolean); //Create structures or not.
    wc.type(WorldType); //WorldType of the world.
    wc.createWorld(); //Creates a world with the specified options.
    
    Didn't test it, but should work...
     
  11. Offline

    pers2981

    sd5

    I am actually trying to do something similar to surtic,


    Code:
    WorldCreator wc = new WorldCreator("Arena");
    wc.seed(21352345); //Seed of the world.
    wc.generateStructures(false);
    wc.type(NORMAL);
    wc.createWorld();
    
    I get an error under

    wc.type(NORMAL);

    According to this the following world types are.

    NORMAL
    FLAT
    VERSION_1_1
     
  12. Offline

    sd5

    It's
    Code:
    wc.type(WorldType.NORMAL);
     
Thread Status:
Not open for further replies.

Share This Page