2020-08-04 21:11:08 +02:00
|
|
|
local S = minetest.get_translator("homedecor_clocks")
|
2017-01-31 06:34:41 +01:00
|
|
|
|
2022-04-02 22:32:44 +02:00
|
|
|
local wood
|
|
|
|
if minetest.get_modpath("default") then
|
|
|
|
wood = "default_wood.png"
|
|
|
|
else
|
|
|
|
|
|
|
|
wood = "[combine:16x16^[noalpha^[colorize:#563d2d"
|
|
|
|
end
|
|
|
|
|
|
|
|
local plastic_craft = {
|
|
|
|
output = "homedecor:analog_clock_plastic 2",
|
|
|
|
recipe = {
|
|
|
|
{ "basic_materials:plastic_sheet", "dye_black", "basic_materials:plastic_sheet" },
|
|
|
|
{ "basic_materials:plastic_sheet", "basic_materials:ic", "basic_materials:plastic_sheet" },
|
|
|
|
{ "basic_materials:plastic_sheet", "dye_black", "basic_materials:plastic_sheet" },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
local wood_craft = {
|
|
|
|
output = "homedecor:analog_clock_wood 2",
|
|
|
|
recipe = {
|
|
|
|
{ "group:stick", "dye_black", "group:stick" },
|
|
|
|
{ "group:stick", "basic_materials:ic", "group:stick" },
|
|
|
|
{ "group:stick", "dye_black", "group:stick" },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2015-02-28 10:14:46 +01:00
|
|
|
local clock_sbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -8/32, -8/32, 14/32, 8/32, 8/32, 16/32 }
|
|
|
|
}
|
|
|
|
|
2015-04-28 07:12:37 +02:00
|
|
|
local clock_materials = {
|
2022-04-02 22:32:44 +02:00
|
|
|
{"plastic", S("Plastic analog clock"), "homedecor_generic_plastic.png", plastic_craft},
|
|
|
|
{"wood", S("Wooden analog clock"), wood, wood_craft}
|
2015-04-28 07:12:37 +02:00
|
|
|
}
|
2015-02-28 10:14:46 +01:00
|
|
|
|
2017-01-31 06:34:41 +01:00
|
|
|
for _, mat in ipairs(clock_materials) do
|
2022-04-02 22:32:44 +02:00
|
|
|
local name, desc, tex, craft = unpack(mat)
|
2017-01-31 06:34:41 +01:00
|
|
|
homedecor.register("analog_clock_"..name, {
|
|
|
|
description = desc,
|
2015-02-28 10:14:46 +01:00
|
|
|
mesh = "homedecor_analog_clock.obj",
|
2015-04-28 07:12:37 +02:00
|
|
|
tiles = {
|
|
|
|
"homedecor_analog_clock_face.png",
|
2017-01-31 06:34:41 +01:00
|
|
|
tex,
|
2015-04-28 07:12:37 +02:00
|
|
|
"homedecor_analog_clock_back.png"
|
|
|
|
},
|
2017-01-31 06:34:41 +01:00
|
|
|
inventory_image = "homedecor_analog_clock_"..name.."_inv.png",
|
2015-04-29 14:14:36 +02:00
|
|
|
walkable = false,
|
2015-02-28 10:14:46 +01:00
|
|
|
selection_box = clock_sbox,
|
2022-04-02 22:32:44 +02:00
|
|
|
groups = {snappy=3, dig_tree=2},
|
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_wood_defaults",
|
|
|
|
},
|
|
|
|
crafts = {
|
|
|
|
craft
|
|
|
|
}
|
2015-02-28 10:14:46 +01:00
|
|
|
})
|
|
|
|
end
|
2014-06-25 11:59:34 +02:00
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("digital_clock", {
|
2017-01-31 06:34:41 +01:00
|
|
|
description = S("Digital clock"),
|
2014-06-25 11:59:34 +02:00
|
|
|
tiles = {
|
|
|
|
"homedecor_digital_clock_edges.png",
|
|
|
|
"homedecor_digital_clock_edges.png",
|
|
|
|
"homedecor_digital_clock_edges.png",
|
|
|
|
"homedecor_digital_clock_edges.png",
|
|
|
|
"homedecor_digital_clock_back.png",
|
|
|
|
"homedecor_digital_clock_front.png"
|
|
|
|
},
|
2014-08-02 03:05:22 +02:00
|
|
|
inventory_image = "homedecor_digital_clock_inv.png",
|
2014-06-25 11:59:34 +02:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.28125, -0.25, 0.4375, 0.3125, 0.25, 0.5},
|
|
|
|
}
|
|
|
|
},
|
2015-04-29 14:14:36 +02:00
|
|
|
walkable = false,
|
2022-04-02 22:32:44 +02:00
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_wood_defaults",
|
|
|
|
},
|
|
|
|
groups = {snappy=3, dig_tree=2},
|
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
output = "homedecor:digital_clock 2",
|
|
|
|
recipe = {
|
|
|
|
{ "basic_materials:plastic_sheet", "paper", "basic_materials:plastic_sheet" },
|
|
|
|
{ "basic_materials:plastic_sheet", "basic_materials:ic", "basic_materials:plastic_sheet" },
|
|
|
|
{ "basic_materials:plastic_sheet", "basic_materials:energy_crystal_simple", "basic_materials:plastic_sheet" },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2014-06-25 11:59:34 +02:00
|
|
|
})
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("alarm_clock", {
|
2017-01-31 06:34:41 +01:00
|
|
|
description = S("Alarm clock"),
|
2014-06-25 11:59:34 +02:00
|
|
|
tiles = {
|
|
|
|
"homedecor_alarm_clock_top.png",
|
|
|
|
"homedecor_alarm_clock_bottom.png",
|
|
|
|
"homedecor_alarm_clock_sides.png",
|
|
|
|
"homedecor_alarm_clock_sides.png^[transformFX",
|
|
|
|
"homedecor_alarm_clock_back.png",
|
|
|
|
"homedecor_alarm_clock_front.png"
|
|
|
|
},
|
2014-08-02 03:05:22 +02:00
|
|
|
inventory_image = "homedecor_alarm_clock_inv.png",
|
2014-06-25 11:59:34 +02:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{ -9/32, -16/32, 7/32, 10/32, -5/32, 16/32 },
|
|
|
|
}
|
|
|
|
},
|
2015-04-29 14:14:36 +02:00
|
|
|
walkable = false,
|
2022-04-02 22:32:44 +02:00
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_wood_defaults",
|
|
|
|
},
|
|
|
|
groups = {snappy=3, dig_tree=2},
|
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
recipe = {
|
|
|
|
{ "basic_materials:plastic_sheet", "homedecor:speaker_driver", "basic_materials:plastic_sheet" },
|
|
|
|
{ "basic_materials:plastic_sheet", "homedecor:digital_clock", "basic_materials:plastic_sheet" },
|
|
|
|
{ "basic_materials:plastic_sheet", "basic_materials:energy_crystal_simple", "basic_materials:plastic_sheet" },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2014-06-25 11:59:34 +02:00
|
|
|
})
|
2015-03-31 03:06:07 +02:00
|
|
|
|
|
|
|
local gf_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -7/16, -8/16, -7/16, 7/16, 24/16, 7/16 }
|
|
|
|
}
|
|
|
|
|
|
|
|
homedecor.register("grandfather_clock", {
|
2017-01-31 06:34:41 +01:00
|
|
|
description = S("Grandfather Clock"),
|
2015-03-31 03:06:07 +02:00
|
|
|
mesh = "homedecor_grandfather_clock.obj",
|
|
|
|
tiles = {
|
2022-04-02 22:32:44 +02:00
|
|
|
homedecor.glass,
|
2015-03-31 03:06:07 +02:00
|
|
|
"homedecor_grandfather_clock_face.png",
|
2017-01-25 10:22:28 +01:00
|
|
|
homedecor.lux_wood,
|
2015-04-06 16:55:56 +02:00
|
|
|
"homedecor_grandfather_clock_face_edge.png",
|
2015-04-28 05:48:02 +02:00
|
|
|
"homedecor_generic_metal_brass.png"
|
2015-03-31 03:06:07 +02:00
|
|
|
},
|
2022-02-07 14:18:17 +01:00
|
|
|
use_texture_alpha = "clip",
|
2015-03-31 03:06:07 +02:00
|
|
|
inventory_image = "homedecor_grandfather_clock_inv.png",
|
2022-04-02 22:32:44 +02:00
|
|
|
groups = {snappy = 3, dig_tree=2},
|
2015-03-31 03:06:07 +02:00
|
|
|
selection_box = gf_cbox,
|
|
|
|
collision_box = gf_cbox,
|
2022-04-02 22:32:44 +02:00
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_wood_defaults",
|
|
|
|
},
|
2015-09-08 09:50:02 +02:00
|
|
|
expand = { top="placeholder" },
|
2020-08-04 21:11:08 +02:00
|
|
|
on_rotate = minetest.get_modpath("screwdriver") and screwdriver.rotate_simple or nil,
|
2022-04-02 22:32:44 +02:00
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
recipe = {
|
|
|
|
{ "building_blocks:slab_hardwood","homedecor:analog_clock_wood","building_blocks:slab_hardwood" },
|
|
|
|
{ "building_blocks:slab_hardwood","basic_materials:brass_ingot","building_blocks:slab_hardwood" },
|
|
|
|
{ "building_blocks:slab_hardwood","basic_materials:brass_ingot","building_blocks:slab_hardwood" }
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2019-04-20 21:49:36 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
-- aliases
|
|
|
|
|
2015-03-31 03:06:07 +02:00
|
|
|
minetest.register_alias("homedecor:grandfather_clock_bottom", "homedecor:grandfather_clock")
|
|
|
|
minetest.register_alias("homedecor:grandfather_clock_top", "air")
|