public static BlockType getBlockType(Block block){

		short[][] cellsWithLayers = block.getCells();

		int layerCount = 0;
		for(short[] layeredCell : cellsWithLayers){
			layerCount = Math.max(layerCount, layeredCell.length);
		}

		if(layerCount > 1){
			return BlockType.MULTILEVEL;
		} else {

			for(short[] layeredCell : cellsWithLayers){
				if(layeredCell.length == 0){
					return BlockType.COMPLEX;
				}
			}

			short first = cellsWithLayers[0][0];

			for(short[] layeredCell : cellsWithLayers){
				if(layeredCell[0] != first){
					return BlockType.COMPLEX;
				}
			}

			if((first & 0x0f) != (NSWEClient.NSWE.getValue())){
				System.out.println("Flat block represented as complex: " + Integer.toBinaryString(first & 0x0f));
				return BlockType.COMPLEX;
			}

			return BlockType.FLAT;
		}
	}