public int getBlockTypeIdFromPixel(int imagePixel) {
        int blockTypeId = -1;
        String[] line = (String[])groups.get(imagePixel);
        if(line != null) {
            int newBlockType = blockManager.getRandomIdByGroup(line[0]);
            if(newBlockType > 0) {
                blockTypeId = newBlockType;
            }
        }
        line = (String[])blockTypes.get(imagePixel);
        if(line != null) {
            int newBlockType = Integer.parseInt(line[line.length - 1]);
            if(newBlockType > 0) {
                blockTypeId = newBlockType;
            }
        }
        int blockTypeOverrideId = getBlockTypeOverrideIdFromPixel(imagePixel);
        if(blockTypeOverrideId > 0) {
            blockTypeId = blockTypeOverrideId;
        }
        return blockTypeId;
    }