diff --git a/homedecor/fans.lua b/homedecor/climate-control.lua similarity index 66% rename from homedecor/fans.lua rename to homedecor/climate-control.lua index 4d269f09..973cc499 100644 --- a/homedecor/fans.lua +++ b/homedecor/climate-control.lua @@ -1,3 +1,61 @@ +-- Nodes that would affect the local temperature e.g. fans, heater, A/C + +local S = homedecor.gettext + +minetest.register_node('homedecor:air_conditioner', { + drawtype = "nodebox", + description = S("Air Conditioner"), + tiles = { 'homedecor_ac_tb.png', + 'homedecor_ac_tb.png', + 'homedecor_ac_sides.png', + 'homedecor_ac_sides.png', + 'homedecor_ac_back.png', + 'homedecor_ac_front.png'}, + sunlight_propagates = false, + paramtype = "light", + paramtype2 = "facedir", + walkable = true, + groups = { snappy = 3 }, + sounds = default.node_sound_leaves_defaults(), + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.124, 0.5 }, -- off by just a tad to force the adjoining faces to be drawn. + {-0.5, 0.125, -0.5, 0.5, 0.5, 0.5 }, + } + }, + selection_box = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 } +}) + +minetest.register_node('homedecor:space_heater', { + drawtype = "nodebox", + description = S("Space heater"), + tiles = { 'homedecor_heater_tb.png', + 'homedecor_heater_tb.png', + 'homedecor_heater_sides.png', + 'homedecor_heater_sides.png', + 'homedecor_heater_back.png', + 'homedecor_heater_front.png'}, + sunlight_propagates = true, + paramtype = "light", + paramtype2 = "facedir", + walkable = true, + groups = { snappy = 3 }, + sounds = default.node_sound_leaves_defaults(), + node_box = { + type = "fixed", + fixed = { + {-0.1875, -0.5, 0.0625, 0.1875, 0, 0.3125}, + } + }, + selection_box = { + type = "fixed", + fixed = {-0.1875, -0.5, 0.0625, 0.1875, 0, 0.3125} + } +}) + +-- fans + minetest.register_entity("homedecor:mesh_desk_fan", { collisionbox = { 0, 0, 0, 0, 0, 0 }, visual = "mesh", @@ -83,3 +141,5 @@ minetest.register_node("homedecor:desk_fan", { entity_remove[1]:remove() end, }) + + diff --git a/homedecor/crafts.lua b/homedecor/crafts.lua index 6004b65f..80c9d38f 100644 --- a/homedecor/crafts.lua +++ b/homedecor/crafts.lua @@ -2090,3 +2090,11 @@ minetest.register_craft( { }, }) +minetest.register_craft( { + output = "homedecor:space_heater", + recipe = { + {"homedecor:plastic_sheeting", "homedecor:heating_element", "homedecor:plastic_sheeting"}, + {"homedecor:plastic_sheeting", "homedecor:fan_blades", "homedecor:motor"}, + {"homedecor:plastic_sheeting", "homedecor:heating_element", "homedecor:plastic_sheeting"} + }, +}) diff --git a/homedecor/init.lua b/homedecor/init.lua index 3e323c4a..643906c1 100644 --- a/homedecor/init.lua +++ b/homedecor/init.lua @@ -99,7 +99,7 @@ dofile(homedecor.modpath.."/furniture.lua") dofile(homedecor.modpath.."/furniture_medieval.lua") dofile(homedecor.modpath.."/furniture_bathroom.lua") dofile(homedecor.modpath.."/furniture_recipes.lua") -dofile(homedecor.modpath.."/fans.lua") +dofile(homedecor.modpath.."/climate-control.lua") dofile(homedecor.modpath.."/locked.lua") diff --git a/homedecor/misc-nodes.lua b/homedecor/misc-nodes.lua index 4463a566..02db03ac 100644 --- a/homedecor/misc-nodes.lua +++ b/homedecor/misc-nodes.lua @@ -253,31 +253,6 @@ for c in ipairs(curtaincolors) do end end -minetest.register_node('homedecor:air_conditioner', { - drawtype = "nodebox", - description = S("Air Conditioner"), - tiles = { 'homedecor_ac_tb.png', - 'homedecor_ac_tb.png', - 'homedecor_ac_sides.png', - 'homedecor_ac_sides.png', - 'homedecor_ac_back.png', - 'homedecor_ac_front.png'}, - sunlight_propagates = false, - paramtype = "light", - paramtype2 = "facedir", - walkable = true, - groups = { snappy = 3 }, - sounds = default.node_sound_leaves_defaults(), - node_box = { - type = "fixed", - fixed = { - {-0.5, -0.5, -0.5, 0.5, 0.124, 0.5 }, -- off by just a tad to force the adjoining faces to be drawn. - {-0.5, 0.125, -0.5, 0.5, 0.5, 0.5 }, - } - }, - selection_box = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 } -}) - local welcome_mat_colors = { "green", "brown", "grey" } for _, color in ipairs(welcome_mat_colors) do diff --git a/homedecor/textures/homedecor_heater_back.png b/homedecor/textures/homedecor_heater_back.png new file mode 100644 index 00000000..149dd5cf Binary files /dev/null and b/homedecor/textures/homedecor_heater_back.png differ diff --git a/homedecor/textures/homedecor_heater_front.png b/homedecor/textures/homedecor_heater_front.png new file mode 100644 index 00000000..a435b968 Binary files /dev/null and b/homedecor/textures/homedecor_heater_front.png differ diff --git a/homedecor/textures/homedecor_heater_sides.png b/homedecor/textures/homedecor_heater_sides.png new file mode 100644 index 00000000..ffce09cf Binary files /dev/null and b/homedecor/textures/homedecor_heater_sides.png differ diff --git a/homedecor/textures/homedecor_heater_tb.png b/homedecor/textures/homedecor_heater_tb.png new file mode 100644 index 00000000..88a7a270 Binary files /dev/null and b/homedecor/textures/homedecor_heater_tb.png differ