Storing block blueprints in memory

Discussion in 'Plugin Development' started by Ne0nx3r0, Apr 10, 2013.

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

    Ne0nx3r0

    So I was wondering, what's the best way to store a set of small (5x5x5 or less, mostly consisting of air) blueprints of blocks in memory for comparison or construction?

    My initial thought was to use an object list that looks like:
    Code:
    int xOffset;//-x or 0 or +x from starting position
    int yOffset;
    int zOffset; 
    // block data
    
    Then write custom get/comparators/etc. This way a blueprint that only has for example 8 blocks but takes up say a 3x5x3 cube would be relatively smaller than a matrixed array including nulls/air.

    Does this seem sound?
     
  2. Offline

    caseif

    Yes, that would work. I actually created a utility plugin for myself that used this same idea, but rather than storing the blocks to variables, it would write a method to file which would replicate them given an origin.
     
Thread Status:
Not open for further replies.

Share This Page