Change indentation, fix sunlight_propagates spelling

This commit is contained in:
random-geek 2020-09-14 21:36:35 -07:00
parent f74339235d
commit d782f5d665
5 changed files with 760 additions and 758 deletions

@ -1,53 +1,53 @@
morelights = {} morelights = {}
if minetest.get_modpath("xpanes") then if minetest.get_modpath("xpanes") then
morelights.glass = "xpanes:pane_flat" morelights.glass = "xpanes:pane_flat"
else else
morelights.glass = "default:glass" morelights.glass = "default:glass"
end end
function morelights.register_variants(variants, fixedDef) function morelights.register_variants(variants, fixedDef)
for _,variant in ipairs(variants) do for _, variant in ipairs(variants) do
local name = variant.name local name = variant.name
local def = table.copy(fixedDef) local def = table.copy(fixedDef)
for k,v in pairs(variant) do for k,v in pairs(variant) do
if k ~= "name" then if k ~= "name" then
def[k] = v def[k] = v
end end
end
minetest.register_node(name, def)
end end
minetest.register_node(name, def)
end
end end
function morelights.on_place_hanging(itemstack, placer, pointed_thing, replaceName) function morelights.on_place_hanging(itemstack, placer, pointed_thing, replaceName)
local ceiling = minetest.get_node(vector.add(pointed_thing.above, local ceiling = minetest.get_node(vector.add(pointed_thing.above,
{x=0, y=1, z=0})) {x=0, y=1, z=0}))
if ceiling and ceiling.name ~= "air" if ceiling and ceiling.name ~= "air"
and minetest.get_item_group(ceiling.name, "mounted_ceiling") == 0 and minetest.get_item_group(ceiling.name, "mounted_ceiling") == 0
and not (placer and placer:get_player_control().sneak) then and not (placer and placer:get_player_control().sneak) then
local name = itemstack:get_name() local name = itemstack:get_name()
local fakestack = itemstack local fakestack = itemstack
fakestack:set_name(replaceName) fakestack:set_name(replaceName)
minetest.item_place(fakestack, placer, pointed_thing, 0) minetest.item_place(fakestack, placer, pointed_thing, 0)
itemstack:set_name(name) itemstack:set_name(name)
return itemstack
end
minetest.item_place(itemstack, placer, pointed_thing, 0)
return itemstack return itemstack
end
minetest.item_place(itemstack, placer, pointed_thing, 0)
return itemstack
end end
function morelights.rotate_and_place(itemstack, placer, pointed_thing, lookup) function morelights.rotate_and_place(itemstack, placer, pointed_thing, lookup)
local dir = minetest.dir_to_wallmounted(vector.subtract(pointed_thing.under, pointed_thing.above)) local dir = minetest.dir_to_wallmounted(vector.subtract(pointed_thing.under, pointed_thing.above))
local fDirs = lookup or {[0] = 20, 0, 16, 12, 8, 4} local fDirs = lookup or {[0] = 20, 0, 16, 12, 8, 4}
minetest.item_place(itemstack, placer, pointed_thing, fDirs[dir] or 0) minetest.item_place(itemstack, placer, pointed_thing, fDirs[dir] or 0)
return itemstack return itemstack
end end
local path = minetest.get_modpath("morelights") local path = minetest.get_modpath("morelights")

@ -1,121 +1,123 @@
minetest.register_craftitem("morelights:bulb", { minetest.register_craftitem("morelights:bulb", {
description = "Light Bulb", description = "Light Bulb",
inventory_image = "morelights_bulb.png" inventory_image = "morelights_bulb.png"
}) })
morelights.register_variants({ morelights.register_variants({
{name = "morelights:pole_d", description = "Metal Pole (dark)", {name = "morelights:pole_d", description = "Metal Pole (dark)",
tiles = {"morelights_metal_dark_32.png"}, tiles = {"morelights_metal_dark_32.png"},
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return morelights.on_place_hanging(itemstack, placer, pointed_thing, return morelights.on_place_hanging(itemstack, placer, pointed_thing,
"morelights:pole_ceiling_d") "morelights:pole_ceiling_d")
end}, end},
{name = "morelights:pole_l", description = "Metal Pole (light)", {name = "morelights:pole_l", description = "Metal Pole (light)",
tiles = {"morelights_metal_light_32.png"}, tiles = {"morelights_metal_light_32.png"},
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return morelights.on_place_hanging(itemstack, placer, pointed_thing, return morelights.on_place_hanging(itemstack, placer, pointed_thing,
"morelights:pole_ceiling_l") "morelights:pole_ceiling_l")
end} end}
}, },
{ {
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = {-1/32, -1/2, -1/32, 1/32, 1/2, 1/32} fixed = {-1/32, -1/2, -1/32, 1/32, 1/2, 1/32}
}, },
selection_box = { selection_box = {
type = "wallmounted", type = "wallmounted",
wall_bottom = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16}, wall_bottom = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
wall_side = {-1/2, -1/16, -1/16, 1/2, 1/16, 1/16}, wall_side = {-1/2, -1/16, -1/16, 1/2, 1/16, 1/16},
wall_top = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16} wall_top = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16}
}, },
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
sunlight_propegates = true, sunlight_propagates = true,
groups = {cracky = 3, oddly_breakable_by_hand = 3, mounted_ceiling = 1}, groups = {cracky = 3, oddly_breakable_by_hand = 3, mounted_ceiling = 1},
sounds = default.node_sound_metal_defaults(), sounds = default.node_sound_metal_defaults(),
}) })
morelights.register_variants({ morelights.register_variants({
{name = "morelights:pole_ceiling_d", {name = "morelights:pole_ceiling_d",
tiles = {"morelights_metal_dark_32.png"}, drop = "morelights:pole_d"}, tiles = {"morelights_metal_dark_32.png"}, drop = "morelights:pole_d"},
{name = "morelights:pole_ceiling_l", {name = "morelights:pole_ceiling_l",
tiles = {"morelights_metal_light_32.png"}, drop = "morelights:pole_l"} tiles = {"morelights_metal_light_32.png"}, drop = "morelights:pole_l"}
}, },
{ {
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = {{-3/16, -7/16, -3/16, 3/16, -1/2, 3/16}, fixed = {{-3/16, -7/16, -3/16, 3/16, -1/2, 3/16},
{-1/32, 1/2, -1/32, 1/32, -7/16, 1/32}} {-1/32, 1/2, -1/32, 1/32, -7/16, 1/32}}
}, },
selection_box = { selection_box = {
type = "wallmounted", type = "wallmounted",
wall_bottom = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16}, wall_bottom = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
wall_side = {-1/2, -1/16, -1/16, 1/2, 1/16, 1/16}, wall_side = {-1/2, -1/16, -1/16, 1/2, 1/16, 1/16},
wall_top = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16} wall_top = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16}
}, },
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
sunlight_propegates = true, sunlight_propagates = true,
groups = {cracky = 3, oddly_breakable_by_hand = 3, groups = {cracky = 3, oddly_breakable_by_hand = 3,
not_in_creative_inventory = 1, mounted_ceiling = 1}, not_in_creative_inventory = 1, mounted_ceiling = 1},
sounds = default.node_sound_metal_defaults(), sounds = default.node_sound_metal_defaults(),
}) })
morelights.register_variants({ morelights.register_variants({
{name = "morelights:chain_d", description = "Metal Chain (dark)", {name = "morelights:chain_d", description = "Metal Chain (dark)",
tiles = {"morelights_metal_dark_32.png"}, tiles = {"morelights_metal_dark_32.png"},
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return morelights.on_place_hanging(itemstack, placer, pointed_thing, return morelights.on_place_hanging(itemstack, placer, pointed_thing,
"morelights:chain_ceiling_d") "morelights:chain_ceiling_d")
end}, end},
{name = "morelights:chain_l", description = "Metal Chain (light)", {name = "morelights:chain_l", description = "Metal Chain (light)",
tiles = {"morelights_metal_light_32.png"}, tiles = {"morelights_metal_light_32.png"},
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return morelights.on_place_hanging(itemstack, placer, pointed_thing, return morelights.on_place_hanging(itemstack, placer, pointed_thing,
"morelights:chain_ceiling_l") "morelights:chain_ceiling_l")
end} end}
}, },
{ {
drawtype = "mesh", drawtype = "mesh",
mesh = "morelights_chain.obj", mesh = "morelights_chain.obj",
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16} fixed = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16}
}, },
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16} fixed = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16}
}, },
paramtype = "light", paramtype = "light",
groups = {cracky = 3, oddly_breakable_by_hand = 3, mounted_ceiling = 1}, sunlight_propagates = true,
sounds = default.node_sound_metal_defaults(), groups = {cracky = 3, oddly_breakable_by_hand = 3, mounted_ceiling = 1},
sounds = default.node_sound_metal_defaults(),
}) })
morelights.register_variants({ morelights.register_variants({
{name = "morelights:chain_ceiling_d", {name = "morelights:chain_ceiling_d",
tiles = {"morelights_metal_dark_32.png"}, drop = "morelights:chain_d"}, tiles = {"morelights_metal_dark_32.png"}, drop = "morelights:chain_d"},
{name = "morelights:chain_ceiling_l", {name = "morelights:chain_ceiling_l",
tiles = {"morelights_metal_light_32.png"}, drop = "morelights:chain_l"} tiles = {"morelights_metal_light_32.png"}, drop = "morelights:chain_l"}
}, },
{ {
drawtype = "mesh", drawtype = "mesh",
mesh = "morelights_chain_ceiling.obj", mesh = "morelights_chain_ceiling.obj",
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {{-3/16, 7/16, -3/16, 3/16, 1/2, 3/16}, fixed = {{-3/16, 7/16, -3/16, 3/16, 1/2, 3/16},
{-1/16, -1/2, -1/16, 1/16, 7/16, 1/16}} {-1/16, -1/2, -1/16, 1/16, 7/16, 1/16}}
}, },
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {{-3/16, 7/16, -3/16, 3/16, 1/2, 3/16}, fixed = {{-3/16, 7/16, -3/16, 3/16, 1/2, 3/16},
{-1/16, -1/2, -1/16, 1/16, 7/16, 1/16}} {-1/16, -1/2, -1/16, 1/16, 7/16, 1/16}}
}, },
paramtype = "light", paramtype = "light",
groups = {cracky = 3, oddly_breakable_by_hand = 3, sunlight_propagates = true,
not_in_creative_inventory = 1, mounted_ceiling = 1}, groups = {cracky = 3, oddly_breakable_by_hand = 3,
sounds = default.node_sound_metal_defaults(), not_in_creative_inventory = 1, mounted_ceiling = 1},
sounds = default.node_sound_metal_defaults(),
}) })
-- --
@ -123,46 +125,46 @@ morelights.register_variants({
-- --
minetest.register_craft({ minetest.register_craft({
output = "morelights:bulb", output = "morelights:bulb",
recipe = { recipe = {
{"", "default:glass", ""}, {"", "default:glass", ""},
{"", "default:copper_ingot", ""}, {"", "default:copper_ingot", ""},
{"", "default:steel_ingot", ""} {"", "default:steel_ingot", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights:pole_d 2", output = "morelights:pole_d 2",
recipe = { recipe = {
{"dye:dark_grey", "default:steel_ingot", ""}, {"dye:dark_grey", "default:steel_ingot", ""},
{"", "default:steel_ingot", ""}, {"", "default:steel_ingot", ""},
{"", "default:steel_ingot", ""} {"", "default:steel_ingot", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights:pole_l 2", output = "morelights:pole_l 2",
recipe = { recipe = {
{"dye:white", "default:steel_ingot", ""}, {"dye:white", "default:steel_ingot", ""},
{"", "default:steel_ingot", ""}, {"", "default:steel_ingot", ""},
{"", "default:steel_ingot", ""} {"", "default:steel_ingot", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights:chain_d", output = "morelights:chain_d",
recipe = { recipe = {
{"dye:dark_grey", "default:steel_ingot", ""}, {"dye:dark_grey", "default:steel_ingot", ""},
{"", "", ""}, {"", "", ""},
{"", "default:steel_ingot", ""} {"", "default:steel_ingot", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights:chain_l", output = "morelights:chain_l",
recipe = { recipe = {
{"dye:white", "default:steel_ingot", ""}, {"dye:white", "default:steel_ingot", ""},
{"", "", ""}, {"", "", ""},
{"", "default:steel_ingot", ""} {"", "default:steel_ingot", ""}
} }
}) })

@ -1,77 +1,77 @@
minetest.register_node("morelights_extras:f_block", { minetest.register_node("morelights_extras:f_block", {
description = "Futuristic Light Block", description = "Futuristic Light Block",
tiles = {"morelights_extras_f_block.png"}, tiles = {"morelights_extras_f_block.png"},
paramtype = "light", paramtype = "light",
light_source = LIGHT_MAX, light_source = LIGHT_MAX,
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
minetest.register_node("morelights_extras:dirt_with_grass", { minetest.register_node("morelights_extras:dirt_with_grass", {
description = "Grass Light", description = "Grass Light",
tiles = {"default_grass.png^morelights_extras_blocklight.png", tiles = {"default_grass.png^morelights_extras_blocklight.png",
"default_dirt.png", "default_dirt.png^default_grass_side.png"}, "default_dirt.png", "default_dirt.png^default_grass_side.png"},
paramtype = "light", paramtype = "light",
light_source = 12, light_source = 12,
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults() sounds = default.node_sound_glass_defaults()
}) })
minetest.register_node("morelights_extras:stone_block", { minetest.register_node("morelights_extras:stone_block", {
description = "Stone Block Light", description = "Stone Block Light",
tiles = {"default_stone_block.png^morelights_extras_blocklight.png"}, tiles = {"default_stone_block.png^morelights_extras_blocklight.png"},
paramtype = "light", paramtype = "light",
light_source = 12, light_source = 12,
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults() sounds = default.node_sound_glass_defaults()
}) })
minetest.register_node("morelights_extras:sandstone_block", { minetest.register_node("morelights_extras:sandstone_block", {
description = "Sandstone Block Light", description = "Sandstone Block Light",
tiles = {"default_sandstone_block.png^morelights_extras_blocklight.png"}, tiles = {"default_sandstone_block.png^morelights_extras_blocklight.png"},
paramtype = "light", paramtype = "light",
light_source = 12, light_source = 12,
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults() sounds = default.node_sound_glass_defaults()
}) })
minetest.register_node("morelights_extras:stairlight", { minetest.register_node("morelights_extras:stairlight", {
description = "Stair Light (place on stairs)", description = "Stair Light (place on stairs)",
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = {-1/4, -13/16, -1/16, 1/4, -11/16, 0} fixed = {-1/4, -13/16, -1/16, 1/4, -11/16, 0}
}, },
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-1/4, -13/16, -1/16, 1/4, -11/16, 0} fixed = {-1/4, -13/16, -1/16, 1/4, -11/16, 0}
}, },
walkable = false, walkable = false,
tiles = {"morelights_metal_dark.png"}, tiles = {"morelights_metal_dark.png"},
overlay_tiles = {"", "morelights_extras_stairlight.png", overlay_tiles = {"", "morelights_extras_stairlight.png",
"", "", "morelights_extras_stairlight.png"}, "", "", "morelights_extras_stairlight.png"},
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
light_source = 10, light_source = 10,
groups = {cracky = 2, oddly_breakable_by_hand = 3, attached_node = 1}, groups = {cracky = 2, oddly_breakable_by_hand = 3, attached_node = 1},
node_placement_prediction = "", node_placement_prediction = "",
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
local node = minetest.get_node(vector.subtract(pointed_thing.above, local node = minetest.get_node(vector.subtract(pointed_thing.above,
{x=0, y=1, z=0})) {x=0, y=1, z=0}))
if node and node.name:match("^stairs:stair") if node and node.name:match("^stairs:stair")
and node.param2 < 4 then and node.param2 < 4 then
minetest.item_place(itemstack, placer, pointed_thing, node.param2) minetest.item_place(itemstack, placer, pointed_thing, node.param2)
end end
return itemstack return itemstack
end, end,
on_rotate = function(pos, node, user, mode, new_param2) on_rotate = function(pos, node, user, mode, new_param2)
return false return false
end, end,
}) })
-- --
@ -79,44 +79,44 @@ minetest.register_node("morelights_extras:stairlight", {
-- --
minetest.register_craft({ minetest.register_craft({
output = "morelights_extras:f_block", output = "morelights_extras:f_block",
recipe = { recipe = {
{"default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment"}, {"default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment"},
{morelights.glass, "morelights:bulb", morelights.glass}, {morelights.glass, "morelights:bulb", morelights.glass},
{"default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment"} {"default:mese_crystal_fragment", "default:steel_ingot", "default:mese_crystal_fragment"}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_extras:dirt_with_grass", output = "morelights_extras:dirt_with_grass",
recipe = { recipe = {
{"", morelights.glass, ""}, {"", morelights.glass, ""},
{"", "morelights:bulb", ""}, {"", "morelights:bulb", ""},
{"default:grass_1", "default:dirt", ""} {"default:grass_1", "default:dirt", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_extras:stone_block", output = "morelights_extras:stone_block",
recipe = { recipe = {
{"", morelights.glass, ""}, {"", morelights.glass, ""},
{"", "morelights:bulb", ""}, {"", "morelights:bulb", ""},
{"", "default:stone_block", ""} {"", "default:stone_block", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_extras:sandstone_block", output = "morelights_extras:sandstone_block",
recipe = { recipe = {
{"", morelights.glass, ""}, {"", morelights.glass, ""},
{"", "morelights:bulb", ""}, {"", "morelights:bulb", ""},
{"", "default:sandstone_block", ""} {"", "default:sandstone_block", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_extras:stairlight", output = "morelights_extras:stairlight",
recipe = { recipe = {
{"default:steel_ingot", "morelights:bulb", "default:steel_ingot"} {"default:steel_ingot", "morelights:bulb", "default:steel_ingot"}
} }
}) })

@ -1,236 +1,236 @@
minetest.register_node("morelights_modern:block", { minetest.register_node("morelights_modern:block", {
description = "Modern Light Block", description = "Modern Light Block",
tiles = {"morelights_metal_dark.png^morelights_modern_block.png"}, tiles = {"morelights_metal_dark.png^morelights_modern_block.png"},
paramtype = "light", paramtype = "light",
light_source = LIGHT_MAX, light_source = LIGHT_MAX,
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
minetest.register_node("morelights_modern:smallblock", { minetest.register_node("morelights_modern:smallblock", {
description = "Modern Light Block (small)", description = "Modern Light Block (small)",
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = {-1/4, -1/2, -1/4, 1/4, 0, 1/4} fixed = {-1/4, -1/2, -1/4, 1/4, 0, 1/4}
}, },
tiles = {"morelights_metal_dark.png^morelights_modern_smallblock.png", tiles = {"morelights_metal_dark.png^morelights_modern_smallblock.png",
"morelights_metal_dark.png^morelights_modern_smallblock.png", "morelights_metal_dark.png^morelights_modern_smallblock.png",
"[combine:16x16:0,0=morelights_metal_dark.png:0,4=morelights_modern_smallblock.png"}, "[combine:16x16:0,0=morelights_metal_dark.png:0,4=morelights_modern_smallblock.png"},
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
light_source = 12, light_source = 12,
groups = {cracky = 3, oddly_breakable_by_hand = 3}, groups = {cracky = 3, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return morelights.rotate_and_place(itemstack, placer, pointed_thing) return morelights.rotate_and_place(itemstack, placer, pointed_thing)
end, end,
}) })
morelights.register_variants({ morelights.register_variants({
{name = "morelights_modern:post_d", description = "Modern Post Light (dark)", {name = "morelights_modern:post_d", description = "Modern Post Light (dark)",
tiles = {"morelights_metal_dark.png", "morelights_metal_dark.png", tiles = {"morelights_metal_dark.png", "morelights_metal_dark.png",
"morelights_metal_dark.png^morelights_modern_post.png"}}, "morelights_metal_dark.png^morelights_modern_post.png"}},
{name = "morelights_modern:post_l", description = "Modern Post Light (light)", {name = "morelights_modern:post_l", description = "Modern Post Light (light)",
tiles = {"morelights_metal_light.png", "morelights_metal_light.png", tiles = {"morelights_metal_light.png", "morelights_metal_light.png",
"morelights_metal_light.png^morelights_modern_post.png"}} "morelights_metal_light.png^morelights_modern_post.png"}}
}, },
{ {
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = {{-1/8, -1/2, -1/8, 1/8, 1/2, 1/8}} fixed = {{-1/8, -1/2, -1/8, 1/8, 1/2, 1/8}}
}, },
paramtype = "light", paramtype = "light",
light_source = LIGHT_MAX, light_source = LIGHT_MAX,
groups = {cracky = 3, oddly_breakable_by_hand = 3}, groups = {cracky = 3, oddly_breakable_by_hand = 3},
sounds = default.node_sound_metal_defaults(), sounds = default.node_sound_metal_defaults(),
}) })
morelights.register_variants({ morelights.register_variants({
{name = "morelights_modern:streetpost_d", {name = "morelights_modern:streetpost_d",
description = "Street Lamp Post (dark)--connects to bar lights", description = "Street Lamp Post (dark)--connects to bar lights",
tiles = {"morelights_metal_dark.png"}}, tiles = {"morelights_metal_dark.png"}},
{name = "morelights_modern:streetpost_l", {name = "morelights_modern:streetpost_l",
description = "Street Lamp Post (light)--connects to bar lights", description = "Street Lamp Post (light)--connects to bar lights",
tiles = {"morelights_metal_light.png"}} tiles = {"morelights_metal_light.png"}}
}, },
{ {
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "connected", type = "connected",
fixed = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16}, fixed = {-1/16, -1/2, -1/16, 1/16, 1/2, 1/16},
connect_front = {-1/16, 3/8, -1/2, 1/16, 7/16, -1/16}, connect_front = {-1/16, 3/8, -1/2, 1/16, 7/16, -1/16},
connect_left = {-1/2, 3/8, -1/16, -1/16, 7/16, 1/16}, connect_left = {-1/2, 3/8, -1/16, -1/16, 7/16, 1/16},
connect_back = {-1/16, 3/8, 1/16, 1/16, 7/16, 1/2}, connect_back = {-1/16, 3/8, 1/16, 1/16, 7/16, 1/2},
connect_right = {1/16, 3/8, -1/16, 1/2, 7/16, 1/16}, connect_right = {1/16, 3/8, -1/16, 1/2, 7/16, 1/16},
}, },
connects_to = {"morelights_modern:barlight_c", "morelights_modern:barlight_s"}, connects_to = {"morelights_modern:barlight_c", "morelights_modern:barlight_s"},
paramtype = "light", paramtype = "light",
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_metal_defaults(), sounds = default.node_sound_metal_defaults(),
}) })
minetest.register_node("morelights_modern:barlight_c", { minetest.register_node("morelights_modern:barlight_c", {
description = "Ceiling Bar Light (connecting)", description = "Ceiling Bar Light (connecting)",
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "connected", type = "connected",
fixed = {-1/8, 3/8, -1/8, 1/8, 1/2, 1/8}, fixed = {-1/8, 3/8, -1/8, 1/8, 1/2, 1/8},
connect_front = {-1/8, 3/8, -1/2, 1/8, 1/2, -1/8}, connect_front = {-1/8, 3/8, -1/2, 1/8, 1/2, -1/8},
connect_left = {-1/2, 3/8, -1/8, -1/8, 1/2, 1/8}, connect_left = {-1/2, 3/8, -1/8, -1/8, 1/2, 1/8},
connect_back = {-1/8, 3/8, 1/8, 1/8, 1/2, 1/2}, connect_back = {-1/8, 3/8, 1/8, 1/8, 1/2, 1/2},
connect_right = {1/8, 3/8, -1/8, 1/2, 1/2, 1/8}, connect_right = {1/8, 3/8, -1/8, 1/2, 1/2, 1/8},
}, },
connects_to = {"morelights_modern:barlight_c", "morelights_modern:barlight_s", connects_to = {"morelights_modern:barlight_c", "morelights_modern:barlight_s",
"morelights_modern:streetpost_d", "morelights_modern:streetpost_l"}, "morelights_modern:streetpost_d", "morelights_modern:streetpost_l"},
tiles = {"morelights_metal_dark.png", "morelights_modern_barlight.png", tiles = {"morelights_metal_dark.png", "morelights_modern_barlight.png",
"morelights_metal_dark.png"}, "morelights_metal_dark.png"},
paramtype = "light", paramtype = "light",
light_source = LIGHT_MAX, light_source = LIGHT_MAX,
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
minetest.register_node("morelights_modern:barlight_s", { minetest.register_node("morelights_modern:barlight_s", {
description = "Ceiling Bar Light (straight)", description = "Ceiling Bar Light (straight)",
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = {-1/2, 3/8, -1/8, 1/2, 1/2, 1/8}, fixed = {-1/2, 3/8, -1/8, 1/2, 1/2, 1/8},
}, },
tiles = {"morelights_metal_dark.png", "morelights_modern_barlight.png", tiles = {"morelights_metal_dark.png", "morelights_modern_barlight.png",
"morelights_metal_dark.png"}, "morelights_metal_dark.png"},
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
light_source = LIGHT_MAX, light_source = LIGHT_MAX,
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
minetest.register_node("morelights_modern:ceilinglight", { minetest.register_node("morelights_modern:ceilinglight", {
description = "Modern Ceiling Light", description = "Modern Ceiling Light",
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = {-1/4, 3/8, -1/4, 1/4, 1/2, 1/4} fixed = {-1/4, 3/8, -1/4, 1/4, 1/2, 1/4}
}, },
tiles = {"morelights_metal_dark.png", tiles = {"morelights_metal_dark.png",
"morelights_metal_dark.png^morelights_modern_block.png"}, "morelights_metal_dark.png^morelights_modern_block.png"},
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
light_source = LIGHT_MAX, light_source = LIGHT_MAX,
groups = {cracky = 3, oddly_breakable_by_hand = 3}, groups = {cracky = 3, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return morelights.rotate_and_place(itemstack, placer, pointed_thing, return morelights.rotate_and_place(itemstack, placer, pointed_thing,
{[0] = 0, 20, 12, 16, 4, 8}) {[0] = 0, 20, 12, 16, 4, 8})
end, end,
}) })
morelights.register_variants({ morelights.register_variants({
{name = "morelights_modern:canlight_d", {name = "morelights_modern:canlight_d",
description = "Modern Can Light (dark)", description = "Modern Can Light (dark)",
tiles = {"morelights_metal_dark.png^morelights_modern_canlight.png"}}, tiles = {"morelights_metal_dark.png^morelights_modern_canlight.png"}},
{name = "morelights_modern:canlight_l", {name = "morelights_modern:canlight_l",
description = "Modern Can Light (light)", description = "Modern Can Light (light)",
tiles = {"morelights_metal_light.png^morelights_modern_canlight.png"}}, tiles = {"morelights_metal_light.png^morelights_modern_canlight.png"}},
}, },
{ {
drawtype = "mesh", drawtype = "mesh",
mesh = "morelights_modern_canlight.obj", mesh = "morelights_modern_canlight.obj",
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {-1/8, 0, -1/8, 1/8, 1/2, 1/8} fixed = {-1/8, 0, -1/8, 1/8, 1/2, 1/8}
}, },
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-1/8, 0, -1/8, 1/8, 1/2, 1/8} fixed = {-1/8, 0, -1/8, 1/8, 1/2, 1/8}
}, },
paramtype = "light", paramtype = "light",
light_source = 12, light_source = 12,
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_metal_defaults(), sounds = default.node_sound_metal_defaults(),
}) })
minetest.register_node("morelights_modern:walllamp", { minetest.register_node("morelights_modern:walllamp", {
description = "Modern Wall Lamp", description = "Modern Wall Lamp",
drawtype = "mesh", drawtype = "mesh",
mesh = "morelights_modern_walllamp.obj", mesh = "morelights_modern_walllamp.obj",
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {-1/8, -3/8, 1/8, 1/8, 1/4, 1/2} fixed = {-1/8, -3/8, 1/8, 1/8, 1/4, 1/2}
}, },
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-1/8, -3/8, 1/8, 1/8, 1/4, 1/2} fixed = {-1/8, -3/8, 1/8, 1/8, 1/4, 1/2}
}, },
tiles = {"morelights_metal_dark_32.png^morelights_modern_walllamp.png"}, tiles = {"morelights_metal_dark_32.png^morelights_modern_walllamp.png"},
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
light_source = 12, light_source = 12,
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return morelights.rotate_and_place(itemstack, placer, pointed_thing, return morelights.rotate_and_place(itemstack, placer, pointed_thing,
{[0] = 6, 4, 1, 3, 0, 2}) {[0] = 6, 4, 1, 3, 0, 2})
end, end,
}) })
morelights.register_variants({ morelights.register_variants({
{name = "morelights_modern:tablelamp_d", {name = "morelights_modern:tablelamp_d",
description = "Modern Table Lamp (dark)", description = "Modern Table Lamp (dark)",
tiles = {"morelights_metal_light_32.png^morelights_modern_tablelamp_o.png", tiles = {"morelights_metal_light_32.png^morelights_modern_tablelamp_o.png",
"morelights_modern_tablelamp_d.png"}}, "morelights_modern_tablelamp_d.png"}},
{name = "morelights_modern:tablelamp_l", {name = "morelights_modern:tablelamp_l",
description = "Modern Table Lamp (light)", description = "Modern Table Lamp (light)",
tiles = {"morelights_metal_dark_32.png^morelights_modern_tablelamp_o.png", tiles = {"morelights_metal_dark_32.png^morelights_modern_tablelamp_o.png",
"morelights_modern_tablelamp_l.png"}}, "morelights_modern_tablelamp_l.png"}},
}, },
{ {
drawtype = "mesh", drawtype = "mesh",
mesh = "morelights_modern_tablelamp.obj", mesh = "morelights_modern_tablelamp.obj",
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {-1/4, -1/2, -1/4, 1/4, 7/16, 1/4} fixed = {-1/4, -1/2, -1/4, 1/4, 7/16, 1/4}
}, },
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-1/4, -1/2, -1/4, 1/4, 7/16, 1/4} fixed = {-1/4, -1/2, -1/4, 1/4, 7/16, 1/4}
}, },
paramtype = "light", paramtype = "light",
light_source = 10, light_source = 10,
groups = {choppy = 2, oddly_breakable_by_hand = 3}, groups = {choppy = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_defaults(), sounds = default.node_sound_defaults(),
}) })
morelights.register_variants({ morelights.register_variants({
{name = "morelights_modern:pathlight_d", {name = "morelights_modern:pathlight_d",
description = "Modern Path Light (dark)", description = "Modern Path Light (dark)",
tiles = {"morelights_metal_dark_32.png^morelights_modern_pathlight.png"}}, tiles = {"morelights_metal_dark_32.png^morelights_modern_pathlight.png"}},
{name = "morelights_modern:pathlight_l", {name = "morelights_modern:pathlight_l",
description = "Modern Path Light (light)", description = "Modern Path Light (light)",
tiles = {"morelights_metal_light_32.png^morelights_modern_pathlight.png"}} tiles = {"morelights_metal_light_32.png^morelights_modern_pathlight.png"}}
}, },
{ {
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = {{-1/32, -8/16, -1/32, 1/32, 1/8, 1/32}, fixed = {{-1/32, -8/16, -1/32, 1/32, 1/8, 1/32},
{-1/16, 1/8, -1/16, 1/16, 5/16, 1/16}, {-1/16, 1/8, -1/16, 1/16, 5/16, 1/16},
{-1/8, 5/16, -1/8, 1/8, 3/8, 1/8}} {-1/8, 5/16, -1/8, 1/8, 3/8, 1/8}}
}, },
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {{-1/8, -1/2, -1/8, 1/8, 3/8, 1/8}} fixed = {{-1/8, -1/2, -1/8, 1/8, 3/8, 1/8}}
}, },
paramtype = "light", paramtype = "light",
light_source = 8, light_source = 8,
groups = {cracky = 3, oddly_breakable_by_hand = 3}, groups = {cracky = 3, oddly_breakable_by_hand = 3},
sounds = default.node_sound_metal_defaults(), sounds = default.node_sound_metal_defaults(),
}) })
-- --
@ -238,143 +238,143 @@ morelights.register_variants({
-- --
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:block", output = "morelights_modern:block",
recipe = { recipe = {
{"", "default:steel_ingot", ""}, {"", "default:steel_ingot", ""},
{morelights.glass, "morelights:bulb", morelights.glass}, {morelights.glass, "morelights:bulb", morelights.glass},
{"", "default:steel_ingot", ""} {"", "default:steel_ingot", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:smallblock", output = "morelights_modern:smallblock",
recipe = { recipe = {
{"", morelights.glass, ""}, {"", morelights.glass, ""},
{"default:steel_ingot", "morelights:bulb", "default:steel_ingot"} {"default:steel_ingot", "morelights:bulb", "default:steel_ingot"}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:post_d", output = "morelights_modern:post_d",
recipe = { recipe = {
{"dye:dark_grey", "default:steel_ingot", ""}, {"dye:dark_grey", "default:steel_ingot", ""},
{"", "morelights:bulb", ""}, {"", "morelights:bulb", ""},
{"", "default:steel_ingot", ""} {"", "default:steel_ingot", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:post_l", output = "morelights_modern:post_l",
recipe = { recipe = {
{"dye:white", "default:steel_ingot", ""}, {"dye:white", "default:steel_ingot", ""},
{"", "morelights:bulb", ""}, {"", "morelights:bulb", ""},
{"", "default:steel_ingot", ""} {"", "default:steel_ingot", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:streetpost_d 2", output = "morelights_modern:streetpost_d 2",
recipe = { recipe = {
{"dye:dark_grey", "default:steel_ingot", "default:steel_ingot"}, {"dye:dark_grey", "default:steel_ingot", "default:steel_ingot"},
{"", "default:steel_ingot", ""}, {"", "default:steel_ingot", ""},
{"", "default:steel_ingot", ""} {"", "default:steel_ingot", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:streetpost_l 2", output = "morelights_modern:streetpost_l 2",
recipe = { recipe = {
{"dye:white", "default:steel_ingot", "default:steel_ingot"}, {"dye:white", "default:steel_ingot", "default:steel_ingot"},
{"", "default:steel_ingot", ""}, {"", "default:steel_ingot", ""},
{"", "default:steel_ingot", ""} {"", "default:steel_ingot", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:barlight_c 4", output = "morelights_modern:barlight_c 4",
recipe = { recipe = {
{"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"}, {"default:steel_ingot", "default:steel_ingot", "default:steel_ingot"},
{"default:copper_ingot", "default:glass", "default:copper_ingot"} {"default:copper_ingot", "default:glass", "default:copper_ingot"}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:barlight_c", output = "morelights_modern:barlight_c",
type = "shapeless", type = "shapeless",
recipe = {"morelights_modern:barlight_s"} recipe = {"morelights_modern:barlight_s"}
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:barlight_s", output = "morelights_modern:barlight_s",
type = "shapeless", type = "shapeless",
recipe = {"morelights_modern:barlight_c"} recipe = {"morelights_modern:barlight_c"}
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:ceilinglight", output = "morelights_modern:ceilinglight",
recipe = { recipe = {
{"default:steel_ingot", "morelights:bulb", "default:steel_ingot"}, {"default:steel_ingot", "morelights:bulb", "default:steel_ingot"},
{"", morelights.glass, ""}, {"", morelights.glass, ""},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:canlight_d", output = "morelights_modern:canlight_d",
recipe = { recipe = {
{"dye:dark_grey", "default:steel_ingot", ""}, {"dye:dark_grey", "default:steel_ingot", ""},
{"default:steel_ingot", "morelights:bulb", "default:steel_ingot"}, {"default:steel_ingot", "morelights:bulb", "default:steel_ingot"},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:canlight_l", output = "morelights_modern:canlight_l",
recipe = { recipe = {
{"dye:white", "default:steel_ingot", ""}, {"dye:white", "default:steel_ingot", ""},
{"default:steel_ingot", "morelights:bulb", "default:steel_ingot"}, {"default:steel_ingot", "morelights:bulb", "default:steel_ingot"},
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:walllamp", output = "morelights_modern:walllamp",
recipe = { recipe = {
{"dye:white", morelights.glass, ""}, {"dye:white", morelights.glass, ""},
{morelights.glass, "morelights:bulb", "default:steel_ingot"}, {morelights.glass, "morelights:bulb", "default:steel_ingot"},
{"", "dye:dark_grey", "default:steel_ingot"} {"", "dye:dark_grey", "default:steel_ingot"}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:tablelamp_d", output = "morelights_modern:tablelamp_d",
recipe = { recipe = {
{"wool:dark_grey", "morelights:bulb", "wool:dark_grey"}, {"wool:dark_grey", "morelights:bulb", "wool:dark_grey"},
{"", "default:steel_ingot", ""}, {"", "default:steel_ingot", ""},
{"", "default:steel_ingot", ""} {"", "default:steel_ingot", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:tablelamp_l", output = "morelights_modern:tablelamp_l",
recipe = { recipe = {
{"wool:white", "morelights:bulb", "wool:white"}, {"wool:white", "morelights:bulb", "wool:white"},
{"", "default:steel_ingot", ""}, {"", "default:steel_ingot", ""},
{"", "default:steel_ingot", ""} {"", "default:steel_ingot", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:pathlight_d", output = "morelights_modern:pathlight_d",
recipe = { recipe = {
{"dye:dark_grey", "morelights:bulb", ""}, {"dye:dark_grey", "morelights:bulb", ""},
{"", "default:steel_ingot", ""}, {"", "default:steel_ingot", ""},
{"", "default:steel_ingot", ""} {"", "default:steel_ingot", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_modern:pathlight_l", output = "morelights_modern:pathlight_l",
recipe = { recipe = {
{"dye:white", "morelights:bulb", ""}, {"dye:white", "morelights:bulb", ""},
{"", "default:steel_ingot", ""}, {"", "default:steel_ingot", ""},
{"", "default:steel_ingot", ""} {"", "default:steel_ingot", ""}
} }
}) })

@ -3,239 +3,239 @@
local brass_ingot_name local brass_ingot_name
if minetest.get_modpath("basic_materials") then if minetest.get_modpath("basic_materials") then
-- Use basic materials brass ingot -- Use basic materials brass ingot
brass_ingot_name = "basic_materials:brass_ingot" brass_ingot_name = "basic_materials:brass_ingot"
else else
-- Register and use morelights brass ingot -- Register and use morelights brass ingot
minetest.register_craftitem("morelights_vintage:brass_ingot", { minetest.register_craftitem("morelights_vintage:brass_ingot", {
description = "Brass Ingot", description = "Brass Ingot",
inventory_image = "default_steel_ingot.png^[multiply:#FFCE69" inventory_image = "default_steel_ingot.png^[multiply:#FFCE69"
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_vintage:brass_ingot 2", output = "morelights_vintage:brass_ingot 2",
type = "shapeless", type = "shapeless",
recipe = { recipe = {
"default:copper_ingot", "default:tin_ingot" "default:copper_ingot", "default:tin_ingot"
} }
}) })
brass_ingot_name = "morelights_vintage:brass_ingot" brass_ingot_name = "morelights_vintage:brass_ingot"
end end
minetest.register_node("morelights_vintage:chain_b", { minetest.register_node("morelights_vintage:chain_b", {
description = "Brass Chain", description = "Brass Chain",
drawtype = "mesh", drawtype = "mesh",
mesh = "morelights_chain.obj", mesh = "morelights_chain.obj",
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {-1/16, -8/16, -1/16, 1/16, 8/16, 1/16} fixed = {-1/16, -8/16, -1/16, 1/16, 8/16, 1/16}
}, },
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-1/16, -8/16, -1/16, 1/16, 8/16, 1/16} fixed = {-1/16, -8/16, -1/16, 1/16, 8/16, 1/16}
}, },
tiles = {"morelights_vintage_brass_32.png"}, tiles = {"morelights_vintage_brass_32.png"},
paramtype = "light", paramtype = "light",
groups = {cracky = 3, oddly_breakable_by_hand = 3, mounted_ceiling = 1}, groups = {cracky = 3, oddly_breakable_by_hand = 3, mounted_ceiling = 1},
sounds = default.node_sound_metal_defaults(), sounds = default.node_sound_metal_defaults(),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return morelights.on_place_hanging(itemstack, placer, pointed_thing, return morelights.on_place_hanging(itemstack, placer, pointed_thing,
"morelights_vintage:chain_ceiling_b") "morelights_vintage:chain_ceiling_b")
end, end,
}) })
minetest.register_node("morelights_vintage:chain_ceiling_b", { minetest.register_node("morelights_vintage:chain_ceiling_b", {
drawtype = "mesh", drawtype = "mesh",
mesh = "morelights_chain_ceiling.obj", mesh = "morelights_chain_ceiling.obj",
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {{-3/16, 7/16, -3/16, 3/16, 8/16, 3/16}, fixed = {{-3/16, 7/16, -3/16, 3/16, 8/16, 3/16},
{-1/16, -8/16, -1/16, 1/16, 7/16, 1/16}} {-1/16, -8/16, -1/16, 1/16, 7/16, 1/16}}
}, },
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {{-3/16, 7/16, -3/16, 3/16, 8/16, 3/16}, fixed = {{-3/16, 7/16, -3/16, 3/16, 8/16, 3/16},
{-1/16, -8/16, -1/16, 1/16, 7/16, 1/16}} {-1/16, -8/16, -1/16, 1/16, 7/16, 1/16}}
}, },
tiles = {"morelights_vintage_brass_32.png"}, tiles = {"morelights_vintage_brass_32.png"},
drop = "morelights_vintage:chain_b", drop = "morelights_vintage:chain_b",
paramtype = "light", paramtype = "light",
groups = {cracky = 3, oddly_breakable_by_hand = 3, groups = {cracky = 3, oddly_breakable_by_hand = 3,
not_in_creative_inventory = 1, mounted_ceiling = 1}, not_in_creative_inventory = 1, mounted_ceiling = 1},
sounds = default.node_sound_metal_defaults(), sounds = default.node_sound_metal_defaults(),
}) })
minetest.register_node("morelights_vintage:block", { minetest.register_node("morelights_vintage:block", {
description = "Vintage Light Block", description = "Vintage Light Block",
tiles = {"morelights_vintage_block.png"}, tiles = {"morelights_vintage_block.png"},
paramtype = "light", paramtype = "light",
light_source = LIGHT_MAX, light_source = LIGHT_MAX,
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
minetest.register_node("morelights_vintage:smallblock", { minetest.register_node("morelights_vintage:smallblock", {
description = "Vintage Light Block (small)", description = "Vintage Light Block (small)",
drawtype = "nodebox", drawtype = "nodebox",
node_box = { node_box = {
type = "fixed", type = "fixed",
fixed = {-1/4, -1/2, -1/4, 1/4, 0, 1/4} fixed = {-1/4, -1/2, -1/4, 1/4, 0, 1/4}
}, },
tiles = {"morelights_vintage_block.png", "morelights_vintage_block.png", tiles = {"morelights_vintage_block.png", "morelights_vintage_block.png",
"[combine:16x16:0,4=morelights_vintage_block.png"}, "[combine:16x16:0,4=morelights_vintage_block.png"},
paramtype = "light", paramtype = "light",
paramtype2 = "facedir", paramtype2 = "facedir",
light_source = 12, light_source = 12,
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return morelights.rotate_and_place(itemstack, placer, pointed_thing) return morelights.rotate_and_place(itemstack, placer, pointed_thing)
end, end,
}) })
minetest.register_node("morelights_vintage:lantern_f", { minetest.register_node("morelights_vintage:lantern_f", {
description = "Vintage Lantern (floor, wall, or ceiling)", description = "Vintage Lantern (floor, wall, or ceiling)",
drawtype = "mesh", drawtype = "mesh",
mesh = "morelights_vintage_lantern_f.obj", mesh = "morelights_vintage_lantern_f.obj",
tiles = {"morelights_vintage_lantern.png", "morelights_metal_dark_32.png"}, tiles = {"morelights_vintage_lantern.png", "morelights_metal_dark_32.png"},
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {-3/16, -1/2, -3/16, 3/16, 1/16, 3/16} fixed = {-3/16, -1/2, -3/16, 3/16, 1/16, 3/16}
}, },
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-3/16, -1/2, -3/16, 3/16, 1/16, 3/16} fixed = {-3/16, -1/2, -3/16, 3/16, 1/16, 3/16}
}, },
paramtype = "light", paramtype = "light",
light_source = 12, light_source = 12,
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
local wdir = minetest.dir_to_wallmounted( local wdir = minetest.dir_to_wallmounted(
vector.subtract(pointed_thing.under, pointed_thing.above)) vector.subtract(pointed_thing.under, pointed_thing.above))
local fakestack = itemstack local fakestack = itemstack
if wdir == 0 then if wdir == 0 then
fakestack:set_name("morelights_vintage:lantern_c") fakestack:set_name("morelights_vintage:lantern_c")
elseif wdir == 1 then elseif wdir == 1 then
fakestack:set_name("morelights_vintage:lantern_f") fakestack:set_name("morelights_vintage:lantern_f")
else else
fakestack:set_name("morelights_vintage:lantern_w") fakestack:set_name("morelights_vintage:lantern_w")
end end
itemstack = minetest.item_place(fakestack, placer, pointed_thing, wdir) itemstack = minetest.item_place(fakestack, placer, pointed_thing, wdir)
itemstack:set_name("morelights_vintage:lantern_f") itemstack:set_name("morelights_vintage:lantern_f")
return itemstack return itemstack
end, end,
}) })
minetest.register_node("morelights_vintage:lantern_c", { minetest.register_node("morelights_vintage:lantern_c", {
drawtype = "mesh", drawtype = "mesh",
mesh = "morelights_vintage_lantern_c.obj", mesh = "morelights_vintage_lantern_c.obj",
tiles = {"morelights_vintage_lantern.png", "morelights_metal_dark_32.png"}, tiles = {"morelights_vintage_lantern.png", "morelights_metal_dark_32.png"},
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {-3/16, -1/16, -3/16, 3/16, 1/2, 3/16} fixed = {-3/16, -1/16, -3/16, 3/16, 1/2, 3/16}
}, },
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-3/16, 0, -3/16, 3/16, 1/2, 3/16} fixed = {-3/16, 0, -3/16, 3/16, 1/2, 3/16}
}, },
paramtype = "light", paramtype = "light",
light_source = 12, light_source = 12,
groups = {cracky = 2, oddly_breakable_by_hand = 3, groups = {cracky = 2, oddly_breakable_by_hand = 3,
not_in_creative_inventory = 1}, not_in_creative_inventory = 1},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
drop = "morelights_vintage:lantern_f", drop = "morelights_vintage:lantern_f",
}) })
minetest.register_node("morelights_vintage:lantern_w", { minetest.register_node("morelights_vintage:lantern_w", {
drawtype = "mesh", drawtype = "mesh",
mesh = "morelights_vintage_lantern_w.obj", mesh = "morelights_vintage_lantern_w.obj",
tiles = {"morelights_vintage_lantern.png", "morelights_metal_dark_32.png"}, tiles = {"morelights_vintage_lantern.png", "morelights_metal_dark_32.png"},
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {-3/16, -1/4, -5/16, 3/16, 1/8, 3/16} fixed = {-3/16, -1/4, -5/16, 3/16, 1/8, 3/16}
}, },
selection_box = { selection_box = {
type = "wallmounted", type = "wallmounted",
wall_bottom = {-3/16, -1/4, -5/16, 3/16, 1/8, 3/16}, wall_bottom = {-3/16, -1/4, -5/16, 3/16, 1/8, 3/16},
wall_side = {-1/4, -5/16, -3/16, 1/8, 3/16, 3/16}, wall_side = {-1/4, -5/16, -3/16, 1/8, 3/16, 3/16},
wall_top = {-3/16, -1/8, -5/16, 3/16, 1/4, 3/16} wall_top = {-3/16, -1/8, -5/16, 3/16, 1/4, 3/16}
}, },
paramtype = "light", paramtype = "light",
paramtype2 = "wallmounted", paramtype2 = "wallmounted",
light_source = 12, light_source = 12,
groups = {cracky = 2, oddly_breakable_by_hand = 3, groups = {cracky = 2, oddly_breakable_by_hand = 3,
not_in_creative_inventory = 1}, not_in_creative_inventory = 1},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
drop = "morelights_vintage:lantern_f", drop = "morelights_vintage:lantern_f",
}) })
minetest.register_node("morelights_vintage:hangingbulb", { minetest.register_node("morelights_vintage:hangingbulb", {
description = "Vintage Hanging Light Bulb", description = "Vintage Hanging Light Bulb",
drawtype = "mesh", drawtype = "mesh",
mesh = "morelights_vintage_hangingbulb.obj", mesh = "morelights_vintage_hangingbulb.obj",
tiles = {"morelights_vintage_hangingbulb.png^[lowpart:50:morelights_metal_dark_32.png"}, tiles = {"morelights_vintage_hangingbulb.png^[lowpart:50:morelights_metal_dark_32.png"},
use_texture_alpha = true, use_texture_alpha = true,
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {-1/8, -1/8, -1/8, 1/8, 1/2, 1/8} fixed = {-1/8, -1/8, -1/8, 1/8, 1/2, 1/8}
}, },
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-1/8, -1/8, -1/8, 1/8, 1/2, 1/8} fixed = {-1/8, -1/8, -1/8, 1/8, 1/2, 1/8}
}, },
paramtype = "light", paramtype = "light",
light_source = 10, light_source = 10,
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
minetest.register_node("morelights_vintage:oillamp", { minetest.register_node("morelights_vintage:oillamp", {
description = "Vintage Oil Lamp", description = "Vintage Oil Lamp",
drawtype = "mesh", drawtype = "mesh",
mesh = "morelights_vintage_oillamp.obj", mesh = "morelights_vintage_oillamp.obj",
tiles = {{name = "morelights_vintage_oil_flame.png", tiles = {{name = "morelights_vintage_oil_flame.png",
animation = {type = "sheet_2d", frames_w = 16, frames_h = 1, frame_length = 0.3}}, animation = {type = "sheet_2d", frames_w = 16, frames_h = 1, frame_length = 0.3}},
"morelights_vintage_oillamp.png", "morelights_vintage_oillamp.png",
"morelights_vintage_brass_32.png"}, "morelights_vintage_brass_32.png"},
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {-1/8, -1/2, -1/8, 1/8, 1/4, 1/8} fixed = {-1/8, -1/2, -1/8, 1/8, 1/4, 1/8}
}, },
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-1/8, -1/2, -1/8, 1/8, 1/4, 1/8} fixed = {-1/8, -1/2, -1/8, 1/8, 1/4, 1/8}
}, },
paramtype = "light", paramtype = "light",
light_source = 8, light_source = 8,
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
minetest.register_node("morelights_vintage:chandelier", { minetest.register_node("morelights_vintage:chandelier", {
description = "Vintage Chandelier", description = "Vintage Chandelier",
drawtype = "mesh", drawtype = "mesh",
mesh = "morelights_vintage_chandelier.obj", mesh = "morelights_vintage_chandelier.obj",
tiles = {"morelights_vintage_chandelier.png", tiles = {"morelights_vintage_chandelier.png",
"morelights_vintage_brass_32.png^[multiply:#DFDFDF"}, "morelights_vintage_brass_32.png^[multiply:#DFDFDF"},
collision_box = { collision_box = {
type = "fixed", type = "fixed",
fixed = {-3/8, -1/2, -3/8, 3/8, 1/2, 3/8} fixed = {-3/8, -1/2, -3/8, 3/8, 1/2, 3/8}
}, },
selection_box = { selection_box = {
type = "fixed", type = "fixed",
fixed = {-3/8, -1/2, -3/8, 3/8, 1/2, 3/8} fixed = {-3/8, -1/2, -3/8, 3/8, 1/2, 3/8}
}, },
paramtype = "light", paramtype = "light",
light_source = 10, light_source = 10,
groups = {cracky = 2, oddly_breakable_by_hand = 3}, groups = {cracky = 2, oddly_breakable_by_hand = 3},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
-- --
@ -243,63 +243,63 @@ minetest.register_node("morelights_vintage:chandelier", {
-- --
minetest.register_craft({ minetest.register_craft({
output = "morelights_vintage:chain_b", output = "morelights_vintage:chain_b",
recipe = { recipe = {
{"", brass_ingot_name, ""}, {"", brass_ingot_name, ""},
{"", "", ""}, {"", "", ""},
{"", brass_ingot_name, ""} {"", brass_ingot_name, ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_vintage:block", output = "morelights_vintage:block",
recipe = { recipe = {
{"", "default:junglewood", ""}, {"", "default:junglewood", ""},
{morelights.glass, "morelights:bulb", morelights.glass}, {morelights.glass, "morelights:bulb", morelights.glass},
{"", "default:junglewood", ""} {"", "default:junglewood", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_vintage:smallblock", output = "morelights_vintage:smallblock",
recipe = { recipe = {
{"", morelights.glass, ""}, {"", morelights.glass, ""},
{"default:junglewood", "morelights:bulb", "default:junglewood"} {"default:junglewood", "morelights:bulb", "default:junglewood"}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_vintage:lantern_f", output = "morelights_vintage:lantern_f",
recipe = { recipe = {
{"", "default:steel_ingot", ""}, {"", "default:steel_ingot", ""},
{morelights.glass, "morelights:bulb", morelights.glass}, {morelights.glass, "morelights:bulb", morelights.glass},
{"default:stick", "default:steel_ingot", "default:stick"} {"default:stick", "default:steel_ingot", "default:stick"}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_vintage:hangingbulb", output = "morelights_vintage:hangingbulb",
recipe = { recipe = {
{"", "default:steel_ingot", ""}, {"", "default:steel_ingot", ""},
{"", "default:copper_ingot", ""}, {"", "default:copper_ingot", ""},
{"", "morelights:bulb", ""} {"", "morelights:bulb", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_vintage:oillamp", output = "morelights_vintage:oillamp",
recipe = { recipe = {
{"", "default:glass", ""}, {"", "default:glass", ""},
{"farming:cotton", brass_ingot_name, ""}, {"farming:cotton", brass_ingot_name, ""},
{"", "default:glass", ""} {"", "default:glass", ""}
} }
}) })
minetest.register_craft({ minetest.register_craft({
output = "morelights_vintage:chandelier", output = "morelights_vintage:chandelier",
recipe = { recipe = {
{"", brass_ingot_name, ""}, {"", brass_ingot_name, ""},
{"morelights:bulb", brass_ingot_name, "morelights:bulb"}, {"morelights:bulb", brass_ingot_name, "morelights:bulb"},
{"default:steel_ingot", brass_ingot_name, "default:steel_ingot"} {"default:steel_ingot", brass_ingot_name, "default:steel_ingot"}
} }
}) })