Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Block storage?

Comments in 'Plugin Development' started by xBeastMode, Apr 11, 2016.

  1. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    Is there a way to save blocks inside code without having to create a backup and then reset those blocks again?
  2. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    Upon block related events, save original blocks into an array and place the original blocks when you want to restore it.
    Skullex likes this.
  3. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    I already do that but, won't that be too large for a single array?
  4. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    I guess you can sort the blocks out depending on block ID, Y coordinate or player who triggered it, or you can make a new array when the other arrays have 100 data stored, but either way, you would end up with a large amount of data.
    Does something bad happen if there are too many objects in one array, though?
    Skullex likes this.
  5. xBeastMode
    Offline

    xBeastMode Active Member

    Joined:
    Nov 27, 2015
    Posts:
    292
    Array is unlimited, but it takes up memory so that's why it would be a problem.
  6. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    That's why Minecraft world is in chunks. Write it on file and compress it.

Share This Page

Advertisement