Load all chunks

Discussion in 'Archived: Plugin Requests' started by MoonLiteNite, Sep 25, 2013.

  1. Offline

    MoonLiteNite

    Plugin category: Admin/world/utility

    Suggested name: MassChunkLoader

    What I want:
    With the new 1.7 patch coming up, we have to load up all the chunks in our world in 1.6.3 in order to save the generator structures, witch huts, nether fortress, ect...
    It would be nice to have a plugin that loads up all already generator chunks in a given world. That way one does not have to manually travel all over his world to keep everything working good.

    Ideas for commands:
    /loadchunk (world) start
    /loadchunk (world) pause
    /loadchunk (world) stop
    /loadchunk (world) progress

    Ideas for permissions:
    None needed, for admin use only

    When I'd like it by:
    Before 1.7 is released
     
  2. Offline

    timtower Administrator Administrator Moderator

    MoonLiteNite Will take a shot at this, not promising anything though
     
  3. Offline

    DxDy

    BillyGalbreath likes this.
  4. Offline

    timtower Administrator Administrator Moderator

    That will generate, not load the chunks
     
  5. Offline

    deimos161

    timtower Wouldn't it cause great stress to a server having every single chunk loaded? My server is 3.9GB just in chunks :p
     
  6. Offline

    valithor2

    From the way i understand this he only wants to generate the chunks so when 1.7 comes If the generator changes it will not destroy the already made world
    timtower

    and yes deimos161
    if you load every single chunk it will almost certainly crash almost any server

    so based on that assumption world border would do exactly what you are looking for
    MoonLiteNite
    With http://dev.bukkit.org/bukkit-plugins/worldborder/ you can generate every chunk so when you update the server all chunks will be the same and it will keep the players in the server going out of the all ready generated area.

    BTW chunks that you have been generated previously in a server will not change when a new update comes out as those chunks are saved. Only new never generated chunks will use the new world generation if there is one.
     
    BillyGalbreath likes this.
  7. Offline

    AndyMcB1

    1. You don't need to load all the chunks at the same time - so it would be fine.
    2. "Generating" the chunks would re-generate them and lose everything.
     
  8. Offline

    SniperBrob

    I think you can just load the whole map up in MCEdit. It may take a while depending on your computer speed but it should work (remember to do it for the nether too)
     
  9. Offline

    valithor2

    World border only generates never generated chunks
    Please go look at what world border actually does

    Guys World Border does EXACTLY what he is wanting


    You can fully generate (fill) your world all the way to the border, filling in any missing chunks, including a configurable buffer zone just outside your border.

    The line above is taken directly from world border dev page


    AndyMcB1
    In response to your second statement that was just a miswording i am typing these reponses on a Ipad so they may not be worded a precisely as if i was on my computer
     
    BillyGalbreath likes this.
  10. Offline

    AndyMcB1

    He doesn't want to fill his world. He wants to load it.
     
    MoonLiteNite likes this.
  11. Offline

    timtower Administrator Administrator Moderator

    AndyMcB1 deimos161 valithor2 I will just continue making this, worldborder doesn't load chunks as far as I know and it creates new chunks, not wanted by the OP.
    I am creating a plugin that will load a couple of chunks, and then unload them again, due to the new fixes the chunks only need to be loaded once, not the entire time.
    And no, I won't generate new chunks like worldborder does
     
    AndyMcB1 likes this.
  12. Offline

    MoonLiteNite

    Haha i am actually shocked people even looked at this post.

    timtower
    Right, i just want the chunks to be loaded by the server, even without a player within the 12*12 chunk area. Not all chunks have to be loaded at once. I just want already all generated chunks to be loaded, at least once. Even if this takes many hours it is fine. My server is just for me and 3 other friends. The map size is about 950mbs currently.
    And I am very shocked this hasn't been requested by anyone else. I guess most popular servers just assume all their players will cover any areas that want to be saved. And for small SP worlds people just go into creative and just fly every place. But as I said, for me 3 other people our map size is close to 1gb and flying around to load everything up doesn't sound like too much fun for us :)

    Valithor
    &
    Everyone else
    From my understanding world border would generator NEW chunks, which is not what I want. I want to just load up the chunks i already saved and load them into memory, that way 1.6.3 will properly save the structures, so when upgraded to 1.7 the fortress and witch huts would still work.
     
    timtower likes this.
  13. Offline

    timtower Administrator Administrator Moderator

    MoonLiteNite https://www.dropbox.com/s/1kw4ljtaehhydwi/ChunkLoader.jar
    Command: /loadchunk
    Arguments:
    • help
    • start <worldname>
    • pause ( second time unpauses )
    • stop
    • progress
    Permissions: chunkloader.use
    The plugin will try to load 10 chunks every second, if the rate is wrong then tell me.
    It won't store anything! No config is generated

    To people that will comment on my work: It is indeed not perfect but it is the way I code, deal with it
     
  14. Offline

    MoonLiteNite

    timtower
    Wow thanks!
    Bad news though :p

    So no matter which build i tried using this on, it would never load any chunks. Tried with 1.6.2 1.6.4, the latest, build, ect..
    I tried on new map and a backup of my current map. The progress stayed at 0 chunks for 30mins or so.

    When I do try and use the stop command. i get an ingame error, and the never spews out error

    Code:
    02:46:35 [INFO] MoonLiteNite issued server command: /loadchunk stop
    02:46:35 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'load
    chunk' in plugin ChunkLoader v0.0.1
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:46)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:19
    2)
            at org.bukkit.craftbukkit.v1_6_R3.CraftServer.dispatchCommand(CraftServe
    r.java:523)
            at net.minecraft.server.v1_6_R3.PlayerConnection.handleCommand(PlayerCon
    nection.java:959)
            at net.minecraft.server.v1_6_R3.PlayerConnection.chat(PlayerConnection.j
    ava:877)
            at net.minecraft.server.v1_6_R3.PlayerConnection.a(PlayerConnection.java
    :834)
            at net.minecraft.server.v1_6_R3.Packet3Chat.handle(SourceFile:49)
            at net.minecraft.server.v1_6_R3.NetworkManager.b(NetworkManager.java:296
    )
            at net.minecraft.server.v1_6_R3.PlayerConnection.e(PlayerConnection.java
    :116)
            at net.minecraft.server.v1_6_R3.ServerConnection.b(SourceFile:37)
            at net.minecraft.server.v1_6_R3.DedicatedServerConnection.b(SourceFile:3
    0)
            at net.minecraft.server.v1_6_R3.MinecraftServer.t(MinecraftServer.java:5
    92)
            at net.minecraft.server.v1_6_R3.DedicatedServer.t(DedicatedServer.java:2
    27)
            at net.minecraft.server.v1_6_R3.MinecraftServer.s(MinecraftServer.java:4
    88)
            at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java
    :421)
            at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:5
    83)
    Caused by: java.lang.IllegalStateException: Not scheduled yet
            at org.bukkit.scheduler.BukkitRunnable.getTaskId(BukkitRunnable.java:129
    )
            at org.bukkit.scheduler.BukkitRunnable.cancel(BukkitRunnable.java:18)
            at nl.timdebrouwer.chunkloader.ChunkLoader.cmdStop(ChunkLoader.java:90)
            at nl.timdebrouwer.chunkloader.ChunkLoader.onCommand(ChunkLoader.java:36
    )
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44)
            ... 15 more
    >stop
    02:46:56 [INFO] CONSOLE: Stopping the server..
    Also a bit strange, from what EVERYONE was saying you HAD to load up your chunks in 1.6.3 for the 1.7 to work.
    So i did a little test, i made a world in 1.5.1
    Found a fortress, saw some wither dudes, then loaded up latest snapshot, and i saw them.

    Did Mojang put in a way to avoid having to load the chunks up in 1.6.3 in order to save them??? If that is the case then this plugin wouldn't be needed :)
     
  15. Offline

    AndyMcB1

    MoonLiteNite
    Actually 1.6.4
     
  16. Offline

    timtower Administrator Administrator Moderator

  17. Offline

    MoonLiteNite

    timtower
    Now it just gives out errors after i run the command to start.

    I only tried it on the latest 1.6.4 build though.
    Thanks for the attempt but I am starting to think when 1.7 is really released it should auto fix the bug by itself.
     
  18. Offline

    timtower Administrator Administrator Moderator

    MoonLiteNite Could you provide the errors? I would like to know where it went wrong
     
  19. Offline

    evilgordita

    timtower
    Hey, I just tried this on my server. I'm running Essentials (with Group Manager) 2.12.1 and Multiverse 2.5 on the most recent Bukkit dev build. Typing '/loadchunk start' results in a crash and Bukkit saves a crash dump. I've attached the crash dump from my attempt.
     

    Attached Files:

  20. Offline

    evilgordita

    I don't see the attachment? It's not clear to me why.

    Anyway, here is the stack trace:
    Code:
    Time: 10/13/13 11:15 PM
    Description: Exception in server tick loop
     
    java.util.ConcurrentModificationException
        at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
        at java.util.HashMap$KeyIterator.next(Unknown Source)
        at net.minecraft.server.v1_6_R3.EntityTracker.updatePlayers(EntityTracker.java:149)
        at net.minecraft.server.v1_6_R3.MinecraftServer.t(MinecraftServer.java:583)
        at net.minecraft.server.v1_6_R3.DedicatedServer.t(DedicatedServer.java:227)
        at net.minecraft.server.v1_6_R3.MinecraftServer.s(MinecraftServer.java:488)
        at net.minecraft.server.v1_6_R3.MinecraftServer.run(MinecraftServer.java:421)
        at net.minecraft.server.v1_6_R3.ThreadServerApplication.run(SourceFile:583)
     
  21. Offline

    timtower Administrator Administrator Moderator

    evilgordita Finally somebody that provides me the error, testing it myself now with some additional lines of code ( then I know where the error is located )
    But with 1500 chunks loaded, still no errors

    Did got the error this time, will see if I can stop it from happening
     
    AndyMcB1 likes this.
  22. Offline

    evilgordita

    timtower Hey, so what happens when the plugin unloads a chunk while level saving is disabled? My host periodically disables level saving in order to do a backup and I haven't been able to figure out how to disable it.

    Have you been able to diagnose the problem? I was going to try and bang on it a bit to see if I could put together a more complete report, but I haven't been able to set aside the time.

    Some things I didn't mention the last time was that I was running the command from within game while logged in. I haven't tried running from the console yet. Once the exception occurs, the player disconnects from the server and it's no longer possible to connect, though the console appears to still be responsive.

    In the code, do you check for chunks that are already loaded? What happens when you attempt to unload chunks that are occupied by a player? What about chunks that are normally held in memory by the server, such as around spawn?
     
  23. Offline

    timtower Administrator Administrator Moderator

    evilgordita The issue is that there is something that gets changed when I am working with it ( That is what google said )
    I don't know why, I don't know how. Sometimes it is working, and on different moments it crashes after 1 minute
     
  24. Offline

    MisterErwin

    timtower: I googled also a little bit (and browsed through some source):
    I think bukkit doesn't like to load chunks every second.... (maybe change the rate)
     
    timtower likes this.
  25. Offline

    timtower Administrator Administrator Moderator

  26. Offline

    BillyGalbreath

    The answer the OP was looking for in in fact WorldBorder. I use this plugin to do exactly what the OP wants. To load up every single chunk at least once so that they are all generated. I've generated entire worlds that span 100,000 blocks in all directions from 0,0 coords. It takes days or even weeks of running to do this, of course.

    You literally cannot load "every single chunk" at the same time it would crash the server within a few minutes, if not seconds.. But you can generate them just fine, using a plugin like WorldBorder which was designed for such things.

    How it works is simple, it loads up chunks in a spiral forcing the generator to generate the data and store the files. Every so often (about 5 seconds) it clears memory and unloads the chunks it force loaded. This makes your ram jump a few gigs every time. The process is repeated until all chunks are loaded out from a central point you specified in the command until the radius is reached.

    Note: When you do this, you will want to disable Dynmap if you have it because generating the map at the same time as all those chunks will bring your server to a crawling <1 tps, or even lockup.
     
  27. Offline

    timtower Administrator Administrator Moderator

    BillyGalbreath It was about loading the chunks once so the structures would still be there in 1.7, not about generating
     
  28. Offline

    BillyGalbreath


    Thats exactly what I just said WorldBorder does. It loads up the chunks, forcing the generator to generate the chunks, which generate all the structures and everything else. The equivalent would be you flying around to every single chunk, about 20 chunk per second until they were all loaded and unloaded from memory, causing the world to generate.

    Edit: Here:

    http://dev.bukkit.org/bukkit-plugins/worldborder/files/29-1-7-6/

    The dev purposefully added that option in for this exact use-case.
     
  29. Offline

    timtower Administrator Administrator Moderator

  30. Offline

    BillyGalbreath

    Most don't, it seems. I've been using this plugin for years and absolutely love it to death ^_^

    And before anyone asks, no it will not "re-generate already generated chunks." It will just simply load them up then unload them. If it finds a blank spot in your radius that's not been generated, then it will generate that chunk as new.

    ;)
     

Share This Page