local tool_repair ={
   {'default:sword_diamond', 'default:diamond'},
   {'default:axe_diamond', 'default:diamond'},
   {'default:shovel_diamond', 'default:diamond'},
   {'default:pick_diamond', 'default:diamond'},
   {'default:sword_mese', 'default:mese_crystal'},
   {'default:axe_mese', 'default:mese_crystal'},
   {'default:shovel_mese', 'default:mese_crystal'},
   {'default:pick_mese', 'default:mese_crystal'},
   {'3d_armor:boots_diamond', 'default:diamond'},
   {'3d_armor:chestplate_diamond', 'default:diamond'},
   {'3d_armor:helmet_diamond', 'default:diamond'},
   {'3d_armor:leggings_diamond', 'default:diamond'},
   {'shields:shield_diamond', 'default:diamond'},
   {'epic:axe_glowingdiamond', 'epic:glowingdiamond'},
   {'epic:pick_glowingdiamond', 'epic:glowingdiamond'},
   {'epic:shovel_glowingdiamond', 'epic:glowingdiamond'},
   {'epic:sword_glowingdiamond', 'epic:glowingdiamond'},
}

for i in ipairs (tool_repair) do
   local tool = tool_repair[i][1]
   local matrl = tool_repair[i][2]

   simplecrafting_lib.register('crystal_w', {
      input = {
         [tool] = 1,
         [matrl] = 1,
         ['stations:chitin'] = 1,
      },
      output = tool,
   })
end

--Diamond tools
stations.dual_register_recipe('crystal_w', {
   input = {
      ['stations:chitin'] = 1,
      ['default:diamond'] = 3,
   },
   output = 'default:sword_diamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['stations:chitin'] = 1,
      ['default:diamond'] = 3,
      ['group:stick'] = 1,
   },
   output = 'default:axe_diamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['stations:chitin'] = 1,
      ['default:diamond'] = 3,
      ['group:stick'] = 1,
   },
   output = 'default:pick_diamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['stations:chitin'] = 1,
      ['default:diamond'] = 1,
      ['group:stick'] = 2,
   },
   output = 'default:shovel_diamond',
})

--Mese tools
stations.dual_register_recipe('crystal_w', {
   input = {
      ['stations:chitin'] = 1,
      ['default:mese_crystal'] = 3,
      ['group:stick'] = 1,
   },
   output = 'default:pick_mese',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['stations:chitin'] = 1,
      ['default:mese_crystal'] = 3,
      ['group:stick'] = 1,
   },
   output = 'default:axe_mese',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['stations:chitin'] = 1,
      ['default:mese_crystal'] = 1,
      ['group:stick'] = 2,
   },
   output = 'default:shovel_mese',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['stations:chitin'] = 1,
      ['default:mese_crystal'] = 3,
   },
   output = 'default:sword_mese',
})

--glowingdiamond Tools
stations.dual_register_recipe('crystal_w', {
   input = {
      ['stations:chitin'] = 1,
      ['epic:glowingdiamond'] = 3,
   },
   output = 'epic:sword_glowingdiamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['stations:chitin'] = 1,
      ['epic:glowingdiamond'] = 3,
      ['group:stick'] = 1,
   },
   output = 'epic:axe_glowingdiamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['stations:chitin'] = 1,
      ['epic:glowingdiamond'] = 3,
      ['group:stick'] = 1,
   },
   output = 'epic:pick_glowingdiamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['stations:chitin'] = 1,
      ['epic:glowingdiamond'] = 1,
      ['group:stick'] = 2,
   },
   output = 'epic:shovel_glowingdiamond',
})

--armor_material caverealms:salt_gem,
--{'epic:float_crystal', 'gravity'},
--{'epic:bloodstone', 'healing'},
--{'epic:huntite', 'fire'},
--{'ocean:prismarine_crystals', 'water'},
--{'epic:garnet', 'speed'},
--{'quartz:quartz_crystal_piece', 'jump'}
local armor_material = {
   gravity = 'epic:float_crystal',
   healing = 'epic:bloodstone',
   water = 'ocean:prismarine_crystals',
   fire = 'epic:huntite',
   speed = 'epic:garnet',
}

for name, mat in pairs(armor_material) do
   stations.dual_register_recipe('crystal_w', {
      input = {
         ['default:diamond'] = 5,
         ['mobs:leather'] = 1,
         ['stations:chitin'] = 1,
         [mat] = 1,
      },
      output = 'epic:helmet_'..name,
   })

   stations.dual_register_recipe('crystal_w', {
      input = {
         ['default:diamond'] = 8,
         ['mobs:leather'] = 1,
         ['stations:chitin'] = 1,
         [mat] = 1,
      },
      output = 'epic:chestplate_'..name,
   })

   stations.dual_register_recipe('crystal_w', {
      input = {
         ['default:diamond'] = 7,
         ['mobs:leather'] = 1,
         ['stations:chitin'] = 1,
         [mat] = 1,
      },
      output = 'epic:leggings_'..name,
   })

   stations.dual_register_recipe('crystal_w', {
      input = {
         ['default:diamond'] = 4,
         ['mobs:leather'] = 1,
         ['stations:chitin'] = 1,
         [mat] = 1,
      },
      output = 'epic:boots_'..name,
   })

   stations.dual_register_recipe('crystal_w', {
      input = {
         ['default:diamond'] = 5,
         ['group:fabric'] = 1,
         ['stations:chitin'] = 1,
         [mat] = 1,
      },
      output = 'epic:helmet_'..name,
   })

   stations.dual_register_recipe('crystal_w', {
      input = {
         ['default:diamond'] = 8,
         ['group:fabric'] = 1,
         ['stations:chitin'] = 1,
         [mat] = 1,
      },
      output = 'epic:chestplate_'..name,
   })

   stations.dual_register_recipe('crystal_w', {
      input = {
         ['default:diamond'] = 7,
         ['group:fabric'] = 1,
         ['stations:chitin'] = 1,
         [mat] = 1,
      },
      output = 'epic:leggings_'..name,
   })

   stations.dual_register_recipe('crystal_w', {
      input = {
         ['default:diamond'] = 4,
         ['group:fabric'] = 1,
         ['stations:chitin'] = 1,
         [mat] = 1,
      },
      output = 'epic:boots_'..name,
   })

   stations.dual_register_recipe('crystal_w', {
      input = {
         ['default:diamond'] = 1,
         ['epic:helmet_'..name] = 1,
         ['stations:chitin'] = 1,
         [mat] = 1,
      },
      output = 'epic:helmet_'..name,
   })

   simplecrafting_lib.register('crystal_w', {
      input = {
         ['default:diamond'] = 1,
         ['epic:chestplate_'..name] = 1,
         ['stations:chitin'] = 1,
         [mat] = 1,
      },
      output = 'epic:chestplate_'..name,
   })

   simplecrafting_lib.register('crystal_w', {
      input = {
         ['default:diamond'] = 1,
         ['epic:leggings_'..name] = 1,
         ['stations:chitin'] = 1,
         [mat] = 1,
      },
      output = 'epic:leggings_'..name,
   })

   simplecrafting_lib.register('crystal_w', {
      input = {
         ['default:diamond'] = 1,
         ['epic:boots_'..name] = 1,
         ['stations:chitin'] = 1,
         [mat] = 1,
      },
      output = 'epic:boots_'..name,
   })

end

--Diamond armor
stations.dual_register_recipe('crystal_w', {
   input = {
      ['default:diamond'] = 5,
      ['mobs:leather'] = 1,
      ['stations:chitin'] = 1,
   },
   output = '3d_armor:helmet_diamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['default:diamond'] = 8,
      ['mobs:leather'] = 1,
      ['stations:chitin'] = 1,
   },
   output = '3d_armor:chestplate_diamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['default:diamond'] = 7,
      ['mobs:leather'] = 1,
      ['stations:chitin'] = 1,
   },
   output = '3d_armor:leggings_diamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['default:diamond'] = 4,
      ['mobs:leather'] = 1,
      ['stations:chitin'] = 1,
   },
   output = '3d_armor:boots_diamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['default:diamond'] = 7,
      ['mobs:leather'] = 1,
      ['stations:chitin'] = 1,
   },
   output = 'shields:shield_diamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['default:diamond'] = 5,
      ['group:fabric'] = 1,
      ['stations:chitin'] = 1,
   },
   output = '3d_armor:helmet_diamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['default:diamond'] = 8,
      ['group:fabric'] = 1,
      ['stations:chitin'] = 1,
   },
   output = '3d_armor:chestplate_diamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['default:diamond'] = 7,
      ['group:fabric'] = 1,
      ['stations:chitin'] = 1,
   },
   output = '3d_armor:leggings_diamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['default:diamond'] = 4,
      ['group:fabric'] = 1,
      ['stations:chitin'] = 1,
   },
   output = '3d_armor:boots_diamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['default:diamond'] = 7,
      ['group:fabric'] = 1,
      ['stations:chitin'] = 1,
   },
   output = 'shields:shield_diamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['default:mese_crystal'] = 1,
   },
   output = 'mobs:horseshoe_mese',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['default:diamond'] = 1,
   },
   output = 'mobs:horseshoe_diamond',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['epic:float_crystal_shard'] = 20,
      ['stations:chitin'] = 1,
   },
   output = 'epic:float_crystal',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['epic:float_crystal'] = 5,
      ['default:diamondblock'] = 1,
      ['default:mese'] = 1,
      ['stations:chitin'] = 6,
   },
   output = 'epic:laputa',
})

stations.dual_register_recipe('crystal_w', {
   input = {
      ['epic:glowstone_fragment'] = 1,
      ['default:diamond'] = 1,
      ['stations:chitin'] = 2,
   },
   output = 'epic:glowingdiamond',
})
