{
    "textures": {
        "#sprite_a":"buildcraftfactory:blocks/heat_exchange/sprite_a",
        "#sprite_b":"buildcraftfactory:blocks/heat_exchange/sprite_b",
        "#sprite_c":"buildcraftfactory:blocks/heat_exchange/sprite_c",
        "#sprite_d":"buildcraftfactory:blocks/heat_exchange/sprite_d",
        "#sprite_e":"buildcraftfactory:blocks/heat_exchange/sprite_e"
    },
    "rules": [
        {
            "when": "direction != Facing.west",
            "type": "builtin:rotate_facing",
            "from": "Facing.west",
            "to": "direction"
        }
    ],
    "elements": [
        {
            "comment": "Inner Pipe",
            "both_sides": "true",
            "from": [4, 4, 0],
            "to": [12, 12, 16],
            "faces": {
                "up":   { "uv": [ 0, 0, 16, 8 ], "texture": "#sprite_a", "rotation": 1 },
                "down": { "uv": [ 0, 0, 16, 8 ], "texture": "#sprite_a", "rotation": 1 },
                "east": { "uv": [ 0, 0, 16, 8 ], "texture": "#sprite_a" },
                "west": { "uv": [ 0, 0, 16, 8 ], "texture": "#sprite_a" }
            }
        },
        {
            "comment": "Outer Pipe",
            "visible": "part == MIDDLE",
            "both_sides": "true",
            "from": [ 2, 2, 0 ],
            "to": [ 14, 14, 16 ],
            "faces": {
                "up":   { "uv": [ 0, 0, 16, 12 ], "texture": "#sprite_d", "rotation": 1 },
                "down": { "uv": [ 0, 0, 16, 12 ], "texture": "#sprite_d", "rotation": 1 },
                "east": { "uv": [ 0, 0, 16, 12 ], "texture": "#sprite_d" },
                "west": { "uv": [ 0, 0, 16, 12 ], "texture": "#sprite_d" }
            }
        },
        {
            "comment": "Middle pipe cap (if its not connected on the left side)",
            "visible": "part == MIDDLE && !connected_left",
            "both_sides": "true",
            "from": [ 2, 2, 0 ],
            "to": [ 14, 14, 16 ],
            "faces": {
                "north": { "uv": [ 0, 0, 12, 12 ], "texture": "#sprite_b" }
            }
        },
        {
            "comment": "Middle pipe cap (if its not connected on the right side)",
            "visible": "part == MIDDLE && !connected_right",
            "both_sides": "true",
            "from": [ 2, 2, 0 ],
            "to": [ 14, 14, 16 ],
            "faces": {
                "south": { "uv": [ 0, 0, 12, 12 ], "texture": "#sprite_b" }
            }
        },
        {
            "comment": "Start outer pipe - vertical connector (down)",
            "visible": "part == START",
            "both_sides": "true",
            "from": [2, 0, 2],
            "to": [14, 14, 16],
            "faces": {
                "east":  { "uv": [ 2, 0, 16, 14 ], "texture": "#sprite_c", "rotation": 3 },
                "west":  { "uv": [ 2, 0, 16, 14 ], "texture": "#sprite_c", "rotation": 1 },
                "up":    { "uv": [ 0, 0, 12, 12 ], "texture": "#sprite_e", "rotation": 3 },
                "north": { "uv": [ 0, 0, 12, 12 ], "texture": "#sprite_e", "rotation": 1 }
            }
        },
        {
            "comment": "End outer pipe - vertical connector (up)",
            "visible": "part == END",
            "both_sides": "true",
            "from": [2, 2, 0],
            "to": [14, 16, 14],
            "faces": {
                "east":  { "uv": [ 2, 0, 16, 14 ], "texture": "#sprite_c", "rotation": 1 },
                "west":  { "uv": [ 2, 0, 16, 14 ], "texture": "#sprite_c", "rotation": 3 },
                "down":  { "uv": [ 0, 0, 12, 12 ], "texture": "#sprite_e", "rotation": 3 },
                "south": { "uv": [ 0, 0, 12, 12 ], "texture": "#sprite_e", "rotation": 1 }
            }
        }
    ]
}