[solved I'm sure] Restore Blocks?

Discussion in 'Plugin Development' started by Bobfan, Mar 12, 2013.

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

    Bobfan

    I plan on having a command to restore destroyed blocks, but does anyone know the best way to do that?
     
  2. Offline

    ZeusAllMighty11

    Log them everytime they are destroyed, and log their coordinates .


    Note that this will cause lag if you've never done this before because efficiency comes from practicing with it.
     
  3. Offline

    Bobfan

    I mean format wise. Would a .yml file be good enough, because I thought there was a better way?
     
  4. Offline

    ZeusAllMighty11

    Well personally if I didn't get many players and it was kind of a test rollback, I'd store to YML just because it's my most familiar and easy to use format for saving, setting, retrieving, loading.
     
  5. Offline

    Bobfan

    What about a MASS demolition of blocks, lets say, 6,000 blocks in a couple minutes, (at most) because I want to be sure, and not have to recode it.

    edit: What it is used for, to be more specific. I am making an Avengers plugin, and nobody really wants their cities destroyed, unless they can regenerate it.
     
  6. Offline

    Darq

    Well I wouldn't use YAML to store a large amount of block breakage data. You're definitely going to see a significant amount of time used just parsing and saving the file.

    MySQL is a safe bet, though - quite a bit more setup required, but a query to get thousands of block breaks won't take long at all.
     
    Bobfan likes this.
  7. Offline

    Bobfan

    Looks like a hassle. Than again they both do. I am thinking about having a .yml file store the blocks data, because I only plan on using it on command. It wouldn't be stored every time someone breaks a block. 2 commands: one to save the blocks, and one to regenerate the blocks.
     
Thread Status:
Not open for further replies.

Share This Page