{
	"rules": [
		{
			"when": "direction != Facing.west",
			"type": "builtin:rotate_facing",
			"from": "Facing.west",
			"to": "direction"
		}
	],
	"variables": {
		"change_speed": "active ? power_average * 0.06 / power_max : 0.01",
		"state": {
			"type": "double",
			"value": "(active) ? (state + change_speed) : ( state > change_speed ? state - change_speed : 0 )",
			"getter": "interpolate_partial_ticks",
			"rounder": "last >= 1.5 && current >= 1.5 ? value - 1 : value",
			"comment": "Starts at 0 when off, goes up to 1.5 then resets back down to 0.5 while active."
		},
		"y1": "1 - abs( (state                            % 1) - 0.5) * 2",
		"y2": "1 - abs( (state <= 0.5 ? 0 : (state - 0.5) % 1) - 0.5) * 2",
		"tex": "power_average <= 0 ? '#off' : '#power_' + (power_average * 6 / power_max)"
	},
	"textures": {
		"#off":     { "location":"buildcraftfactory:blocks/distiller/power_sprite_a", "uv": [ 0, 0, 16, 8 ] },
		"#power_0": "#power_1",
		"#power_1": { "location":"buildcraftfactory:blocks/distiller/power_sprite_a", "uv": [ 0, 8, 16, 16] },
		"#power_2": { "location":"buildcraftfactory:blocks/distiller/power_sprite_b", "uv": [ 0, 0, 16, 8 ] },
		"#power_3": { "location":"buildcraftfactory:blocks/distiller/power_sprite_b", "uv": [ 0, 8, 16, 16] },
		"#power_4": { "location":"buildcraftfactory:blocks/distiller/power_sprite_c", "uv": [ 0, 0, 16, 8 ] },
		"#power_5": { "location":"buildcraftfactory:blocks/distiller/power_sprite_c", "uv": [ 0, 8, 16, 16] },
		"#power_6": { "location":"buildcraftfactory:blocks/distiller/power_sprite_d", "uv": [ 0, 0, 16, 8 ] }
	},
	"elements": [
		{
			"comment": "Right",
			"from": [ 0, "y1 * 12", 12 ],
			"to": [ 8, "(y1 * 12) + 4", 16 ],
			"faces": {
				"down":  { "uv": [ 4, 0, 12, 8 ], "texture": "tex" },
				"up":    { "uv": [ 4, 0, 12, 8 ], "texture": "tex" },
				"north": { "uv": [ 4, 8, 12, 16 ], "texture": "tex" },
				"south": { "uv": [ 4, 8, 12, 16 ], "texture": "tex" },
				"west":  { "uv": [ 0, 8, 4, 16 ], "texture": "tex" },
				"east":  { "uv": [ 0, 8, 4, 16 ], "texture": "tex" }
			}
		},
		{
			"comment": "Left",
			"from": [ 0, "y2 * 12", 0 ],
			"to": [ 8, "(y2 * 12) + 4", 4 ],
			"faces": {
				"down":  { "uv": [ 4, 0, 12, 8 ], "texture": "tex" },
				"up":    { "uv": [ 4, 0, 12, 8 ], "texture": "tex" },
				"north": { "uv": [ 4, 8, 12, 16 ], "texture": "tex" },
				"south": { "uv": [ 4, 8, 12, 16 ], "texture": "tex" },
				"west":  { "uv": [ 0, 8, 4, 16 ], "texture": "tex" },
				"east":  { "uv": [ 0, 8, 4, 16 ], "texture": "tex" }
			}
		}
	]
}