Save specific chunks without unloading

Discussion in 'Plugin Development' started by Ratismal, Jun 20, 2015.

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

    Ratismal

    Salutations,

    I am currently developing a plugin that catches block events, adds the occurring chunk to a list, and saves all chunks on the list on a configurable timer. The main reasoning for this is because with massive world files and multiple dimensions, saving every single world in all entirety costs a lot of processing power. The end goal is to save only modified chunks rather than everything. However, I have run into a standstill.

    I have searched the bukkit documentation, and the only method for saving specific chunks I have found is unloading them. This means that unloadable chunks containing players will never be saved, and any chunk modifications will be lost should the server uncleanly exit due to something such as a crash. Thus, my questions are as follows:

    A) Is it possible to save specific chunks without unloading them? Is there some method that my combing of the documentation overlooked?

    B) Is it possible to unload chunks containing players? I have tried
    Code:
    chunk.unload(true, false);
    to no avail, as it still refuses to unload chunks containing players. I understand the consequences of unloading a chunk containing a player, and will only use this as a very last resort.

    C) Should I just give up on this idea? If there is ultimately no way to save modified chunks, I'll just have to bite the bullet and turn to alternative world saving tactics.

    I would greatly appreciate any help regarding this matter. If there is anything that I need to provide you with, such as my source code, I will be more than happy to provide it.

    Thank you in advance,
    Ratismal
     
  2. Offline

    Ratismal

    It's been two days, so I'm giving this a little bump.

    I would really appreciate if anyone could give me help, or just tell me it's impossible. Either work.
     
  3. Offline

    xTrollxDudex

    Bukkit was meant to be safe and prevent developers from doing stupid things. If you know how to do something stupid correctly, it would be playing with the data structures in NMS.
     
Thread Status:
Not open for further replies.

Share This Page