Best way to save a 3D array?

Discussion in 'Plugin Development' started by bowman3002, Dec 3, 2011.

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

    bowman3002

    I'm writing a plugin where i need to save a 3D array (of ints for the material data and bytes for the data values for an area of blocks) and I need to save the arrays to a file which can be read back into the plugin when it is started again. The problem is I'm not sure what is the best method to do this. Can anyone give me some suggestions?

    Thanks,
    Bowman3002
     
  2. Offline

    Sagacious_Zed Bukkit Docs

  3. Offline

    Jogy34

    You could save it like this in a custom config file:
    Code:
    Array1:
        Array1-1:
            Array1-1-1:
                1
                2
                3
            Array1-1-2:
                4
                5
                6
            Array1-1-3:
                7
                8
                9
        Array1-2:
            Array1-2-1:
                1
                2
                3
            Array1-2-2:
                4
                5
                6
            Array1-2-3:
                7
                8
                9
    //etc...
    
     
Thread Status:
Not open for further replies.

Share This Page