public static IBlockState[][][] getStateMap(
      EnumFacing dir,
      String mapName,
      IBlockState wallBlock,
      IBlockState wallBlock_external,
      IBlockState floorBlock,
      IBlockState ceilBlock,
      IBlockState fenceBlock,
      IBlockState carpetBlock,
      IBlockState glass1,
      IBlockState glass2,
      IBlockState glass3,
      IBlockState window,
      IBlockState mineral,
      int dyeColorIndex) {
    final boolean hasShop = fenceBlock != null;
    final boolean hasBeacon = !hasShop && mineral != null;
    final int mapIndex = EnumStateMap.valueOf(mapName).ordinal();
    final Map<EnumFacing, IBlockState[][][]> map = maps.get(wallBlock_external)[mapIndex];
    final IBlockState[][][] stateMap;
    final IBlockState air2 = Blocks.AIR.getDefaultState(),
        lever = !hasBeacon ? Blocks.LEVER.getStateFromMeta(7) : glass2 != null ? glass2 : air2,
        glass = Blocks.GLASS.getDefaultState(),
        lamp = !hasBeacon ? Blocks.REDSTONE_LAMP.getDefaultState() : glass1,
        wire = !hasBeacon ? Blocks.REDSTONE_WIRE.getDefaultState() : air2;
    if (mapName.startsWith("MINI_TOWER_TOP")) {
      EnumFacing pressurePlateDir = null;
      if (floorBlock.getBlock() instanceof BlockTrapDoor) {
        pressurePlateDir = floorBlock.getValue(BlockTrapDoor.FACING);
        floorBlock = MazeTowers.BlockMazeTowerThreshold.getDefaultState();
      }
      map.put(
          dir,
          !hasShop
              ? getTopMap(
                  air2,
                  wallBlock_external,
                  carpetBlock,
                  window,
                  floorBlock,
                  lever,
                  mineral,
                  pressurePlateDir)
              : getTopMapShop(air2, wallBlock_external, carpetBlock, window, fenceBlock, mineral));
    } else if (mapName.startsWith("MINI_TOWER_ROOF")) {
      if (mapName.equals("MINI_TOWER_ROOF_WIRE"))
        map.put(dir, getRoofWire(air2, wallBlock_external, wire, glass3));
      else map.put(dir, getRoof(fenceBlock, glass, glass1, glass2, glass3));
    } else if (mapName.startsWith("MINI_TOWER_CEILING_"))
      map.put(dir, getCeiling(air2, wallBlock_external, wallBlock, ceilBlock, glass1, lamp));
    else if (mapName.equals("MINI_TOWER_BASE")) {
      map.get(dir)[0][4][4] = floorBlock;
    }

    return map.get(dir);
  }
  public static IBlockState[][][][] getStateMaps(
      EnumFacing dir,
      IBlockState wallBlock,
      IBlockState wallBlock_external,
      IBlockState floorBlock,
      IBlockState ceilBlock,
      IBlockState fenceBlock,
      IBlockState carpetBlock,
      IBlockState commonGlass,
      IBlockState topGlass2,
      IBlockState topGlass3,
      IBlockState beaconGlass2,
      IBlockState beaconGlass3,
      IBlockState window,
      IBlockState mineral,
      int dyeColorIndex,
      boolean hasShop) {
    final boolean hasBeacon = !hasShop && mineral != null;
    IBlockState[][][][] stateMap = new IBlockState[6][][][];
    EnumFacing pressurePlateDir = null;
    int index = 0;
    for (EnumStateMap s : EnumStateMap.values()) {
      final String mapName = s.name(), lastChar = mapName.substring(mapName.length() - 1);
      if (StringUtils.isNumeric(lastChar)) {
        if (Integer.parseInt(lastChar) != dyeColorIndex + 1) continue;
      }
      final int mapIndex = EnumStateMap.valueOf(mapName).ordinal();
      final Map<EnumFacing, IBlockState[][][]> map = maps.get(wallBlock_external)[mapIndex];
      final IBlockState air = Blocks.AIR.getDefaultState(),
          lever =
              !hasBeacon
                  ? Blocks.LEVER.getStateFromMeta(7)
                  : beaconGlass2 != null ? beaconGlass2 : air,
          glass = Blocks.GLASS.getDefaultState(),
          lamp = !hasBeacon ? Blocks.REDSTONE_LAMP.getDefaultState() : commonGlass,
          wire = !hasBeacon ? Blocks.REDSTONE_WIRE.getDefaultState() : air;
      if (mapName.startsWith("MINI_TOWER_TOP"))
        map.put(
            dir,
            !hasShop
                ? getTopMap(
                    air,
                    wallBlock_external,
                    carpetBlock,
                    window,
                    floorBlock,
                    lever,
                    mineral,
                    pressurePlateDir)
                : getTopMapShop(air, wallBlock_external, carpetBlock, window, fenceBlock, mineral));
      else if (mapName.startsWith("MINI_TOWER_ROOF")) {
        if (mapName.equals("MINI_TOWER_ROOF_WIRE"))
          map.put(dir, getRoofWire(air, wallBlock_external, wire, beaconGlass3));
        else map.put(dir, getRoof(fenceBlock, glass, commonGlass, topGlass2, topGlass3));
      } else if (mapName.startsWith("MINI_TOWER_CEILING_"))
        map.put(dir, getCeiling(air, wallBlock_external, wallBlock, ceilBlock, commonGlass, lamp));
      else if (mapName.equals("MINI_TOWER_BASE")) {
        map.get(dir)[0][4][4] = floorBlock;
        if (floorBlock.getBlock() instanceof BlockTrapDoor) {
          pressurePlateDir = floorBlock.getValue(BlockTrapDoor.FACING);
          floorBlock = MazeTowers.BlockMazeTowerThreshold.getDefaultState();
        }
      }
      stateMap[index++] = map.get(dir);
    }

    return stateMap;
  }