Store Map data in SQL database?

Discussion in 'Plugin Development' started by Pew446, Dec 24, 2012.

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

    Pew446

    I'm working on my plugin, BookShelf, and I want to store maps in the bookshelf, but this requires saving the data of the map to an SQLite database. How would I do this? I don't know what data I would be saving. I am using MapMeta, and I assume I'd be saving lore? I'm pretty lost. If anyone has any ideas, that'd be awesome. Basically I need to save the map in an SQL database to retrieve later.
     
  2. Offline

    fireblast709

    You can get the pixels of the MapView
     
  3. Offline

    Pew446

    Thanks! That sounds like a lot of data to store though... more than 16KB per map. I'll see how it works though.

    How would I get the MapCanvas from the map? MapView won't let me get pixels, but MapCanvas will. I just can't find a way to access the MapCanvas

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 30, 2016
  4. Offline

    Pew446

    Anybody?
     
  5. Offline

    PatPeter

    Hi Pew! Sorry to say that I don't have a solution for you, but I'm in the same boat. Supply and Demand needs a way to store maps to SQL. If I figure it out I'll let you know.
     
  6. Offline

    TGF

    Pew446 PatPeter
    Maybe this:
    PHP:
    public class ClassName extends MapRenderer {
     
    @
    Override
        
    public void getPixels(MapView mapMapCanvas canvasPlayer player) {
            for (
    int x 0128; ++x) {
                for (
    int y 0128; ++y) {
                    
    canvas.getPixel(,y);
                }
          }
    }
    }
     
Thread Status:
Not open for further replies.

Share This Page