{
	"format_version": "1.20.80",
	"minecraft:block": {
		"description": {
			"identifier": "sgs_farm:fun_pipe",
			"menu_category": {
				"category": "items",
				"group": "none"
			},
			"states": {
				"sgs_farm:pipe_north": [0, 1],
				"sgs_farm:pipe_south": [0, 1],
				"sgs_farm:pipe_east": [0, 1],
				"sgs_farm:pipe_west": [0, 1],
				"sgs_farm:pipe_inventory": [0, 1],
				"sgs_farm:network_range": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10,11, 12, 13, 14, 15]
			}
		},
		"components": {
			"minecraft:geometry": {
				"identifier": "geometry.sgs_farm_fun_pipe",
				"bone_visibility": {
					"pipe_inventory": "!q.block_state('sgs_farm:pipe_inventory')",
					"pipe_north": "q.block_state('sgs_farm:pipe_north')",
					"pipe_south": "q.block_state('sgs_farm:pipe_south')",
					"pipe_east": "q.block_state('sgs_farm:pipe_east')",
					"pipe_west": "q.block_state('sgs_farm:pipe_west')"
				}
			},
			"minecraft:custom_components": [
				"sgs_farm:pipe"
			],
			"minecraft:display_name":"Ground Pipe\n§nSprinkler Component§r\n§o§2Crops & Farms§r",	
			"minecraft:destructible_by_mining": {
				"seconds_to_destroy": 0.5
			},
			"tag:sgs_farm_sprinkler_component": {},
			"tag:sgs_farm_pipe": {},
			"minecraft:material_instances": {
				"*": {
					"texture": "sgs_farm_sprinkler",
					"render_method": "alpha_test"
				}
			}
		},
		"permutations": [
			{
				"condition": "q.block_state('sgs_farm:network_range') == 0",
				"components": {
					"minecraft:material_instances": {
						"*": {
							"texture": "sgs_farm_sprinkler",
							"render_method": "alpha_test"
						}
					}
				}
			},
			{
				"condition": "q.block_state('sgs_farm:network_range') > 0",
				"components": {
					"minecraft:material_instances": {
						"*": {
							"texture": "sgs_farm_sprinkler_water",
							"render_method": "alpha_test"
						}
					}
				}
			},
			{
				"condition": "q.block_state('sgs_farm:pipe_north') && !q.block_state('sgs_farm:pipe_south') && !q.block_state('sgs_farm:pipe_west') && q.block_state('sgs_farm:pipe_east')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-8, 0, -8],
						"size": [10, 2, 10]
					},
					"minecraft:selection_box": {
						"origin": [-8, 0, -8],
						"size": [10, 2, 10]
					}
				}
			},
			{
				"condition": "q.block_state('sgs_farm:pipe_north') && !q.block_state('sgs_farm:pipe_south') && q.block_state('sgs_farm:pipe_west') && !q.block_state('sgs_farm:pipe_east')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-2, 0, -8],
						"size": [10, 2, 10]
					},
					"minecraft:selection_box": {
						"origin": [-2, 0, -8],
						"size": [10, 2, 10]
					}
				}
			},
			{
				"condition": "!q.block_state('sgs_farm:pipe_north') && q.block_state('sgs_farm:pipe_south') && !q.block_state('sgs_farm:pipe_west') && q.block_state('sgs_farm:pipe_east')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-8, 0, -2],
						"size": [10, 2, 10]
					},
					"minecraft:selection_box": {
						"origin": [-8, 0, -2],
						"size": [10, 2, 10]
					}
				}
			},
			{
				"condition": "!q.block_state('sgs_farm:pipe_north') && q.block_state('sgs_farm:pipe_south') && q.block_state('sgs_farm:pipe_west') && !q.block_state('sgs_farm:pipe_east')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-2, 0, -2],
						"size": [10, 2, 10]
					},
					"minecraft:selection_box": {
						"origin": [-2, 0, -2],
						"size": [10, 2, 10]
					}
				}
			},
			{
				"condition": "q.block_state('sgs_farm:pipe_north') && q.block_state('sgs_farm:pipe_south') && q.block_state('sgs_farm:pipe_west') && q.block_state('sgs_farm:pipe_east')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-2, 0, -2],
						"size": [8, 2, 8]
					},
					"minecraft:selection_box": {
						"origin": [-8, 0, -8],
						"size": [16, 2, 16]
					}
				}
			},
			{
				"condition": "!q.block_state('sgs_farm:pipe_north') && !q.block_state('sgs_farm:pipe_south') && !q.block_state('sgs_farm:pipe_west') && !q.block_state('sgs_farm:pipe_east')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-2, 0, 2],
						"size": [4, 2, -4]
					},
					"minecraft:selection_box": {
						"origin": [-2, 0, -2],
						"size": [4, 2, 4]
					}
				}
			},
			{
				"condition": "q.block_state('sgs_farm:pipe_north') && q.block_state('sgs_farm:pipe_south') && q.block_state('sgs_farm:pipe_west') && !q.block_state('sgs_farm:pipe_east')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-2, 0, -4],
						"size": [7, 2, 8]
					},
					"minecraft:selection_box": {
						"origin": [-2, 0, -8],
						"size": [10, 2, 16]
					}
				}
			},
			{
				"condition": "q.block_state('sgs_farm:pipe_north') && q.block_state('sgs_farm:pipe_south') && !q.block_state('sgs_farm:pipe_west') && q.block_state('sgs_farm:pipe_east')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-4, 0, -4],
						"size": [6, 2, 8]
					},
					"minecraft:selection_box": {
						"origin": [-8, 0, -8],
						"size": [10, 2, 16]
					}
				}
			},
			{
				"condition": "q.block_state('sgs_farm:pipe_north') && !q.block_state('sgs_farm:pipe_south') && q.block_state('sgs_farm:pipe_west') && q.block_state('sgs_farm:pipe_east')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-4, 0, -4],
						"size": [8, 2, 6]
					},
					"minecraft:selection_box": {
						"origin": [-8, 0, -8],
						"size": [16, 2, 10]
					}
				}
			},
			{
				"condition": "!q.block_state('sgs_farm:pipe_north') && q.block_state('sgs_farm:pipe_south') && q.block_state('sgs_farm:pipe_west') && q.block_state('sgs_farm:pipe_east')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-4, 0, -2],
						"size": [8, 2, 7]
					},
					"minecraft:selection_box": {
						"origin": [-8, 0, -2],
						"size": [16, 2, 10]
					}
				}
			},
			{
				"condition": "q.block_state('sgs_farm:pipe_north') && !q.block_state('sgs_farm:pipe_south') && !q.block_state('sgs_farm:pipe_west') && !q.block_state('sgs_farm:pipe_east')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-2, 0, -8],
						"size": [4, 2, 10]
					},
					"minecraft:selection_box": {
						"origin": [-2, 0, -8],
						"size": [4, 2, 10]
					}
				}
			},
			{
				"condition": "q.block_state('sgs_farm:pipe_south') && !q.block_state('sgs_farm:pipe_north') && !q.block_state('sgs_farm:pipe_west') && !q.block_state('sgs_farm:pipe_east')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-2, 0, -2],
						"size": [4, 2, 10]
					},
					"minecraft:selection_box": {
						"origin": [-2, 0, -2],
						"size": [4, 2, 10]
					}
				}
			},
			{
				"condition": "q.block_state('sgs_farm:pipe_east') && !q.block_state('sgs_farm:pipe_west') && !q.block_state('sgs_farm:pipe_north') && !q.block_state('sgs_farm:pipe_south')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-8, 0, -2],
						"size": [10, 2, 4]
					},
					"minecraft:selection_box": {
						"origin": [-8, 0, -2],
						"size": [10, 2, 4]
					}
				}
			},
			{
				"condition": "q.block_state('sgs_farm:pipe_west') && !q.block_state('sgs_farm:pipe_east') && !q.block_state('sgs_farm:pipe_north') && !q.block_state('sgs_farm:pipe_south')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-2, 0, -2],
						"size": [10, 2, 4]
					},
					"minecraft:selection_box": {
						"origin": [-2, 0, -2],
						"size": [10, 2, 4]
					}
				}
			},
			{
				"condition": "q.block_state('sgs_farm:pipe_north') && q.block_state('sgs_farm:pipe_south') && !q.block_state('sgs_farm:pipe_west') && !q.block_state('sgs_farm:pipe_east')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-2, 0, -8],
						"size": [4, 2, 16]
					},
					"minecraft:selection_box": {
						"origin": [-2, 0, -8],
						"size": [4, 2, 16]
					}
				}
			},
			{
				"condition": "!q.block_state('sgs_farm:pipe_north') && !q.block_state('sgs_farm:pipe_south') && q.block_state('sgs_farm:pipe_west') && q.block_state('sgs_farm:pipe_east')",
				"components": {
					"minecraft:collision_box": {
						"origin": [-8, 0, -2],
						"size": [16, 2, 4]
					},
					"minecraft:selection_box": {
						"origin": [-8, 0, -2],
						"size": [16, 2, 4]
					}
				}
			}
		]
	}
}