minetest.register_alias("darkage:lamp",        "castle_lighting:light")
minetest.register_alias("castle:street_light", "castle_lighting:light")
minetest.register_alias("castle:light",        "castle_lighting:light")
minetest.register_alias("castle:chandelier",   "castle_lighting:chandelier")
minetest.register_alias("castle:chandelier_chain",   "castle_lighting:chandelier_chain")

local MP = minetest.get_modpath(minetest.get_current_modname())
local S = minetest.get_translator(minetest.get_current_modname())

castle_lighting = {}

dofile(MP.."/brasier.lua")

minetest.register_node("hades_castle_lighting:light",{
	drawtype = "glasslike",
	description = S("Light Block"),
	sunlight_propagates = true,
	light_source = 14,
	tiles = {"castle_street_light.png"},
	groups = {cracky=2},
	sounds = hades_sounds.node_sound_glass_defaults(),
	paramtype = "light",
})

minetest.register_craft({
	output = "hades_castle_lighting:light",
	recipe = {
		{"hades_core:stick", "hades_core:glass", "hades_core:stick"},
		{"hades_core:glass", "hades_torches:torch", "hades_core:glass"},
		{"hades_core:stick", "hades_core:glass", "hades_core:stick"},
	}
})

minetest.register_node("hades_castle_lighting:chandelier", {
	drawtype = "plantlike",
	description = S("Chandelier"),
	paramtype = "light",
	wield_image = "castle_chandelier_wield.png",
	inventory_image = "castle_chandelier_wield.png", 
	groups = {cracky=2},
	sounds = hades_sounds.node_sound_glass_defaults(),
	sunlight_propagates = true,
	light_source = 14,
	tiles = {
			{
			name = "castle_chandelier.png",
			animation = {
				type = "vertical_frames",
				aspect_w = 16,
				aspect_h = 16,
				length = 1.0
			},
		},
	},
	selection_box = {
		type = "fixed",
			fixed = {
				{0.35,-0.375,0.35,-0.35,0.5,-0.35},

		},
	},
})

minetest.register_craft({
	output = "hades_castle_lighting:chandelier",
	recipe = {
		{"", "", ""},
		{"", "hades_core:steel_ingot", ""},
		{"hades_torches:torch","hades_torches:torch","hades_torches:torch"},
	}
})

minetest.register_node("hades_castle_lighting:chandelier_chain", {
	drawtype = "plantlike",
	description = S("Chandelier Chain"),
	paramtype = "light",
	wield_image = "castle_chandelier_chain.png",
	inventory_image = "castle_chandelier_chain.png", 
	groups = {cracky=2},
	sounds = hades_sounds.node_sound_glass_defaults(),
	sunlight_propagates = true,
	tiles = {"castle_chandelier_chain.png"},
	selection_box = {
		type = "fixed",
			fixed = {
				{0.1,-0.5,0.1,-0.1,0.5,-0.1},

		},
	},
})

minetest.register_craft({
	output = "hades_castle_lighting:chandelier_chain 4",
	recipe = {
		{"", "hades_core:steel_ingot", ""},
		{"", "", ""},
		{"","hades_core:steel_ingot",""},
	}
})
