package ethanjones.modularworld.world.storage;

import ethanjones.modularworld.block.Block;

public class Area {
  
  public static final int S = 32;
  
  public final int x;
  public final int y;
  public final int z;
  
  public boolean generated = false;
  
  private Block[][][] blocks = new Block[S][S][S];
  
  /**
   * In area coords
   */
  public Area(int x, int y, int z) {
    this.x = x;
    this.y = y;
    this.z = z;
  }
  
  public Block getBlock(int x, int y, int z) {
    return blocks[Math.abs(x % S)][Math.abs(y % S)][Math.abs(z % S)];
  }
  
  public Block[][][] getBlocks() {
    return blocks;
  }
  
  public void setBlock(Block block, int x, int y, int z) {
    blocks[Math.abs(x % S)][Math.abs(y % S)][Math.abs(z % S)] = block;
  }
}

@@ -211,24 +211,213 @@
 l int z;%0A  %0A
+  public final int maxNormalX;%0A  public final int maxNormalY;%0A  public final int maxNormalZ;%0A  public final int minNormalX;%0A  public final int minNormalY;%0A  public final int minNormalZ;%0A  %0A
   public boo
@@ -614,16 +614,201 @@
 .z = z;%0A
+    %0A    maxNormalX = ((x + 1) * S) - 1;%0A    maxNormalY = ((y + 1) * S) - 1;%0A    maxNormalZ = ((z + 1) * S) - 1;%0A    minNormalX = x * S;%0A    minNormalY = y * S;%0A    minNormalZ = z * S;%0A
   %7D%0A  %0A 

Add min & max in Area