2020-08-04 19:58:37 +02:00
|
|
|
local S = minetest.get_translator("homedecor_bathroom")
|
2017-01-30 00:12:02 +01:00
|
|
|
|
2020-08-04 19:58:37 +02:00
|
|
|
local sc_disallow = minetest.get_modpath("screwdriver") and screwdriver.disallow or nil
|
2019-04-20 21:49:36 +02:00
|
|
|
|
2022-05-03 21:21:14 +02:00
|
|
|
local wood_tex = homedecor.textures.default_wood
|
|
|
|
local water_tex = homedecor.textures.water
|
|
|
|
|
|
|
|
homedecor.register("bathroom_tiles_dark", {
|
2019-04-20 21:49:36 +02:00
|
|
|
description = S("Bathroom/kitchen tiles (dark)"),
|
|
|
|
tiles = {
|
|
|
|
"homedecor_bathroom_tiles_bg.png"
|
|
|
|
},
|
|
|
|
overlay_tiles = {
|
|
|
|
{ name = "homedecor_bathroom_tiles_fg.png", color = 0xff606060 },
|
|
|
|
},
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "color",
|
|
|
|
palette = "unifieddyes_palette_extended.png",
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = {cracky=3, ud_param2_colorable = 1, dig_stone = 2},
|
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_stone_defaults",
|
|
|
|
},
|
2019-04-20 21:49:36 +02:00
|
|
|
on_construct = unifieddyes.on_construct,
|
2019-07-18 08:16:46 +02:00
|
|
|
on_dig = unifieddyes.on_dig,
|
2022-05-03 21:21:14 +02:00
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
output = "homedecor:bathroom_tiles_dark 4",
|
|
|
|
recipe = {
|
|
|
|
{ "group:marble", "group:marble", "" },
|
|
|
|
{ "group:marble", "group:marble", "dye_dark_grey" }
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2019-04-20 21:49:36 +02:00
|
|
|
})
|
|
|
|
|
2022-05-03 21:21:14 +02:00
|
|
|
homedecor.register("bathroom_tiles_medium", {
|
2019-04-20 21:49:36 +02:00
|
|
|
description = S("Bathroom/kitchen tiles (medium)"),
|
|
|
|
tiles = {
|
|
|
|
"homedecor_bathroom_tiles_bg.png"
|
|
|
|
},
|
|
|
|
overlay_tiles = {
|
|
|
|
{ name = "homedecor_bathroom_tiles_fg.png", color = 0xffc0c0c0 },
|
|
|
|
},
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "color",
|
|
|
|
palette = "unifieddyes_palette_extended.png",
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = {cracky=3, ud_param2_colorable = 1, dig_stone = 2},
|
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_stone_defaults",
|
|
|
|
},
|
2019-04-20 21:49:36 +02:00
|
|
|
on_construct = unifieddyes.on_construct,
|
2019-07-18 08:16:46 +02:00
|
|
|
on_dig = unifieddyes.on_dig,
|
2022-05-03 21:21:14 +02:00
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
output = "homedecor:bathroom_tiles_medium 4",
|
|
|
|
recipe = {
|
|
|
|
{ "group:marble", "group:marble", "" },
|
|
|
|
{ "group:marble", "group:marble", "dye_grey" }
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2019-04-20 21:49:36 +02:00
|
|
|
})
|
|
|
|
|
2022-05-03 21:21:14 +02:00
|
|
|
homedecor.register("bathroom_tiles_light", {
|
2019-04-20 21:49:36 +02:00
|
|
|
description = S("Bathroom/kitchen tiles (light)"),
|
|
|
|
tiles = {
|
|
|
|
"homedecor_bathroom_tiles_bg.png"
|
|
|
|
},
|
|
|
|
overlay_tiles = {
|
|
|
|
{ name = "homedecor_bathroom_tiles_fg.png", color = 0xffffffff },
|
|
|
|
},
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "color",
|
|
|
|
palette = "unifieddyes_palette_extended.png",
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = {cracky=3, ud_param2_colorable = 1, dig_stone = 2},
|
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_stone_defaults",
|
|
|
|
},
|
2019-04-20 21:49:36 +02:00
|
|
|
on_construct = unifieddyes.on_construct,
|
2019-07-18 08:16:46 +02:00
|
|
|
on_dig = unifieddyes.on_dig,
|
2022-05-03 21:21:14 +02:00
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
output = "homedecor:bathroom_tiles_light 4",
|
|
|
|
recipe = {
|
|
|
|
{ "group:marble", "group:marble" },
|
|
|
|
{ "group:marble", "group:marble" }
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2019-04-20 21:49:36 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
local tr_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.375, -0.3125, 0.25, 0.375, 0.375, 0.5 }
|
|
|
|
}
|
|
|
|
|
|
|
|
homedecor.register("towel_rod", {
|
|
|
|
description = S("Towel rod with towel"),
|
|
|
|
mesh = "homedecor_towel_rod.obj",
|
|
|
|
tiles = {
|
|
|
|
"homedecor_generic_terrycloth.png",
|
2022-05-03 21:21:14 +02:00
|
|
|
wood_tex,
|
2019-04-20 21:49:36 +02:00
|
|
|
},
|
|
|
|
inventory_image = "homedecor_towel_rod_inv.png",
|
|
|
|
selection_box = tr_cbox,
|
|
|
|
walkable = false,
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,dig_tree=2},
|
|
|
|
_sound_def = {
|
2022-08-12 05:37:26 +02:00
|
|
|
key = "node_sound_default",
|
2022-05-03 21:21:14 +02:00
|
|
|
},
|
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
recipe = {
|
|
|
|
{ "group:wood", "group:stick", "group:wood" },
|
|
|
|
{ "", "building_blocks:terrycloth_towel", "" },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2019-04-20 21:49:36 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
homedecor.register("medicine_cabinet", {
|
|
|
|
description = S("Medicine cabinet"),
|
|
|
|
mesh = "homedecor_medicine_cabinet.obj",
|
|
|
|
tiles = {
|
2022-05-03 21:21:14 +02:00
|
|
|
wood_tex,
|
2019-04-20 21:49:36 +02:00
|
|
|
'homedecor_medicine_cabinet_mirror.png'
|
|
|
|
},
|
|
|
|
inventory_image = "homedecor_medicine_cabinet_inv.png",
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.3125, -0.1875, 0.3125, 0.3125, 0.5, 0.5}
|
|
|
|
},
|
|
|
|
walkable = false,
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = { snappy = 3, dig_stone = 2 },
|
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_wood_defaults",
|
|
|
|
},
|
2019-04-20 21:49:36 +02:00
|
|
|
on_punch = function(pos, node, puncher, pointed_thing)
|
|
|
|
node.name = "homedecor:medicine_cabinet_open"
|
|
|
|
minetest.swap_node(pos, node)
|
|
|
|
end,
|
2021-11-28 02:32:13 +01:00
|
|
|
can_dig = function(pos)
|
|
|
|
local inv = minetest.get_meta(pos):get_inventory("main")
|
|
|
|
return inv:is_empty("main")
|
|
|
|
end,
|
2019-04-20 21:49:36 +02:00
|
|
|
infotext=S("Medicine cabinet"),
|
|
|
|
inventory = {
|
|
|
|
size=6,
|
|
|
|
},
|
2022-05-03 21:21:14 +02:00
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
recipe = {
|
|
|
|
{ "group:stick", "glass_block", "group:stick" },
|
|
|
|
{ "group:stick", "glass_block", "group:stick" },
|
|
|
|
{ "group:stick", "glass_block", "group:stick" }
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2019-04-20 21:49:36 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
homedecor.register("medicine_cabinet_open", {
|
|
|
|
mesh = "homedecor_medicine_cabinet_open.obj",
|
|
|
|
tiles = {
|
2022-05-03 21:21:14 +02:00
|
|
|
wood_tex,
|
2019-04-20 21:49:36 +02:00
|
|
|
'homedecor_medicine_cabinet_mirror.png',
|
|
|
|
'homedecor_medicine_cabinet_inside.png'
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {-0.3125, -0.1875, -0.25, 0.3125, 0.5, 0.5}
|
|
|
|
},
|
|
|
|
walkable = false,
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = { snappy = 3, not_in_creative_inventory=1, dig_stone = 2 },
|
2019-04-20 21:49:36 +02:00
|
|
|
drop = "homedecor:medicine_cabinet",
|
|
|
|
on_punch = function(pos, node, puncher, pointed_thing)
|
|
|
|
node.name = "homedecor:medicine_cabinet"
|
|
|
|
minetest.swap_node(pos, node)
|
|
|
|
end,
|
2021-11-28 02:32:13 +01:00
|
|
|
can_dig = function(pos)
|
|
|
|
local inv = minetest.get_meta(pos):get_inventory("main")
|
|
|
|
return inv:is_empty("main")
|
|
|
|
end,
|
2019-04-20 21:49:36 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
-- "Sanitation" related
|
|
|
|
|
2015-04-30 11:48:15 +02:00
|
|
|
local toilet_sbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -6/16, -8/16, -8/16, 6/16, 9/16, 8/16 },
|
|
|
|
}
|
|
|
|
|
2015-04-18 10:22:12 +02:00
|
|
|
local toilet_cbox = {
|
|
|
|
type = "fixed",
|
2016-12-15 22:23:31 +01:00
|
|
|
fixed = {
|
2015-04-30 11:48:15 +02:00
|
|
|
{-6/16, -8/16, -8/16, 6/16, 1/16, 8/16 },
|
|
|
|
{-6/16, -8/16, 4/16, 6/16, 9/16, 8/16 }
|
|
|
|
}
|
2015-04-18 10:22:12 +02:00
|
|
|
}
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("toilet", {
|
2015-01-23 22:14:00 +01:00
|
|
|
description = S("Toilet"),
|
2015-04-18 10:22:12 +02:00
|
|
|
mesh = "homedecor_toilet_closed.obj",
|
|
|
|
tiles = {
|
2019-04-20 21:49:36 +02:00
|
|
|
"building_blocks_marble.png",
|
|
|
|
"building_blocks_marble.png",
|
|
|
|
"building_blocks_marble.png",
|
2017-01-25 10:22:28 +01:00
|
|
|
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey }
|
2015-01-23 22:14:00 +01:00
|
|
|
},
|
2015-04-30 11:48:15 +02:00
|
|
|
selection_box = toilet_sbox,
|
|
|
|
node_box = toilet_cbox,
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = {cracky=3, dig_stone = 2},
|
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_stone_defaults",
|
|
|
|
},
|
2017-02-21 00:30:59 +01:00
|
|
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
2015-01-23 22:14:00 +01:00
|
|
|
node.name = "homedecor:toilet_open"
|
|
|
|
minetest.set_node(pos, node)
|
2022-05-03 21:21:14 +02:00
|
|
|
end,
|
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
recipe = {
|
|
|
|
{ "","","water_bucket"},
|
|
|
|
{ "group:marble","group:marble", "group:marble" },
|
|
|
|
{ "", "empty_bucket", "" },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2013-03-26 12:05:22 +01:00
|
|
|
})
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("toilet_open", {
|
2015-04-18 10:22:12 +02:00
|
|
|
mesh = "homedecor_toilet_open.obj",
|
2015-01-23 22:14:00 +01:00
|
|
|
tiles = {
|
2019-04-20 21:49:36 +02:00
|
|
|
"building_blocks_marble.png",
|
|
|
|
"building_blocks_marble.png",
|
|
|
|
"building_blocks_marble.png",
|
2022-05-03 21:21:14 +02:00
|
|
|
water_tex,
|
2017-01-25 10:22:28 +01:00
|
|
|
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey }
|
2015-01-23 22:14:00 +01:00
|
|
|
},
|
2015-04-30 11:48:15 +02:00
|
|
|
selection_box = toilet_sbox,
|
2015-04-18 10:22:12 +02:00
|
|
|
collision_box = toilet_cbox,
|
2015-01-23 22:14:00 +01:00
|
|
|
drop = "homedecor:toilet",
|
2022-03-29 07:44:05 +02:00
|
|
|
use_texture_alpha = "blend",
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = {cracky=3, dig_stone = 2},
|
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_stone_defaults",
|
|
|
|
},
|
2017-02-21 00:30:59 +01:00
|
|
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
2015-01-23 22:14:00 +01:00
|
|
|
node.name = "homedecor:toilet"
|
|
|
|
minetest.set_node(pos, node)
|
2014-06-18 12:10:26 +02:00
|
|
|
minetest.sound_play("homedecor_toilet_flush", {
|
|
|
|
pos=pos,
|
|
|
|
max_hear_distance = 5,
|
|
|
|
gain = 1,
|
|
|
|
})
|
2015-04-30 11:48:15 +02:00
|
|
|
end
|
2013-03-26 12:05:22 +01:00
|
|
|
})
|
|
|
|
|
2015-04-26 23:57:45 +02:00
|
|
|
-- toilet paper :-)
|
|
|
|
|
|
|
|
local tp_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.25, 0.125, 0.0625, 0.1875, 0.4375, 0.5 }
|
|
|
|
}
|
|
|
|
|
|
|
|
homedecor.register("toilet_paper", {
|
|
|
|
description = S("Toilet paper"),
|
|
|
|
mesh = "homedecor_toilet_paper.obj",
|
|
|
|
tiles = {
|
|
|
|
"homedecor_generic_quilted_paper.png",
|
2022-05-03 21:21:14 +02:00
|
|
|
wood_tex
|
2015-04-26 23:57:45 +02:00
|
|
|
},
|
|
|
|
inventory_image = "homedecor_toilet_paper_inv.png",
|
|
|
|
selection_box = tp_cbox,
|
2015-04-29 14:14:36 +02:00
|
|
|
walkable = false,
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = {snappy=3,oddly_breakable_by_hand=3, dig_stone = 2},
|
|
|
|
_sound_def = {
|
2022-08-12 05:37:26 +02:00
|
|
|
key = "node_sound_default",
|
2022-05-03 21:21:14 +02:00
|
|
|
},
|
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
recipe = {
|
|
|
|
{ "", "paper", "paper" },
|
|
|
|
{ "group:wood", "group:stick", "paper" },
|
|
|
|
{ "", "paper", "paper" },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2015-04-26 23:57:45 +02:00
|
|
|
})
|
|
|
|
|
2013-03-26 12:05:22 +01:00
|
|
|
--Sink
|
2015-04-17 18:45:14 +02:00
|
|
|
|
2019-03-24 18:38:27 +01:00
|
|
|
local sink_sbox = {
|
2015-04-17 18:45:14 +02:00
|
|
|
type = "fixed",
|
|
|
|
fixed = { -5/16, -8/16, 1/16, 5/16, 8/16, 8/16 }
|
|
|
|
}
|
|
|
|
|
2019-03-24 18:38:27 +01:00
|
|
|
local sink_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{ -5/16, 5/16, 1/16, -4/16, 8/16, 8/16 },
|
|
|
|
{ 5/16, 5/16, 1/16, 4/16, 8/16, 8/16 },
|
|
|
|
{ -5/16, 5/16, 1/16, 5/16, 8/16, 2/16 },
|
|
|
|
{ -5/16, 5/16, 6/16, 5/16, 8/16, 8/16 },
|
|
|
|
{ -4/16, -8/16, 1/16, 4/16, 5/16, 6/16 }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("sink", {
|
2015-04-17 18:45:14 +02:00
|
|
|
description = S("Bathroom Sink"),
|
|
|
|
mesh = "homedecor_bathroom_sink.obj",
|
2015-01-23 22:14:00 +01:00
|
|
|
tiles = {
|
2019-04-20 21:49:36 +02:00
|
|
|
"building_blocks_marble.png",
|
|
|
|
"building_blocks_marble.png",
|
2022-05-03 21:21:14 +02:00
|
|
|
water_tex
|
2015-01-23 22:14:00 +01:00
|
|
|
},
|
2022-03-29 07:44:05 +02:00
|
|
|
use_texture_alpha = "blend",
|
2015-04-17 18:45:14 +02:00
|
|
|
inventory_image="homedecor_bathroom_sink_inv.png",
|
2019-03-24 18:38:27 +01:00
|
|
|
selection_box = sink_sbox,
|
|
|
|
collision_box = sink_cbox,
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = {cracky=3, dig_stone = 2},
|
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_stone_defaults",
|
|
|
|
},
|
2015-05-11 04:08:34 +02:00
|
|
|
on_destruct = function(pos)
|
|
|
|
homedecor.stop_particle_spawner({x=pos.x, y=pos.y+1, z=pos.z})
|
2022-05-03 21:21:14 +02:00
|
|
|
end,
|
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
recipe = {
|
|
|
|
{ "group:marble","empty_bucket", "group:marble" },
|
|
|
|
{ "", "group:marble", "" }
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2013-03-26 12:05:22 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
--Taps
|
2015-04-27 22:48:32 +02:00
|
|
|
|
2016-07-31 01:17:23 +02:00
|
|
|
local function taps_on_rightclick(pos, node, clicker, itemstack, pointed_thing)
|
2015-05-11 04:08:34 +02:00
|
|
|
local below = minetest.get_node_or_nil({x=pos.x, y=pos.y-1, z=pos.z})
|
|
|
|
if below and
|
2015-05-11 04:30:53 +02:00
|
|
|
below.name == "homedecor:shower_tray" or
|
2021-03-31 02:55:34 +02:00
|
|
|
string.find(below.name, "homedecor:.*sink") then
|
2015-05-11 04:08:34 +02:00
|
|
|
local particledef = {
|
2015-05-11 04:34:30 +02:00
|
|
|
outlet = { x = 0, y = -0.44, z = 0.28 },
|
2015-05-11 04:08:34 +02:00
|
|
|
velocity_x = { min = -0.1, max = 0.1 },
|
|
|
|
velocity_y = -0.3,
|
|
|
|
velocity_z = { min = -0.1, max = 0 },
|
2019-03-24 18:38:27 +01:00
|
|
|
spread = 0,
|
|
|
|
die_on_collision = true,
|
2015-05-11 04:08:34 +02:00
|
|
|
}
|
2015-05-11 09:56:44 +02:00
|
|
|
homedecor.start_particle_spawner(pos, node, particledef, "homedecor_faucet")
|
2015-05-11 04:08:34 +02:00
|
|
|
end
|
2016-07-31 01:17:23 +02:00
|
|
|
return itemstack
|
2015-05-11 04:08:34 +02:00
|
|
|
end
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("taps", {
|
2015-04-27 22:42:20 +02:00
|
|
|
description = S("Bathroom taps/faucet"),
|
|
|
|
mesh = "homedecor_bathroom_faucet.obj",
|
|
|
|
tiles = {
|
2017-01-25 10:22:28 +01:00
|
|
|
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
|
2015-04-28 05:48:02 +02:00
|
|
|
"homedecor_generic_metal_bright.png",
|
2017-01-25 10:22:28 +01:00
|
|
|
"homedecor_generic_metal.png",
|
2015-04-28 05:48:02 +02:00
|
|
|
"homedecor_generic_metal_bright.png"
|
2015-04-27 22:42:20 +02:00
|
|
|
},
|
2015-04-27 22:58:45 +02:00
|
|
|
inventory_image = "3dforniture_taps_inv.png",
|
|
|
|
wield_image = "3dforniture_taps_inv.png",
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -4/16, -7/16, 4/16, 4/16, -4/16, 8/16 },
|
|
|
|
},
|
|
|
|
walkable = false,
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = {cracky=3, dig_stone = 2},
|
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_stone_defaults",
|
|
|
|
},
|
2015-05-11 04:08:34 +02:00
|
|
|
on_rightclick = taps_on_rightclick,
|
2015-05-14 12:25:11 +02:00
|
|
|
on_destruct = homedecor.stop_particle_spawner,
|
2022-05-03 21:21:14 +02:00
|
|
|
on_rotate = sc_disallow or nil,
|
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
recipe = {
|
|
|
|
{ "steel_ingot","water_bucket", "steel_ingot" },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2015-04-27 22:58:45 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
homedecor.register("taps_brass", {
|
|
|
|
description = S("Bathroom taps/faucet (brass)"),
|
|
|
|
mesh = "homedecor_bathroom_faucet.obj",
|
|
|
|
tiles = {
|
2015-04-28 05:48:02 +02:00
|
|
|
"homedecor_generic_metal_brass.png",
|
|
|
|
"homedecor_generic_metal_brass.png",
|
2017-01-25 10:22:28 +01:00
|
|
|
"homedecor_generic_metal.png",
|
2015-04-28 05:48:02 +02:00
|
|
|
"homedecor_generic_metal_brass.png"
|
2015-04-27 22:58:45 +02:00
|
|
|
},
|
|
|
|
inventory_image = "3dforniture_taps_brass_inv.png",
|
|
|
|
wield_image = "3dforniture_taps_brass_inv.png",
|
2015-01-23 22:14:00 +01:00
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
2015-04-27 22:42:20 +02:00
|
|
|
fixed = { -4/16, -7/16, 4/16, 4/16, -4/16, 8/16 },
|
2015-01-23 22:14:00 +01:00
|
|
|
},
|
2015-04-27 22:48:32 +02:00
|
|
|
walkable = false,
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = {cracky=3, dig_stone = 2},
|
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_stone_defaults",
|
|
|
|
},
|
2015-05-11 04:08:34 +02:00
|
|
|
on_rightclick = taps_on_rightclick,
|
2015-05-14 12:25:11 +02:00
|
|
|
on_destruct = homedecor.stop_particle_spawner,
|
2020-08-04 19:58:37 +02:00
|
|
|
on_rotate = sc_disallow or nil,
|
2022-05-03 21:21:14 +02:00
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
recipe = {
|
|
|
|
{ "basic_materials:brass_ingot","water_bucket", "basic_materials:brass_ingot" },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2013-03-26 12:05:22 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
--Shower Tray
|
2015-04-27 22:58:45 +02:00
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("shower_tray", {
|
2015-01-23 22:14:00 +01:00
|
|
|
description = S("Shower Tray"),
|
|
|
|
tiles = {
|
2014-06-18 12:53:07 +02:00
|
|
|
"forniture_marble_base_ducha_top.png",
|
2019-04-20 21:49:36 +02:00
|
|
|
"building_blocks_marble.png"
|
2015-01-23 22:14:00 +01:00
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
2015-04-30 11:48:15 +02:00
|
|
|
{ -0.5, -0.5, -0.5, 0.5, -0.45, 0.5 },
|
|
|
|
{ -0.5, -0.45, -0.5, 0.5, -0.4, -0.45 },
|
|
|
|
{ -0.5, -0.45, 0.45, 0.5, -0.4, 0.5 },
|
|
|
|
{ -0.5, -0.45, -0.45, -0.45, -0.4, 0.45 },
|
|
|
|
{ 0.45, -0.45, -0.45, 0.5, -0.4, 0.45 }
|
2015-01-23 22:14:00 +01:00
|
|
|
},
|
|
|
|
},
|
2015-08-19 15:49:32 +02:00
|
|
|
selection_box = homedecor.nodebox.slab_y(0.1),
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = {cracky=2, dig_stone = 2},
|
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_stone_defaults",
|
|
|
|
},
|
2015-04-28 11:56:38 +02:00
|
|
|
on_destruct = function(pos)
|
2015-05-11 04:08:34 +02:00
|
|
|
homedecor.stop_particle_spawner({x=pos.x, y=pos.y+2, z=pos.z}) -- the showerhead
|
|
|
|
homedecor.stop_particle_spawner({x=pos.x, y=pos.y+1, z=pos.z}) -- the taps, if any
|
2022-05-03 21:21:14 +02:00
|
|
|
end,
|
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
recipe = {
|
|
|
|
{ "group:marble","empty_bucket", "group:marble" },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2013-03-26 12:05:22 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
--Shower Head
|
2015-04-28 07:32:24 +02:00
|
|
|
|
2015-04-28 11:56:38 +02:00
|
|
|
|
2015-03-28 16:22:47 +01:00
|
|
|
local sh_cbox = {
|
|
|
|
type = "fixed",
|
2015-03-29 13:13:17 +02:00
|
|
|
fixed = { -0.2, -0.4, -0.05, 0.2, 0.1, 0.5 }
|
2015-03-28 16:22:47 +01:00
|
|
|
}
|
|
|
|
|
2015-01-24 00:34:02 +01:00
|
|
|
homedecor.register("shower_head", {
|
2015-03-28 16:22:47 +01:00
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "homedecor_shower_head.obj",
|
2015-04-28 07:32:24 +02:00
|
|
|
tiles = {
|
2017-01-25 10:22:28 +01:00
|
|
|
"homedecor_generic_metal.png",
|
2015-04-28 07:32:24 +02:00
|
|
|
"homedecor_shower_head.png"
|
|
|
|
},
|
2015-03-28 16:22:47 +01:00
|
|
|
inventory_image = "homedecor_shower_head_inv.png",
|
2017-01-24 21:43:20 +01:00
|
|
|
description = S("Shower Head"),
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = {snappy=3, dig_stone = 2},
|
2015-03-28 16:22:47 +01:00
|
|
|
selection_box = sh_cbox,
|
2015-04-29 14:14:36 +02:00
|
|
|
walkable = false,
|
2020-08-04 19:58:37 +02:00
|
|
|
on_rotate = sc_disallow or nil,
|
2016-07-31 01:17:23 +02:00
|
|
|
on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
|
2015-05-11 03:03:50 +02:00
|
|
|
local below = minetest.get_node_or_nil({x=pos.x, y=pos.y-2.0, z=pos.z})
|
2019-05-25 06:59:51 +02:00
|
|
|
if below and (
|
|
|
|
below.name == "homedecor:shower_tray" or
|
|
|
|
below.name == "homedecor:bathtub_clawfoot_brass_taps" or
|
|
|
|
below.name == "homedecor:bathtub_clawfoot_chrome_taps" ) then
|
2015-05-11 03:03:50 +02:00
|
|
|
local particledef = {
|
2015-05-11 04:34:30 +02:00
|
|
|
outlet = { x = 0, y = -0.42, z = 0.1 },
|
2015-05-11 03:03:50 +02:00
|
|
|
velocity_x = { min = -0.15, max = 0.15 },
|
2015-05-11 04:08:34 +02:00
|
|
|
velocity_y = -2,
|
2015-05-11 03:03:50 +02:00
|
|
|
velocity_z = { min = -0.3, max = 0.1 },
|
|
|
|
spread = 0.12
|
|
|
|
}
|
|
|
|
homedecor.start_particle_spawner(pos, node, particledef, "homedecor_shower")
|
2015-04-28 11:56:38 +02:00
|
|
|
end
|
2016-07-31 01:17:23 +02:00
|
|
|
return itemstack
|
2015-04-28 11:56:38 +02:00
|
|
|
end,
|
|
|
|
on_destruct = function(pos)
|
2015-05-11 03:03:50 +02:00
|
|
|
homedecor.stop_particle_spawner(pos)
|
2022-05-03 21:21:14 +02:00
|
|
|
end,
|
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
recipe = {
|
|
|
|
{"steel_ingot", "water_bucket"},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2013-03-26 12:05:22 +01:00
|
|
|
})
|
|
|
|
|
2019-05-25 06:59:51 +02:00
|
|
|
local tub_sbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, -0.5, -0.5, 1.5, 0.3125, 0.5 },
|
|
|
|
}
|
|
|
|
|
|
|
|
local tub_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.4375, -0.0625, -0.5, 1.4375, 0.5, -0.4375}, -- NodeBox1
|
|
|
|
{-0.4375, -0.0625, 0.4375, 1.4375, 0.5, 0.5}, -- NodeBox2
|
|
|
|
{-0.5, 0.1875, -0.4375, -0.4375, 0.5, 0.4375}, -- NodeBox3
|
|
|
|
{1.4375, -0.0625, -0.4375, 1.5, 0.5, 0.4375}, -- NodeBox4
|
|
|
|
{-0.3125, -0.3125, -0.4375, -0.125, -0.0625, 0.4375}, -- NodeBox5
|
|
|
|
{1.375, -0.3125, -0.4375, 1.4375, -0.0625, 0.4375}, -- NodeBox6
|
|
|
|
{-0.125, -0.3125, 0.375, 1.375, -0.0625, 0.4375}, -- NodeBox7
|
|
|
|
{-0.125, -0.3125, -0.4375, 1.375, -0.0625, -0.375}, -- NodeBox8
|
|
|
|
{-0.125, -0.5, -0.375, 1.375, -0.3125, 0.375}, -- NodeBox9
|
|
|
|
{-0.4375, -0.0625, -0.4375, -0.3125, 0.1875, 0.4375}, -- NodeBox10
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-02-28 02:08:14 +01:00
|
|
|
homedecor.register("bathtub_clawfoot_brass_taps", {
|
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "homedecor_bathtub_clawfoot.obj",
|
|
|
|
tiles = {
|
|
|
|
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
|
|
|
|
"homedecor_generic_metal_bright.png",
|
|
|
|
"homedecor_generic_metal_bright.png",
|
|
|
|
"homedecor_generic_metal_brass.png",
|
2019-04-20 21:49:36 +02:00
|
|
|
"building_blocks_marble.png",
|
2017-02-28 02:08:14 +01:00
|
|
|
"homedecor_bathtub_clawfoot_bottom_inside.png",
|
|
|
|
},
|
|
|
|
description = S("Bathtub, clawfoot, with brass taps"),
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = {cracky=3, dig_stone = 2},
|
2019-05-25 06:59:51 +02:00
|
|
|
selection_box = tub_sbox,
|
|
|
|
node_box = tub_cbox,
|
2022-05-03 21:21:14 +02:00
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_stone_defaults",
|
|
|
|
},
|
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
recipe = {
|
|
|
|
{ "homedecor:taps_brass", "", "" },
|
|
|
|
{ "group:marble", "", "group:marble" },
|
|
|
|
{ "steel_ingot", "group:marble", "steel_ingot"},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2017-02-28 02:08:14 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
homedecor.register("bathtub_clawfoot_chrome_taps", {
|
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "homedecor_bathtub_clawfoot.obj",
|
|
|
|
tiles = {
|
|
|
|
{ name = "homedecor_generic_metal.png", color = homedecor.color_med_grey },
|
|
|
|
"homedecor_generic_metal_bright.png",
|
|
|
|
"homedecor_generic_metal_bright.png",
|
|
|
|
"homedecor_generic_metal_bright.png",
|
2019-04-20 21:49:36 +02:00
|
|
|
"building_blocks_marble.png",
|
2017-02-28 02:08:14 +01:00
|
|
|
"homedecor_bathtub_clawfoot_bottom_inside.png",
|
|
|
|
},
|
|
|
|
description = S("Bathtub, clawfoot, with chrome taps"),
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = {cracky=3, dig_stone = 2},
|
2019-05-25 06:59:51 +02:00
|
|
|
selection_box = tub_sbox,
|
|
|
|
node_box = tub_cbox,
|
2022-05-03 21:21:14 +02:00
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_stone_defaults",
|
|
|
|
},
|
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
recipe = {
|
|
|
|
{ "homedecor:taps", "", "" },
|
|
|
|
{ "group:marble", "", "group:marble" },
|
|
|
|
{"steel_ingot", "group:marble", "steel_ingot"},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2017-02-28 02:08:14 +01:00
|
|
|
})
|
|
|
|
|
2015-03-29 04:42:53 +02:00
|
|
|
local bs_cbox = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -8/16, -8/16, 1/16, 8/16, 8/16, 8/16 }
|
|
|
|
}
|
|
|
|
|
|
|
|
homedecor.register("bathroom_set", {
|
|
|
|
drawtype = "mesh",
|
|
|
|
mesh = "homedecor_bathroom_set.obj",
|
|
|
|
tiles = {
|
|
|
|
"homedecor_bathroom_set_mirror.png",
|
|
|
|
"homedecor_bathroom_set_tray.png",
|
|
|
|
"homedecor_bathroom_set_toothbrush.png",
|
|
|
|
"homedecor_bathroom_set_cup.png",
|
|
|
|
"homedecor_bathroom_set_toothpaste.png",
|
|
|
|
},
|
2015-03-29 13:13:17 +02:00
|
|
|
inventory_image = "homedecor_bathroom_set_inv.png",
|
2017-01-24 21:43:20 +01:00
|
|
|
description = S("Bathroom sundries set"),
|
2022-05-03 21:21:14 +02:00
|
|
|
groups = {snappy=3, dig_stone = 2},
|
2015-03-29 04:42:53 +02:00
|
|
|
selection_box = bs_cbox,
|
2015-04-29 14:14:36 +02:00
|
|
|
walkable = false,
|
2022-05-03 21:21:14 +02:00
|
|
|
_sound_def = {
|
|
|
|
key = "node_sound_glass_defaults",
|
|
|
|
},
|
|
|
|
crafts = {
|
|
|
|
{
|
|
|
|
recipe = {
|
|
|
|
{ "", "homedecor:glass_table_small_round", "" },
|
|
|
|
{ "basic_materials:plastic_sheet", "homedecor:glass_table_small_round", "basic_materials:plastic_sheet" },
|
|
|
|
{ "group:stick", "basic_materials:plastic_sheet", "group:stick" }
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
2015-03-29 04:42:53 +02:00
|
|
|
})
|
|
|
|
|
2019-04-20 21:49:36 +02:00
|
|
|
-- aliases
|
|
|
|
|
2013-03-26 12:05:22 +01:00
|
|
|
minetest.register_alias("3dforniture:toilet", "homedecor:toilet")
|
|
|
|
minetest.register_alias("3dforniture:toilet_open", "homedecor:toilet_open")
|
|
|
|
minetest.register_alias("3dforniture:sink", "homedecor:sink")
|
|
|
|
minetest.register_alias("3dforniture:taps", "homedecor:taps")
|
|
|
|
minetest.register_alias("3dforniture:shower_tray", "homedecor:shower_tray")
|
|
|
|
minetest.register_alias("3dforniture:shower_head", "homedecor:shower_head")
|
|
|
|
minetest.register_alias("3dforniture:table_lamp", "homedecor:table_lamp_off")
|
|
|
|
|
|
|
|
minetest.register_alias("toilet", "homedecor:toilet")
|
|
|
|
minetest.register_alias("sink", "homedecor:sink")
|
|
|
|
minetest.register_alias("taps", "homedecor:taps")
|
|
|
|
minetest.register_alias("shower_tray", "homedecor:shower_tray")
|
|
|
|
minetest.register_alias("shower_head", "homedecor:shower_head")
|
|
|
|
minetest.register_alias("table_lamp", "homedecor:table_lamp_off")
|
2019-04-20 21:49:36 +02:00
|
|
|
|
|
|
|
-- convert old static nodes
|
|
|
|
|
2020-08-04 19:58:37 +02:00
|
|
|
local old_static_bathroom_tiles = {
|
2019-04-20 21:49:36 +02:00
|
|
|
"homedecor:tiles_1",
|
|
|
|
"homedecor:tiles_2",
|
|
|
|
"homedecor:tiles_3",
|
|
|
|
"homedecor:tiles_4",
|
|
|
|
"homedecor:tiles_red",
|
|
|
|
"homedecor:tiles_tan",
|
|
|
|
"homedecor:tiles_yellow",
|
|
|
|
"homedecor:tiles_green",
|
|
|
|
"homedecor:tiles_blue"
|
|
|
|
}
|
|
|
|
|
|
|
|
local old_to_color = {
|
|
|
|
"light_grey",
|
|
|
|
"grey",
|
|
|
|
"black",
|
|
|
|
"black"
|
|
|
|
}
|
|
|
|
|
|
|
|
minetest.register_lbm({
|
|
|
|
name = ":homedecor:convert_bathroom_tiles",
|
|
|
|
label = "Convert bathroom tiles to use param2 color",
|
|
|
|
run_at_every_load = false,
|
2020-08-04 19:58:37 +02:00
|
|
|
nodenames = old_static_bathroom_tiles,
|
2019-04-20 21:49:36 +02:00
|
|
|
action = function(pos, node)
|
|
|
|
local name = node.name
|
|
|
|
local newname = "homedecor:bathroom_tiles_light"
|
|
|
|
local a = string.find(name, "_")
|
|
|
|
local color = string.sub(name, a + 1)
|
|
|
|
|
|
|
|
if color == "tan" then
|
|
|
|
color = "yellow_s50"
|
|
|
|
elseif color == "1" or color == "2" or color == "3" or color == "4" then
|
|
|
|
if color == "4" then
|
|
|
|
newname = "homedecor:bathroom_tiles_medium"
|
|
|
|
end
|
|
|
|
color = old_to_color[tonumber(color)]
|
|
|
|
elseif color ~= "yellow" then
|
|
|
|
color = color.."_s50"
|
|
|
|
end
|
|
|
|
|
|
|
|
local paletteidx = unifieddyes.getpaletteidx("unifieddyes:"..color, "extended")
|
|
|
|
|
|
|
|
minetest.set_node(pos, { name = newname, param2 = paletteidx })
|
|
|
|
local meta = minetest.get_meta(pos)
|
|
|
|
meta:set_string("dye", "unifieddyes:"..color)
|
|
|
|
meta:set_string("palette", "ext")
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
2022-05-03 21:21:14 +02:00
|
|
|
-- color crafting
|
2019-04-20 21:49:36 +02:00
|
|
|
|
|
|
|
unifieddyes.register_color_craft({
|
|
|
|
output = "homedecor:bathroom_tiles_light",
|
|
|
|
palette = "extended",
|
|
|
|
type = "shapeless",
|
|
|
|
neutral_node = "homedecor:bathroom_tiles_light",
|
|
|
|
recipe = {
|
|
|
|
"NEUTRAL_NODE",
|
|
|
|
"MAIN_DYE"
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
unifieddyes.register_color_craft({
|
|
|
|
output = "homedecor:bathroom_tiles_medium",
|
|
|
|
palette = "extended",
|
|
|
|
type = "shapeless",
|
|
|
|
neutral_node = "homedecor:bathroom_tiles_medium",
|
|
|
|
recipe = {
|
|
|
|
"NEUTRAL_NODE",
|
|
|
|
"MAIN_DYE"
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
unifieddyes.register_color_craft({
|
|
|
|
output = "homedecor:bathroom_tiles_dark",
|
|
|
|
palette = "extended",
|
|
|
|
type = "shapeless",
|
|
|
|
neutral_node = "homedecor:bathroom_tiles_dark",
|
|
|
|
recipe = {
|
|
|
|
"NEUTRAL_NODE",
|
|
|
|
"MAIN_DYE"
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|