Any API to "delete" a chunk?

Discussion in 'Plugin Development' started by ryanhamshire, Sep 25, 2015.

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

    ryanhamshire

    I'm trying to save hard drive space because it's the primary driver of my monthly hosting fees. I know that most of my world is unimportant to my players - I have land claim data to determine which chunks have stuff players care about vs. which is just wilderness area. I'd like to "delete" the chunks I don't care about so that their hard drive space will be freed until they need to be generated again the next time they're loaded due to a player being nearby. I know I can manually delete region files, but those are HUGE swaths of world that will almost certainly all contain at least one land claim.

    Is there any API which would allow me to remove data for specific chunks, reclaiming hard drive space until they're generated again? Thanks so much for reading! :)

    EDIT: I'm open to other suggestions on reducing world size, short of deleting the world and starting over of course. I don't want my players to riot and quit. Any help at all is very much appreciated.
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    ryanhamshire

    @timtower Are there files for individual chunks? I thought the smallest file unit was region.
     
  4. Offline

    timtower Administrator Administrator Moderator

    @ryanhamshire Good point, going into the region file is also such as hassle.
    Check the source of WorldBorder, might contain what you want.
     
  5. My information is old, but it used to be like you calculate the region file name off the chunk coordinates, then you cross-check if too much would get erased by calculating min/max coords/chunk-coords for the resulting file(s), which can be a very important step, then you unload them and delete them. [Or you delete them on next start (or shutdown), which demands maintaining the coordinates/region files that are scheduled for removal, because a condition might be met to have them kept in that case. Might want not to let players trigger removal and re-generating too fast :p.]
     
Thread Status:
Not open for further replies.

Share This Page