Get info from the chunk buffer

Discussion in 'Plugin Development' started by Morlok8k, Jun 22, 2011.

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

    Morlok8k

    I'm writing a plugin called Bukkit Land Generator.
    (A simliar concept to my external program, Minecraft Land Generator)

    Basically what i'm doing is getting a command: "/BLGgen 1000" or something, then telling the server to load the chunks in that 1000x1000 square around the player's position.

    it works, but if i load too many chunks at once, all the players on the server get kicked, and cant log in until all the chunks are loaded and generated.

    in fact, if i load way too many chunks, I will get an out of memory error from the server (I got that on a server with 5GB allocated to it!)

    so what i'd like to do is monitor the chunk buffer of chunks to be generated, then once it gets too full, pause until it gets down to a certain percent.

    I have no idea on how to monitor this buffer, and bukkit doesnt have (at least what i could find, and yes i have the JavaDocs) a way to monitor it. I think i found something resembling it in the "net.minecraft.server" but i'm not sure what to do with it.

    any ideas?
     
  2. Offline

    codename_B

    world.getLoadedChunks.length or something like that.
     
  3. Offline

    Morlok8k

    no, i've checked that. those are the chunks currently in memory - and it stays fairly constant - 914 chunks when 1 user (myself) is logged in, and in that world. (255 when no users are in that world)

    No, I'm looking for the list of chunks the server is going to load next.
     
  4. Offline

    Morlok8k

    hmmm.... can i do this by using "Class ChunkLoadEvent" and then waiting for "Class ChunkPopulateEvent"?
     
Thread Status:
Not open for further replies.

Share This Page