1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-24 17:50:37 +01:00

Updated homedecor_modpack : not running yet

This commit is contained in:
LeMagnesium 2015-01-24 19:40:00 +01:00
parent 36897537a5
commit 8787930b51
562 changed files with 3676 additions and 5162 deletions

View File

@ -328,7 +328,28 @@ if minetest.get_modpath("moreblocks") then
sounds = default.node_sound_stone_defaults(),
}
)
stairsplus:register_all(
"building_blocks",
"Adobe",
"building_blocks:Adobe",
{
description = "Adobe",
tiles = {"building_blocks_Adobe.png"},
groups = {crumbly=3},
sounds = default.node_sound_stone_defaults(),
}
)
stairsplus:register_all(
"building_blocks",
"Roofing",
"building_blocks:Roofing",
{
description = "Roofing",
tiles = {"building_blocks_Roofing.png"},
groups = {snappy=3},
sounds = default.node_sound_stone_defaults(),
}
)
else
bb_stairs = {}
@ -433,6 +454,18 @@ else
"Grate Stair",
"Grate Slab"
)
bb_stairs.register_stair_and_slab("Adobe", "building_blocks:Adobe",
{crumbly=3},
{"building_blocks_Adobe.png"},
"Adobe stair",
"Adobe slab"
)
bb_stairs.register_stair_and_slab("Roofing", "building_blocks:Roofing",
{snappy=3},
{"building_blocks_Roofing.png"},
"Roofing stair",
"Roofing slab"
)
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 324 B

After

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 407 B

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

After

Width:  |  Height:  |  Size: 261 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 365 B

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 B

After

Width:  |  Height:  |  Size: 280 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 409 B

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 515 B

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 B

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 710 B

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 740 B

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 410 B

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 388 B

After

Width:  |  Height:  |  Size: 343 B

View File

@ -1,7 +1,5 @@
-- Amiga 500 lookalike
-- Fun fact: "Amiga" is spanish for "female friend" ("Amigo" is for male);
-- that's why this computer was named "She Friend".
computer.register("computer:shefriendSOO", {
description = "SheFriendSOO";
tiles_off = { front=true; };
@ -13,9 +11,7 @@ computer.register("computer:shefriendSOO", {
});
});
-- Some generic laptop. Sony VAIO came to mind when thinking about a name :)
-- Fun fact: "Vanio" sounds like "baño" ("bathroom" in spanish, pronounced
-- as something like "bah-nee-oh")
-- Some generic laptop
computer.register("computer:vanio", {
description = "Pony Vanio";
tiles_off = { front=true; top=true; left=true; right=true; back=true; };
@ -32,8 +28,6 @@ computer.register("computer:vanio", {
});
-- Sony PlayStation lookalike
-- Fun fact: Swapping the first letters gives valid words :)
-- Pony SureiSutteshun!!!
computer.register("computer:slaystation", {
description = "Pony SlayStation";
tiles_off = { top=true; };
@ -50,8 +44,6 @@ computer.register("computer:slaystation", {
});
-- Sony PlayStation 2 lookalike
-- Fun fact: Swapping the first letters gives valid words :)
-- Pony SureiSutteshun!!!
computer.register("computer:slaystation2", {
description = "Pony SlayStation 2";
tiles_off = { front=true; };
@ -79,7 +71,7 @@ computer.register("computer:specter", {
});
});
-- Nintendo Wii lookalike.
-- Nintendo Wii lookalike
computer.register("computer:wee", {
description = "Nientiendo Wee";
tiles_off = { front=true; };
@ -90,7 +82,7 @@ computer.register("computer:wee", {
});
});
-- Apple iPad lookalike.
-- Apple iPad lookalike
minetest.register_node("computer:piepad", {
description = "Snapple Piepad",
drawtype = "signlike",
@ -131,22 +123,19 @@ computer.register("computer:admiral128", {
----------------------------added by crazyginger72-------------------------------
---------------------------------------------------------------------------------
-- Generic Flat Screen LCD (16x9) with keyboard
minetest.register_node("computer:monitor_on", {
description = "Monitor and keyboard",
tiles = {"computer_monitor_t.png","computer_monitor_bt.png",
"computer_monitor_l.png","computer_monitor_r.png",
"computer_monitor_b.png","computer_monitor_f_desktop.png"}, --"computer_monitor_f_on.png"}, --till i get a boot abm inplace
--inventory_image =
paramtype = "light",
light_source = 4,
paramtype2 = "facedir",
walkable = false,
is_ground_content = true,
groups = {crumbly=3,not_in_creative_inventory=1},
--sounds = default.node_sound_dirt_defaults(),
groups = {snappy=3,not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -159,17 +148,6 @@ computer.register("computer:admiral128", {
{-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116},
{-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5},
{-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698},
{-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125},
{-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125},
{-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375},
},
},
drop = 'computer:monitor',
on_rightclick = function ( pos, node, clicker, itemstack)
node.name = "computer:monitor";
@ -180,15 +158,15 @@ computer.register("computer:admiral128", {
minetest.register_node("computer:monitor_bios", {
description = "Monitor and keyboard",
tiles = {"computer_monitor_t.png","computer_monitor_bt.png","computer_monitor_l.png","computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_bios.png"},
--inventory_image =
tiles = {"computer_monitor_t.png","computer_monitor_bt.png","computer_monitor_l.png",
"computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_bios.png"},
paramtype = "light",
light_source = 4,
paramtype2 = "facedir",
walkable = false,
is_ground_content = true,
groups = {crumbly=3,not_in_creative_inventory=1},
--sounds = default.node_sound_dirt_defaults(),
groups = {snappy=3,not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -201,31 +179,20 @@ computer.register("computer:admiral128", {
{-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116},
{-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5},
{-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698},
{-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125},
{-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125},
{-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375},
},
},
drop = 'computer:monitor',
})
minetest.register_node("computer:monitor_loading", {
description = "Monitor and keyboard",
tiles = {"computer_monitor_t.png","computer_monitor_bt.png","computer_monitor_l.png","computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_loading.png"},
--inventory_image =
tiles = {"computer_monitor_t.png","computer_monitor_bt.png","computer_monitor_l.png",
"computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_loading.png"},
paramtype = "light",
light_source = 4,
paramtype2 = "facedir",
walkable = false,
is_ground_content = true,
groups = {crumbly=3,not_in_creative_inventory=1},
--sounds = default.node_sound_dirt_defaults(),
groups = {snappy=3,not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -238,31 +205,20 @@ computer.register("computer:admiral128", {
{-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116},
{-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5},
{-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698},
{-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125},
{-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125},
{-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375},
},
},
drop = 'computer:monitor',
})
minetest.register_node("computer:monitor_login", {
description = "Monitor and keyboard",
tiles = {"computer_monitor_t.png","computer_monitor_bt.png","computer_monitor_l.png","computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_login.png"},
--inventory_image =
tiles = {"computer_monitor_t.png","computer_monitor_bt.png","computer_monitor_l.png",
"computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_login.png"},
paramtype = "light",
light_source = 4,
paramtype2 = "facedir",
walkable = false,
is_ground_content = true,
groups = {crumbly=3,not_in_creative_inventory=1},
--sounds = default.node_sound_dirt_defaults(),
groups = {snappy=3,not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -275,31 +231,20 @@ computer.register("computer:admiral128", {
{-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116},
{-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5},
{-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698},
{-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125},
{-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125},
{-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375},
},
},
drop = 'computer:monitor',
})
minetest.register_node("computer:monitor_desktop", {
description = "Monitor and keyboard",
tiles = {"computer_monitor_t.png","computer_monitor_bt.png","computer_monitor_l.png","computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_desktop.png"},
--inventory_image =
tiles = {"computer_monitor_t.png","computer_monitor_bt.png","computer_monitor_l.png",
"computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_desktop.png"},
paramtype = "light",
light_source = 4,
paramtype2 = "facedir",
walkable = false,
is_ground_content = true,
groups = {crumbly=3,not_in_creative_inventory=1},
--sounds = default.node_sound_dirt_defaults(),
groups = {snappy=3,not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -312,31 +257,20 @@ computer.register("computer:admiral128", {
{-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116},
{-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5},
{-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698},
{-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125},
{-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125},
{-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375},
},
},
drop = 'computer:monitor',
})
minetest.register_node("computer:monitor", {
description = "Monitor and keyboard",
tiles = {"computer_monitor_t_off.png","computer_monitor_bt.png","computer_monitor_l.png","computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_off.png"},
--inventory_image =
tiles = {"computer_monitor_t_off.png","computer_monitor_bt.png","computer_monitor_l.png",
"computer_monitor_r.png","computer_monitor_b.png","computer_monitor_f_off.png"},
paramtype = "light",
light_source = 4,
paramtype2 = "facedir",
walkable = false,
is_ground_content = true,
groups = {crumbly=3},
--sounds = default.node_sound_dirt_defaults(),
groups = {snappy=3},
sound = default.node_sound_wood_defaults(),
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -349,39 +283,24 @@ computer.register("computer:admiral128", {
{-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.3125, 0.1875, 0.5, 0.375, 0.223116},
{-0.25, -0.5, 0.125, 0.25, -0.466981, 0.5},
{-0.125, -0.5, 0.3125, 0.125, 0.0283019, 0.346698},
{-0.375, -0.3125, 0.208965, 0.375, 0.240566, 0.3125},
{-0.4375, -0.5, -0.4375, 0.4375, -0.4375, -0.125},
{-0.1875, -0.5, 0.25, 0.1875, -0.410377, 0.375},
},
},
drop = 'computer:monitor' ,
on_rightclick = function ( pos, node, clicker, itemstack)
node.name = "computer:monitor_on";
minetest.set_node(pos, node);
nodeupdate(pos)
end
})
--WIFI Router (linksys look-a-like)
minetest.register_node("computer:router", {
description = "WIFI Router",
tiles = {"computer_router_t.png","computer_router_bt.png","computer_router_l.png","computer_router_r.png","computer_router_b.png",{name="computer_router_f_animated.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1.0}},}, --"computer_router_f.png"},
--inventory_image =
tiles = {"computer_router_t.png","computer_router_bt.png","computer_router_l.png","computer_router_r.png","computer_router_b.png",
{name="computer_router_f_animated.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1.0}},}, --"computer_router_f.png"},
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
is_ground_content = true,
groups = {crumbly=3},
--sounds = default.node_sound_dirt_defaults(),
groups = {snappy=3},
sound = default.node_sound_wood_defaults(),
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -392,29 +311,19 @@ computer.register("computer:admiral128", {
{-0.0625, -0.4375, 0.3125, 0.0625, -0.25, 0.375},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.25, -0.5, -0.0625, 0.25, -0.375, 0.3125},
{-0.1875, -0.4375, 0.3125, -0.125, -0.1875, 0.375},
{0.125, -0.4375, 0.3125, 0.1875, -0.1875, 0.375},
{-0.0625, -0.4375, 0.3125, 0.0625, -0.25, 0.375},
},
},
})
--Modern PC Tower
minetest.register_node("computer:tower_on", {
description = "Computer Tower",
tiles = {"computer_tower_t.png","computer_tower_bt.png","computer_tower_l.png","computer_tower_r.png","computer_tower_b.png","computer_tower_f_on.png"},
--inventory_image =
tiles = {"computer_tower_t.png","computer_tower_bt.png","computer_tower_l.png",
"computer_tower_r.png","computer_tower_b.png","computer_tower_f_on.png"},
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
is_ground_content = true,
groups = {crumbly=3,not_in_creative_inventory=1},
--sounds = default.node_sound_dirt_defaults(),
groups = {snappy=3,not_in_creative_inventory=1},
sound = default.node_sound_wood_defaults(),
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -431,7 +340,6 @@ computer.register("computer:admiral128", {
},
},
drop = 'computer:tower',
on_rightclick = function ( pos, node, clicker, itemstack)
node.name = "computer:tower";
minetest.set_node(pos, node);
@ -441,14 +349,14 @@ computer.register("computer:admiral128", {
minetest.register_node("computer:tower", {
description = "Computer Tower",
tiles = {"computer_tower_t.png","computer_tower_bt.png","computer_tower_l.png","computer_tower_r.png","computer_tower_b.png","computer_tower_f_off.png"},
--inventory_image =
tiles = {"computer_tower_t.png","computer_tower_bt.png","computer_tower_l.png","computer_tower_r.png",
"computer_tower_b.png","computer_tower_f_off.png"},
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
is_ground_content = true,
groups = {crumbly=3},
--sounds = default.node_sound_dirt_defaults(),
groups = {snappy=3},
sound = default.node_sound_wood_defaults(),
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -472,17 +380,16 @@ computer.register("computer:admiral128", {
})
-- Printer/scaner combo
minetest.register_node("computer:printer", {
description = "Printer Scaner Combo",
tiles = {"computer_printer_t.png","computer_printer_bt.png","computer_printer_l.png","computer_printer_r.png","computer_printer_b.png","computer_printer_f.png"},
--inventory_image =
tiles = {"computer_printer_t.png","computer_printer_bt.png","computer_printer_l.png",
"computer_printer_r.png","computer_printer_b.png","computer_printer_f.png"},
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
is_ground_content = true,
groups = {crumbly=3},
--sounds = default.node_sound_dirt_defaults(),
groups = {snappy=3},
sound = default.node_sound_wood_defaults(),
drawtype = "nodebox",
node_box = {
type = "fixed",
@ -497,23 +404,9 @@ minetest.register_node("computer:printer", {
{-0.25, -0.481132, -0.3125, 0.25, -0.4375, 0},
},
},
selection_box = {
type = "fixed",
fixed = {
{-0.4375, -0.3125, -0.125, 0.4375, -0.0625, 0.375},
{-0.4375, -0.5, -0.125, 0.4375, -0.4375, 0.375},
{-0.4375, -0.5, -0.125, -0.25, -0.0625, 0.375},
{0.25, -0.5, -0.125, 0.4375, -0.0625, 0.375},
{-0.4375, -0.5, -0.0625, 0.4375, -0.0625, 0.375},
{-0.375, -0.4375, 0.25, 0.375, -0.0625, 0.4375},
{-0.25, -0.25, 0.4375, 0.25, 0.0625, 0.5},
{-0.25, -0.481132, -0.3125, 0.25, -0.4375, 0},
},
},
})
--Rack Server
minetest.register_node("computer:server", {
drawtype = "nodebox",
description = "Rack Server",
@ -531,7 +424,6 @@ minetest.register_node("computer:server", {
paramtype2 = "facedir",
walkable = true,
groups = {snappy=3},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
@ -540,7 +432,6 @@ minetest.register_node("computer:server", {
type = "fixed",
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
},
--drop = 'computer:server',
sounds = default.node_sound_wood_defaults(),
on_rightclick = function ( pos, node, clicker, itemstack)
node.name = "computer:server_on";
@ -554,10 +445,7 @@ minetest.register_node("computer:server", {
return
end
return minetest.item_place(itemstack, placer, pointed_thing)
end,
end
})
minetest.register_node("computer:server_on", {
@ -577,7 +465,6 @@ minetest.register_node("computer:server_on", {
paramtype2 = "facedir",
walkable = true,
groups = {snappy=3,not_in_creative_inventory=1},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
@ -586,15 +473,11 @@ minetest.register_node("computer:server_on", {
type = "fixed",
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
},
sounds = default.node_sound_wood_defaults(),
drop = 'computer:server',
on_rightclick = function ( pos, node, clicker, itemstack)
node.name = "computer:server";
minetest.set_node(pos, node);
nodeupdate(pos)
end ,
end
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 824 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 741 B

After

Width:  |  Height:  |  Size: 549 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 B

After

Width:  |  Height:  |  Size: 102 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 83 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 83 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 209 B

After

Width:  |  Height:  |  Size: 156 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 203 B

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 B

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 B

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 B

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 B

After

Width:  |  Height:  |  Size: 67 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 B

After

Width:  |  Height:  |  Size: 67 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 895 B

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 327 B

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 323 B

After

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 380 B

After

Width:  |  Height:  |  Size: 355 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 83 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 211 B

After

Width:  |  Height:  |  Size: 201 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 B

After

Width:  |  Height:  |  Size: 83 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 904 B

After

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 906 B

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 B

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 B

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

After

Width:  |  Height:  |  Size: 96 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 350 B

View File

@ -1,193 +1,91 @@
local cp = nil
-- FLAME TYPES
local function register_fake_fire(name, def)
assert(name, "local registration called without name")
assert(def, "local registration called without node definition")
-- SMOKEY FIRE (TRIGGERS SMOKE ABM)
minetest.register_node("fake_fire:fake_fire", {
-- make sure shared definitions are set
def.is_ground_content = true
def.inventory_image = def.inventory_image or name.. ".png"
def.drawtype = "plantlike"
def.waving = 1 -- Waving wasn't an option when this mod was written. ~ LazyJ, 2014_03_13
def.light_source = def.lightsource or 14
-- Adding sunlight_propagtes and leaving comments as a future reference.
-- If true, sunlight will go infinitely through this (no shadow is cast).
-- Because fire produces light it should be "true" so fire *doesn't* have
-- a shadow.
def.sunlight_propagates = true
-- damage_per_second = 2*0.5, -- It's *fake* fire. PvP on our server has
-- been disabled for a reason. I don't want griefers lighting players on
-- fire or trapping them in blazes. ~ LazyJ, 2014_0_13
def.groups = def.groups or {
oddly_breakable_by_hand=3, dig_immediate=2,
attached_node=1, not_in_creative_inventory=1
}
def.paramtype = "light"
def.walkable = false
def.drop = "" -- So fire won't return to the inventory. ~ LazyJ
def.sounds = def.sounds or minetest.sound_play("fire_small", {pos=cp, loop=true})
def.buildable_to = true
local swap_on_punch = def.swap_on_punch
def.on_punch = def.on_punch or function (pos, node, puncher)
-- A max_hear_distance of 20 may freak some players out by the "hiss"
-- so I reduced it to 5.
minetest.sound_play("fire_extinguish", {pos = pos, gain = 1.0, max_hear_distance = 5,})
-- swap the node on_punch if def.swap_on_punch is set
if swap_on_punch then
minetest.set_node(pos, {name = swap_on_punch})
end
end
-- no need to add these to the global registration table
def.swap_on_punch = nil
def.smoking = nil
minetest.register_node("fake_fire:" .. name, def)
end
-- FLAME TYPES
register_fake_fire("fake_fire", {
description = "Smokey, Fake Fire",
tiles = {
{name="fake_fire_animated.png", animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=1.5}},
},
is_ground_content = true,
inventory_image = 'fake_fire.png',
wield_image = {
{name="fake_fire_animated.png", animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=1.5}},
},
drawtype = "plantlike",
-- Waving wasn't an option when this mod was written. ~ LazyJ, 2014_03_13
waving = 1,
light_source = 14,
-- Adding sunlight_propagtes and leaving comments as a future reference.
-- If true, sunlight will go infinitely through this (no shadow is cast).
-- Because fire produces light it should be "true" so fire *doesn't* have
-- a shadow.
sunlight_propagates = true,
-- damage_per_second = 2*0.5, -- It's *fake* fire. PvP on our server has
-- been disabled for a reason. I don't want griefers lighting players on
-- fire or trapping them in blazes. ~ LazyJ, 2014_0_13
--groups = {dig_immediate=3,attached_node=1},
groups = {
oddly_breakable_by_hand=3, dig_immediate=2, attached_node=1,
not_in_creative_inventory=1
},
paramtype = "light",
walkable = false,
drop = "", -- So fire won't return to the inventory. ~ LazyJ
sounds = minetest.sound_play("fire_small", {pos=cp, loop=true}),
on_punch = function (pos,node,puncher)
-- A max_hear_distance of 20 may freak some players out by the "hiss"
-- so I reduced it to 5.
minetest.sound_play("fire_extinguish", {pos = pos, gain = 1.0,
max_hear_distance = 5,})
-- This swaps the smoky version with the smokeless version. ~ LazyJ
minetest.set_node(pos, {name = "fake_fire:smokeless_fire"})
end
swap_on_punch = "fake_fire:smokeless_fire",
})
-- SMOKELESS FIRE (DOES NOT TRIGGER SMOKE ABM)
minetest.register_node("fake_fire:smokeless_fire", {
register_fake_fire("smokeless_fire", {
description = "Smokeless, Fake Fire",
tiles = {
{name="fake_fire_animated.png", animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=1.5}},
},
is_ground_content = true,
inventory_image = 'fake_fire.png',
wield_image = {
{name="fake_fire_animated.png", animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=1.5}},
},
drawtype = "plantlike",
-- Waving wasn't an option when this mod was written. ~ LazyJ, 2014_03_13
waving = 1,
light_source = 14,
-- Adding sunlight_propagtes and leaving comments as a future reference.
-- If true, sunlight will go infinitely through this (no shadow is cast).
-- Because fire produces light it should be "true" so fire *doesn't* have
-- a shadow.
sunlight_propagates = true,
-- damage_per_second = 2*0.5, -- It's *fake* fire. PvP on our server has
-- been disabled for a reason. I don't want griefers lighting players on
-- fire or trapping them in blazes. ~ LazyJ, 2014_0_13
--groups = {dig_immediate=3,attached_node=1},
groups = {
oddly_breakable_by_hand=3, dig_immediate=2, attached_node=1,
not_in_creative_inventory=1
},
paramtype = "light",
walkable = false,
drop = "", -- So fire won't return to the inventory. ~ LazyJ
sounds = minetest.sound_play("fire_small", {pos=cp, loop=true}),
on_punch = function (pos,node,puncher)
-- A max_hear_distance of 20 may freak some players out by the "hiss"
-- so I reduced it to 5.
minetest.sound_play("fire_extinguish", {pos = pos, gain = 1.0,
max_hear_distance = 5,})
-- This swaps the smokeless version with the smoky version. ~ LazyJ
minetest.set_node(pos, {name = "fake_fire:fake_fire"})
end
swap_on_punch = "fake_fire:fake_fire",
})
-- SMOKEY ICE FIRE (TRIGGERS SMOKE ABM)
minetest.register_node("fake_fire:ice_fire", {
register_fake_fire("ice_fire", {
description = "Smoky, Fake, Ice Fire",
tiles = {
{name="ice_fire_animated.png", animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=1.5}},
},
is_ground_content = true,
inventory_image = 'ice_fire.png',
wield_image = {
{name="ice_fire_animated.png", animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=1.5}},
},
drawtype = "plantlike",
-- Waving wasn't an option when this mod was written. ~ LazyJ, 2014_03_13
waving = 1,
light_source = 14,
-- Adding sunlight_propagtes and leaving comments as a future reference.
-- If true, sunlight will go infinitely through this (no shadow is cast).
-- Because fire produces light it should be "true" so fire *doesn't* have
-- a shadow.
sunlight_propagates = true,
-- damage_per_second = 2*0.5, -- It's *fake* fire. PvP on our server has
-- been disabled for a reason. I don't want griefers lighting players on
-- fire or trapping them in blazes. ~ LazyJ, 2014_0_13
--groups = {dig_immediate=3,attached_node=1},
groups = {
oddly_breakable_by_hand=3, dig_immediate=2, attached_node=1,
not_in_creative_inventory=1
},
paramtype = "light",
walkable = false,
drop = "", -- So fire won't return to the inventory. ~ LazyJ
sounds = minetest.sound_play("fire_small", {pos=cp, loop=true}),
on_punch = function (pos,node,puncher)
-- A max_hear_distance of 20 may freak some players out by the "hiss"
-- so I reduced it to 5.
minetest.sound_play("fire_extinguish", {pos = pos, gain = 1.0,
max_hear_distance = 5,})
-- This swaps the smoky version with the smokeless version. ~ LazyJ
minetest.set_node(pos, {name = "fake_fire:smokeless_ice_fire"})
end
swap_on_punch = "fake_fire:smokeless_ice_fire",
})
-- SMOKELESS ICE FIRE (DOES NOT TRIGGER SMOKE ABM)
minetest.register_node("fake_fire:smokeless_ice_fire", {
register_fake_fire("smokeless_ice_fire", {
description = "Smokeless, Fake, Ice Fire",
tiles = {
{name="ice_fire_animated.png", animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=1.5}},
},
is_ground_content = true,
inventory_image = 'ice_fire.png',
wield_image = {
{name="ice_fire_animated.png", animation={type="vertical_frames",
aspect_w=16, aspect_h=16, length=1.5}},
},
drawtype = "plantlike",
-- Waving wasn't an option when this mod was written. ~ LazyJ, 2014_03_13
waving = 1,
light_source = 14,
-- Adding sunlight_propagtes and leaving comments as a future reference.
-- If true, sunlight will go infinitely through this (no shadow is cast).
-- Because fire produces light it should be "true" so fire *doesn't* have
-- a shadow.
sunlight_propagates = true,
-- damage_per_second = 2*0.5, -- It's *fake* fire. PvP on our server has
-- been disabled for a reason. I don't want griefers lighting players on
-- fire or trapping them in blazes. ~ LazyJ, 2014_0_13
--groups = {dig_immediate=3,attached_node=1},
groups = {
oddly_breakable_by_hand=3, dig_immediate=2, attached_node=1,
not_in_creative_inventory=1
},
paramtype = "light",
walkable = false,
drop = "", -- So fire won't return to the inventory. ~ LazyJ
sounds = minetest.sound_play("fire_small", {pos=cp, loop=true}),
on_punch = function (pos,node,puncher)
-- A max_hear_distance of 20 may freak some players out by the "hiss"
-- so I reduced it to 5.
minetest.sound_play("fire_extinguish", {pos = pos, gain = 1.0,
max_hear_distance = 5,})
-- This swaps the smokeless version with the smoky version. ~ LazyJ
minetest.set_node(pos, {name = "fake_fire:ice_fire"})
end
swap_on_punch = "fake_fire:ice_fire",
})
-- FLINT and STEEL
minetest.register_tool("fake_fire:flint_and_steel", {
description = "Flint and steel",
inventory_image = "flint_and_steel.png",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 372 B

After

Width:  |  Height:  |  Size: 351 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 354 B

After

Width:  |  Height:  |  Size: 312 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 525 B

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 674 B

After

Width:  |  Height:  |  Size: 662 B

View File

@ -25,15 +25,13 @@ for i in ipairs(bathroom_tile_colors) do
"homedecor_bathroom_tiles_"..color..".png^[transformR90",
"homedecor_bathroom_tiles_"..color..".png^[transformR90"
},
is_ground_content = true,
groups = {cracky=3},
sounds = default.node_sound_stone_defaults(),
})
end
minetest.register_node("homedecor:towel_rod", {
homedecor.register("towel_rod", {
description = "Towel rod with towel",
drawtype = "nodebox",
tiles = {
"homedecor_towel_rod_top.png",
"homedecor_towel_rod_bottom.png",
@ -42,8 +40,6 @@ minetest.register_node("homedecor:towel_rod", {
"homedecor_towel_rod_fb.png",
"homedecor_towel_rod_fb.png"
},
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
@ -62,8 +58,7 @@ minetest.register_node("homedecor:towel_rod", {
sounds = default.node_sound_defaults(),
})
minetest.register_node('homedecor:medicine_cabinet', {
drawtype = "nodebox",
homedecor.register("medicine_cabinet", {
description = S("Medicine Cabinet"),
tiles = {
'homedecor_medicine_cabinet_tb.png',
@ -74,10 +69,6 @@ minetest.register_node('homedecor:medicine_cabinet', {
'homedecor_medicine_cabinet_front.png'
},
inventory_image = "homedecor_medicine_cabinet_inv.png",
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = {-0.3125, -0.1875, 0.3125, 0.3125, 0.5, 0.5}
@ -89,45 +80,16 @@ minetest.register_node('homedecor:medicine_cabinet', {
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
on_punch = function(pos, node, puncher, pointed_thing)
local fdir = node.param2
minetest.set_node(pos, { name = "homedecor:medicine_cabinet_open", param2 = fdir })
end,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",
"size[8,7]"..
"list[current_name;main;1,0;6,1;]"..
"list[current_player;main;0,3;8,4;]")
meta:set_string("infotext", S("Medicine cabinet"))
local inv = meta:get_inventory()
inv:set_size("main", 16)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", S("%s moves stuff in medicine cabinet at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", S("%s moves stuff to medicine cabinet at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", S("%s takes stuff from medicine cabinet at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
node.name = "homedecor:medicine_cabinet_open"
minetest.swap_node(pos, node)
end,
infotext=S("Medicine cabinet"),
inventory = {
size=6,
},
})
minetest.register_node("homedecor:medicine_cabinet_open", {
homedecor.register("medicine_cabinet_open", {
tiles = {
'homedecor_medicine_cabinet_tb.png',
'homedecor_medicine_cabinet_tb.png',
@ -136,9 +98,6 @@ minetest.register_node("homedecor:medicine_cabinet_open", {
'homedecor_medicine_cabinet_back.png',
"homedecor_medicine_cabinet_open_front.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = { snappy = 3, not_in_creative_inventory=1 },
node_box = {
type = "fixed",
@ -149,19 +108,16 @@ minetest.register_node("homedecor:medicine_cabinet_open", {
},
drop = "homedecor:medicine_cabinet",
on_punch = function(pos, node, puncher, pointed_thing)
local fdir = node.param2
minetest.set_node(pos, { name = "homedecor:medicine_cabinet", param2 = fdir })
node.name = "homedecor:medicine_cabinet"
minetest.swap_node(pos, node)
end,
})
minetest.register_node("homedecor:toilet_paper", {
homedecor.register("toilet_paper", {
description = S("Toilet paper"),
drawtype = "mesh",
mesh = "homedecor_toilet_paper.obj",
tiles = { "homedecor_toilet_paper.png" },
inventory_image = "homedecor_toilet_paper_inv.png",
paramtype = "light",
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.1875, 0.125, 0.0625, 0.25, 0.4375, 0.5 }

View File

@ -0,0 +1,184 @@
local S = homedecor.gettext
homedecor.register("toilet", {
description = S("Toilet"),
tiles = { "forniture_marble.png" },
node_box = {
type = "fixed",
fixed = {
{ -0.20, -0.50, -0.20, 0.20, -0.45, 0.50, },
{ -0.10, -0.45, -0.10, 0.10, 0.00, 0.50, },
{ -0.30, -0.20, -0.30, 0.30, 0.00, 0.35, },
{ -0.25, 0.00, -0.25, 0.25, 0.05, 0.25, },
{ -0.30, 0.00, 0.30, 0.30, 0.40, 0.50, },
{ -0.05, 0.40, 0.35, 0.05, 0.45, 0.45, },
},
},
groups = {cracky=3,},
sounds = default.node_sound_stone_defaults(),
on_punch = function (pos, node, puncher)
node.name = "homedecor:toilet_open"
minetest.set_node(pos, node)
end,
})
homedecor.register("toilet_open", {
tiles = {
"forniture_marble_top_toilet.png",
"forniture_marble.png"
},
node_box = {
type = "fixed",
fixed = {
{ -0.20, -0.50, -0.20, 0.20, -0.45, 0.50, },
{ -0.10, -0.45, -0.10, 0.10, -0.20, 0.50, },
{ -0.10, -0.20, 0.30, 0.10, 0.00, 0.50, },
{ -0.30, -0.20, 0.10, 0.30, 0.00, 0.35, },
{ -0.30, -0.20, -0.30, -0.10, -0.15, 0.10, },
{ -0.10, -0.20, -0.30, 0.10, -0.15, -0.10, },
{ 0.10, -0.20, -0.30, 0.30, -0.15, 0.10, },
{ -0.30, -0.15, -0.30, -0.20, 0.00, 0.10, },
{ -0.20, -0.15, -0.30, 0.20, 0.00, -0.20, },
{ 0.20, -0.15, -0.30, 0.30, 0.00, 0.10, },
{ -0.25, 0.00, 0.20, 0.25, 0.50, 0.25, },
{ -0.30, 0.00, 0.30, 0.30, 0.40, 0.50, },
},
},
drop = "homedecor:toilet",
groups = {cracky = 3,},
--sounds = {dig = "3dforniture_dig_toilet", gain=0.5},
sounds = default.node_sound_stone_defaults(),
on_punch = function (pos, node, puncher)
node.name = "homedecor:toilet"
minetest.set_node(pos, node)
minetest.sound_play("homedecor_toilet_flush", {
pos=pos,
max_hear_distance = 5,
gain = 1,
})
end,
})
--Sink
homedecor.register("sink", {
description = S("Sink"),
tiles = {
"forniture_marble_top_sink.png",
"forniture_marble.png"
},
inventory_image="3dforniture_inv_sink.png",
node_box = {
type = "fixed",
fixed = {
{ -0.15, 0.35, 0.20, 0.15, 0.40, 0.50, },
{ -0.25, 0.40, 0.40, 0.25, 0.45, 0.50, },
{ -0.25, 0.40, 0.15, -0.15, 0.45, 0.40, },
{ 0.15, 0.40, 0.15, 0.25, 0.45, 0.40, },
{ -0.15, 0.40, 0.15, 0.15, 0.45, 0.20, },
{ -0.30, 0.45, 0.40, 0.30, 0.50, 0.50, },
{ -0.30, 0.45, 0.10, -0.25, 0.50, 0.40, },
{ 0.25, 0.45, 0.10, 0.30, 0.50, 0.40, },
{ -0.25, 0.45, 0.10, 0.25, 0.50, 0.15, },
{-0.1, -0.5, 0.3, 0.1, 0.4, 0.5},
},
},
selection_box = {
type = "fixed",
fixed = {-0.3,-0.5,0.1, 0.3,0.5,0.5},
},
groups = {cracky=2,},
sounds = default.node_sound_stone_defaults(),
})
--Taps
homedecor.register("taps", {
description = S("Taps"),
tiles = { "forniture_metal.png" },
inventory_image="3dforniture_inv_taps.png",
sunlight_propagates = true,
node_box = {
type = "fixed",
fixed = {
{ -0.25, -0.450, 0.49, 0.25, -0.30, 0.50, },
{ -0.05, -0.400, 0.25, 0.05, -0.35, 0.50, },
{ -0.05, -0.425, 0.25, 0.05, -0.40, 0.30, },
{ -0.20, -0.400, 0.45, -0.15, -0.35, 0.50, },
{ -0.20, -0.450, 0.40, -0.15, -0.30, 0.45, },
{ -0.25, -0.400, 0.40, -0.10, -0.35, 0.45, },
{ 0.15, -0.400, 0.45, 0.20, -0.35, 0.50, },
{ 0.15, -0.450, 0.40, 0.20, -0.30, 0.45, },
{ 0.10, -0.400, 0.40, 0.25, -0.35, 0.45, },
},
},
selection_box = {
type = "fixed",
fixed = { -0.25, -0.45, 0.25, 0.25, -0.3, 0.5 },
},
groups = {cracky=2,},
sounds = default.node_sound_stone_defaults(),
})
--Shower Tray
homedecor.register("shower_tray", {
description = S("Shower Tray"),
tiles = {
"forniture_marble_base_ducha_top.png",
"forniture_marble.png"
},
sunlight_propagates = true,
legacy_facedir_simple = true,
node_box = {
type = "fixed",
fixed = {
{ -0.50, -0.50, -0.50, 0.50, -0.45, 0.50, },
{ -0.50, -0.45, -0.50, 0.50, -0.40, -0.45, },
{ -0.50, -0.45, 0.45, 0.50, -0.40, 0.50, },
{ -0.50, -0.45, -0.45, -0.45, -0.40, 0.45, },
{ 0.45, -0.45, -0.45, 0.50, -0.40, 0.45, },
},
},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, -0.4, 0.5 },
},
groups = {cracky=2,},
sounds = default.node_sound_stone_defaults(),
})
--Shower Head
homedecor.register("shower_head", {
description = S("Shower Head"),
tiles = { "forniture_metal.png" },
inventory_image="3dforniture_inv_shower_head.png",
sunlight_propagates = true,
node_box = {
type = "fixed",
fixed = {
{ -0.10, -0.50, 0.10, 0.10, -0.40, 0.30, },
{ -0.05, -0.40, 0.15, 0.05, -0.30, 0.25, },
{ -0.05, -0.35, 0.25, 0.05, -0.30, 0.50, },
{ -0.10, -0.40, 0.49, 0.10, -0.25, 0.50, },
},
},
selection_box = {
type = "fixed",
fixed = { -0.1, -0.5, 0.1, 0.1, -0.25, 0.5 },
},
groups = {cracky=2,},
sounds = default.node_sound_stone_defaults(),
})
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")

View File

@ -2,8 +2,7 @@
local S = homedecor.gettext
minetest.register_node('homedecor:air_conditioner', {
drawtype = "nodebox",
homedecor.register("air_conditioner", {
description = S("Air Conditioner"),
tiles = { 'homedecor_ac_tb.png',
'homedecor_ac_tb.png',
@ -11,10 +10,6 @@ minetest.register_node('homedecor:air_conditioner', {
'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 = {
@ -24,25 +19,22 @@ minetest.register_node('homedecor:air_conditioner', {
{-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 }
selection_box = { type="regular" },
})
-- fans
minetest.register_entity("homedecor:mesh_desk_fan", {
collisionbox = { 0, 0, 0, 0, 0, 0 },
collisionbox = homedecor.nodebox.null,
visual = "mesh",
mesh = "homedecor_desk_fan.b3d",
textures = {"homedecor_desk_fan_uv.png"},
visual_size = {x=10, y=10},
})
minetest.register_node("homedecor:desk_fan", {
homedecor.register("desk_fan", {
description = "Desk Fan",
drawtype = "nodebox",
paramtype2 = "facedir",
legacy_facedir_simple = true,
paramtype = "light",
groups = {oddly_breakable_by_hand=2},
node_box = {
type = "fixed",
@ -53,12 +45,7 @@ minetest.register_node("homedecor:desk_fan", {
tiles = {"homedecor_desk_fan_body.png"},
inventory_image = "homedecor_desk_fan_inv.png",
wield_image = "homedecor_desk_fan_inv.png",
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
}
},
selection_box = { type = "regular" },
on_construct = function(pos)
local entity_remove = minetest.get_objects_inside_radius(pos, 0.1)
local meta = minetest.get_meta(pos)
@ -117,9 +104,8 @@ minetest.register_node("homedecor:desk_fan", {
-- ceiling fan
minetest.register_node('homedecor:ceiling_fan', {
homedecor.register("ceiling_fan", {
description = S("Ceiling Fan"),
drawtype = "nodebox",
tiles = {
{ name="homedecor_ceiling_fan_top.png",
animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=0.5} },
@ -135,10 +121,6 @@ minetest.register_node('homedecor:ceiling_fan', {
{ -0.0625, 0.375, -0.0625, 0.0625, 0.5, 0.0625 }
}
},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
groups = { snappy = 3 },
light_source = LIGHT_MAX-1,
sounds = default.node_sound_wood_defaults(),
@ -146,8 +128,7 @@ minetest.register_node('homedecor:ceiling_fan', {
-- heating devices
minetest.register_node('homedecor:space_heater', {
drawtype = "nodebox",
homedecor.register("space_heater", {
description = S("Space heater"),
tiles = { 'homedecor_heater_tb.png',
'homedecor_heater_tb.png',
@ -158,9 +139,6 @@ minetest.register_node('homedecor:space_heater', {
},
inventory_image = "homedecor_heater_inv.png",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
groups = { snappy = 3 },
sounds = default.node_sound_leaves_defaults(),
node_box = {
@ -175,13 +153,10 @@ minetest.register_node('homedecor:space_heater', {
}
})
minetest.register_node("homedecor:radiator", {
homedecor.register("radiator", {
tiles = { "homedecor_white_metal.png" },
inventory_image = "homedecor_radiator_inv.png",
description = "Radiator heater",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = {
type = "fixed",

View File

@ -1,12 +1,9 @@
minetest.register_node("homedecor:analog_clock_plastic", {
homedecor.register("analog_clock_plastic", {
description = "Analog clock (plastic)",
drawtype = "mesh",
mesh = "homedecor_analog_clock.obj",
tiles = { "homedecor_analog_clock_plastic.png" },
inventory_image = "homedecor_analog_clock_plastic_inv.png",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
collision_box = {
type = "fixed",
fixed = {
{ -8/32, -3/32, 15/32, 8/32, 3/32, 16/32 },
@ -23,15 +20,12 @@ minetest.register_node("homedecor:analog_clock_plastic", {
groups = {snappy=3},
})
minetest.register_node("homedecor:analog_clock_wood", {
homedecor.register("analog_clock_wood", {
description = "Analog clock (wood)",
drawtype = "mesh",
mesh = "homedecor_analog_clock.obj",
tiles = { "homedecor_analog_clock_wood.png" },
inventory_image = "homedecor_analog_clock_wood_inv.png",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
collision_box = {
type = "fixed",
fixed = {
{ -8/32, -3/32, 15/32, 8/32, 3/32, 16/32 },
@ -48,9 +42,8 @@ minetest.register_node("homedecor:analog_clock_wood", {
groups = {snappy=3},
})
minetest.register_node("homedecor:digital_clock", {
homedecor.register("digital_clock", {
description = "Digital clock",
drawtype = "nodebox",
tiles = {
"homedecor_digital_clock_edges.png",
"homedecor_digital_clock_edges.png",
@ -60,8 +53,6 @@ minetest.register_node("homedecor:digital_clock", {
"homedecor_digital_clock_front.png"
},
inventory_image = "homedecor_digital_clock_inv.png",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
@ -71,9 +62,8 @@ minetest.register_node("homedecor:digital_clock", {
groups = {snappy=3},
})
minetest.register_node("homedecor:alarm_clock", {
homedecor.register("alarm_clock", {
description = "Alarm clock",
drawtype = "nodebox",
tiles = {
"homedecor_alarm_clock_top.png",
"homedecor_alarm_clock_bottom.png",
@ -83,8 +73,6 @@ minetest.register_node("homedecor:alarm_clock", {
"homedecor_alarm_clock_front.png"
},
inventory_image = "homedecor_alarm_clock_inv.png",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {

View File

@ -14,10 +14,7 @@ minetest.register_node("homedecor:cobweb_corner", {
liquid_renewable = false,
liquid_range = 0,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
},
selection_box = { type = "regular" },
visual_scale = 1.4,
groups = { snappy = 3, liquid=3 },
after_place_node = function(pos, placer, itemstack, pointed_thing)
@ -94,10 +91,7 @@ minetest.register_node("homedecor:cobweb_plantlike", {
liquid_renewable = false,
liquid_range = 0,
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}
},
selection_box = { type = "regular" },
visual_scale = 1.189,
groups = { snappy = 3, liquid=3, not_in_creative_inventory = 1 },
drop = "homedecor:cobweb_corner"

View File

@ -2133,6 +2133,15 @@ minetest.register_craft({
},
})
minetest.register_craft({
output = "homedecor:cardboard_box_big 2",
recipe = {
{ "default:paper", "", "default:paper" },
{ "default:paper", "", "default:paper" },
{ "default:paper", "default:paper", "default:paper" },
},
})
minetest.register_craft({
output = "homedecor:desk",
recipe = {
@ -2879,7 +2888,10 @@ minetest.register_craft({
local bookcolors = {
"red",
"green",
"blue"
"blue",
"violet",
"grey",
"brown"
}
for _, color in ipairs(bookcolors) do

View File

@ -20,12 +20,7 @@ local function countSolids(pos,node,level)
local solids = 0
for x = -1, 1 do
for z = -1, 1 do
local y = 0
if node.param2 == 5 then
y = -level
else
y = level
end
local y = (node.param2 == 5) and -level or level
-- special cases when x == z == 0
if x == 0 and z == 0 then
if level == 1 then
@ -76,12 +71,7 @@ local function calculateClosed(pos)
return true
end
end
local x
if direction == 1 then
x = 1
else
x = -1
end
local x = (direction == 1) and 1 or -1
if isSolid(pos,{x,0,-1}) and not isSolid(pos,{x,0,0}) and isSolid(pos,{x,0,1}) then
if string.find(node.name,'_bottom_') then
return calculateClosed({x=pos.x,y=pos.y+1,z=pos.z})
@ -99,12 +89,7 @@ local function calculateClosed(pos)
return true
end
end
local z
if direction == 3 then
z = 1
else
z = -1
end
local z = (direction == 3) and 1 or -1
if isSolid(pos,{-1,0,z}) and not isSolid(pos,{0,0,z}) and isSolid(pos,{1,0,z}) then
if string.find(node.name,'_bottom_') then
return calculateClosed({x=pos.x,y=pos.y+1,z=pos.z})
@ -122,11 +107,7 @@ end
local function getClosed(pos)
local isClosed = minetest.get_meta(pos):get_string('closed')
if isClosed=='' then
if calculateClosed(pos) then
return true
else
return false
end
return calculateClosed(pos)
else
isClosed = tonumber(isClosed)
-- may be closed or open (1 or 0)
@ -135,13 +116,8 @@ local function getClosed(pos)
end
local function addDoorNode(pos,def,isClosed)
if isClosed then
isClosed = 1
else
isClosed = 0
end
minetest.add_node(pos, def)
minetest.get_meta(pos):set_int('closed',isClosed)
minetest.set_node(pos, def)
minetest.get_meta(pos):set_int('closed', isClosed and 1 or 0)
end
local sides = {"left", "right"}
@ -210,7 +186,6 @@ for i in ipairs(sides) do
paramtype2 = "facedir",
groups = {snappy=3, not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
walkable = true,
use_texture_alpha = texalpha,
selection_box = selectboxes_top,
node_box = {
@ -243,7 +218,6 @@ for i in ipairs(sides) do
paramtype2 = "facedir",
groups = dgroups,
sounds = default.node_sound_wood_defaults(),
walkable = true,
use_texture_alpha = texalpha,
selection_box = selectboxes_bottom,
node_box = {
@ -256,9 +230,12 @@ for i in ipairs(sides) do
end
end,
on_place = function(itemstack, placer, pointed_thing)
local keys=placer:get_player_control()
homedecor.place_door(itemstack, placer, pointed_thing, doorname, keys["sneak"])
return itemstack
return homedecor.stack_wing(itemstack, placer, pointed_thing,
"homedecor:door_"..doorname.."_bottom_left", "homedecor:door_"..doorname.."_top_left",
"homedecor:door_"..doorname.."_bottom_right", "homedecor:door_"..doorname.."_top_right")
end,
on_construct = function(pos)
minetest.get_meta(pos):set_int("closed", 1)
end,
on_rightclick = function(pos, node, clicker)
homedecor.flip_door(pos, node, clicker, doorname, side)
@ -350,10 +327,8 @@ for i in ipairs(gates_list) do
"homedecor_gate_"..gate.."_front.png"
},
paramtype = "light",
is_ground_content = true,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
paramtype2 = "facedir",
selection_box = {
type = "fixed",
@ -410,78 +385,6 @@ minetest.register_alias("homedecor:fence_picket_gate_closed", "homedecor:g
minetest.register_alias("homedecor:fence_picket_gate_white_open", "homedecor:gate_picket_white_open")
minetest.register_alias("homedecor:fence_picket_gate_white_closed", "homedecor:gate_picket_white_closed")
----- helper functions
function homedecor.place_door(itemstack, placer, pointed_thing, name, forceright)
local pointed = pointed_thing.under
local pnode = minetest.get_node(pointed)
local pname = pnode.name
local rnodedef = minetest.registered_nodes[pname]
if rnodedef then
if rnodedef.on_rightclick then
rnodedef.on_rightclick(pointed_thing.under, pnode, placer, itemstack)
return
end
local pos1 = nil
local pos2 = nil
if rnodedef["buildable_to"] then
pos1 = pointed
pos2 = {x=pointed.x, y=pointed.y+1, z=pointed.z}
else
pos1 = pointed_thing.above
pos2 = {x=pointed_thing.above.x, y=pointed_thing.above.y+1, z=pointed_thing.above.z}
end
local node_bottom = minetest.get_node(pos1)
local node_top = minetest.get_node(pos2)
if minetest.is_protected(pos1, placer:get_player_name()) then
minetest.record_protection_violation(pos1,
placer:get_player_name())
return
end
if minetest.is_protected(pos2, placer:get_player_name()) then
minetest.record_protection_violation(pos2,
placer:get_player_name())
return
end
if not homedecor.get_nodedef_field(node_bottom.name, "buildable_to")
or not homedecor.get_nodedef_field(node_top.name, "buildable_to") then
minetest.chat_send_player( placer:get_player_name(), S('Not enough space above that spot to place a door!') )
else
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
local p_tests = {
{x=pos1.x-1, y=pos1.y, z=pos1.z},
{x=pos1.x, y=pos1.y, z=pos1.z+1},
{x=pos1.x+1, y=pos1.y, z=pos1.z},
{x=pos1.x, y=pos1.y, z=pos1.z-1},
}
print("fdir="..fdir)
local testnode = minetest.get_node(p_tests[fdir+1])
local side = "left"
if string.find(testnode.name, "homedecor:door_"..name.."_bottom_left") or forceright then
side = "right"
end
local def = { name = "homedecor:door_"..name.."_bottom_"..side, param2=fdir}
addDoorNode(pos1, def, true)
minetest.add_node(pos2, { name = "homedecor:door_"..name.."_top_"..side, param2=fdir})
if not homedecor.expect_infinite_stacks then
itemstack:take_item()
return itemstack
end
end
end
end
-- to open a door, you switch left for right and subtract from param2, or vice versa right for left
-- that is to say open "right" doors become left door nodes, and open left doors right door nodes.
-- also adjusting param2 so the node is at 90 degrees.
@ -507,12 +410,7 @@ function homedecor.flip_door(pos, node, player, name, side, isClosed)
nfdir=ofdir + 1
if nfdir > 3 then nfdir = 0 end
end
local sound;
if isClosed then
sound = 'close'
else
sound = 'open'
end
local sound = isClosed and 'close' or 'open'
minetest.sound_play("homedecor_door_"..sound, {
pos=pos,
max_hear_distance = 5,
@ -694,7 +592,7 @@ minetest.register_node("homedecor:tatami_mat", {
}
})
minetest.register_node("homedecor:jpn_door_bottom", {
homedecor.register("jpn_door_bottom", {
description = "Japanese-style door",
inventory_image = "homedecor_jpn_door_inv.png",
tiles = {
@ -704,9 +602,6 @@ minetest.register_node("homedecor:jpn_door_bottom", {
"homedecor_japanese_wall_edges.png",
"homedecor_japanese_door_bottom.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = { snappy = 3 },
node_box = {
type = "fixed",
@ -726,27 +621,7 @@ minetest.register_node("homedecor:jpn_door_bottom", {
type = "fixed",
fixed = {-0.5, -0.5, 0, 0.5, 1.5, 0.0625},
},
on_place = function(itemstack, placer, pointed_thing)
local pointed = pointed_thing.under
local pnode = minetest.get_node(pointed)
local pname = pnode.name
local rnodedef = minetest.registered_nodes[pname]
if rnodedef.on_rightclick then
rnodedef.on_rightclick(pointed, pnode, placer)
return
end
return homedecor.stack_vertically(itemstack, placer, pointed_thing,
"homedecor:jpn_door_bottom", "homedecor:jpn_door_top")
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local pos2 = { x = pos.x, y=pos.y + 1, z = pos.z }
if minetest.get_node(pos2).name == "homedecor:jpn_door_top" then
minetest.remove_node(pos2)
end
end,
expand = { top = "homedecor:jpn_door_top" },
on_rightclick = function(pos, node, clicker)
fdir = minetest.get_node(pos).param2
minetest.set_node(pos, {name = "homedecor:jpn_door_bottom_open", param2 = fdir})
@ -780,10 +655,7 @@ minetest.register_node("homedecor:jpn_door_top", {
{0.1565, -0.5, 0, 0.2185, 0.5, 0.0625}, -- NodeBox9
}
},
selection_box = {
type = "fixed",
fixed = { 0, 0, 0, 0, 0, 0 },
},
selection_box = homedecor.nodebox.null,
})
minetest.register_node("homedecor:jpn_door_bottom_open", {
@ -856,10 +728,7 @@ minetest.register_node("homedecor:jpn_door_top_open", {
{-0.84375, -0.5, -0.0625, -0.7815, 0.5, 0}, -- NodeBox9
}
},
selection_box = {
type = "fixed",
fixed = { 0, 0, 0, 0, 0, 0 },
},
selection_box = homedecor.nodebox.null,
})

View File

@ -2,7 +2,7 @@
local S = homedecor.gettext
minetest.register_node('homedecor:speaker', {
homedecor.register("speaker", {
description = S("Large Stereo Speaker"),
tiles = { 'homedecor_speaker_top.png',
'homedecor_speaker_bottom.png',
@ -10,17 +10,12 @@ minetest.register_node('homedecor:speaker', {
'homedecor_speaker_left.png',
'homedecor_speaker_back.png',
'homedecor_speaker_front.png'},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
groups = { snappy = 3 },
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node('homedecor:speaker_small', {
homedecor.register("speaker_small", {
description = S("Small Surround Speaker"),
drawtype = "nodebox",
tiles = {
'homedecor_speaker_top.png',
'homedecor_speaker_bottom.png',
@ -37,16 +32,11 @@ minetest.register_node('homedecor:speaker_small', {
type = "fixed",
fixed = { -0.2, -0.5, 0, 0.2, 0, 0.4 }
},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
groups = { snappy = 3 },
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node('homedecor:stereo', {
homedecor.register("stereo", {
description = S("Stereo Receiver"),
tiles = { 'homedecor_stereo_top.png',
'homedecor_stereo_bottom.png',
@ -54,22 +44,16 @@ minetest.register_node('homedecor:stereo', {
'homedecor_stereo_left.png',
'homedecor_stereo_back.png',
'homedecor_stereo_front.png'},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
groups = { snappy = 3 },
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node('homedecor:projection_screen', {
homedecor.register("projection_screen", {
description = S("Projection Screen Material"),
drawtype = 'signlike',
tiles = { 'homedecor_projection_screen.png' },
wield_image = 'homedecor_projection_screen_inv.png',
inventory_image = 'homedecor_projection_screen_inv.png',
sunlight_propagates = false,
paramtype = 'light',
walkable = false,
groups = { snappy = 3 },
sounds = default.node_sound_leaves_defaults(),
@ -80,7 +64,7 @@ minetest.register_node('homedecor:projection_screen', {
},
})
minetest.register_node('homedecor:television', {
homedecor.register("television", {
description = S("Small CRT Television"),
tiles = { 'homedecor_television_top.png',
'homedecor_television_bottom.png',
@ -96,18 +80,13 @@ minetest.register_node('homedecor:television', {
}
}
},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
light_source = LIGHT_MAX - 1,
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("homedecor:dvd_vcr", {
homedecor.register("dvd_vcr", {
description = S("DVD and VCR"),
drawtype = "nodebox",
tiles = {
"homedecor_dvdvcr_top.png",
"homedecor_dvdvcr_bottom.png",
@ -117,8 +96,6 @@ minetest.register_node("homedecor:dvd_vcr", {
"homedecor_dvdvcr_front.png",
},
inventory_image = "homedecor_dvdvcr_inv.png",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
@ -130,7 +107,7 @@ minetest.register_node("homedecor:dvd_vcr", {
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node("homedecor:telephone", {
homedecor.register("telephone", {
tiles = {
"homedecor_telephone_sides.png^[transformR180",
"homedecor_telephone_sides.png",
@ -141,9 +118,6 @@ minetest.register_node("homedecor:telephone", {
},
inventory_image = "homedecor_telephone_inv.png",
description = "Telephone",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = {
type = "fixed",

View File

@ -16,41 +16,30 @@ end
local S = homedecor.gettext
minetest.register_node("homedecor:fence_brass", {
homedecor.register("fence_brass", {
description = S("Brass Fence/railing"),
drawtype = "fencelike",
tiles = {"homedecor_tile_brass.png"},
inventory_image = "homedecor_fence_brass.png",
paramtype = "light",
selection_box = {
type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
},
selection_box = homedecor.nodebox.bar_y(1/7),
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
minetest.register_node("homedecor:fence_wrought_iron", {
homedecor.register("fence_wrought_iron", {
description = S("Wrought Iron Fence/railing"),
drawtype = "fencelike",
tiles = {"homedecor_tile_wrought_iron.png"},
inventory_image = "homedecor_fence_wrought_iron.png",
paramtype = "light",
selection_box = {
type = "fixed",
fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7},
},
selection_box = homedecor.nodebox.bar_y(1/7),
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
})
-- brass/wrought iron with signs:
minetest.register_node("homedecor:fence_brass_with_sign", {
homedecor.register("fence_brass_with_sign", {
description = S("Brass Fence/railing with sign"),
drawtype = "nodebox",
tiles = {
"homedecor_sign_brass_post_top.png",
"homedecor_sign_brass_post_bottom.png",
@ -60,12 +49,9 @@ minetest.register_node("homedecor:fence_brass_with_sign", {
"homedecor_sign_brass_post_front.png",
},
wield_image = "homedecor_sign_brass_post.png",
paramtype = "light",
paramtype2 = "facedir",
node_box = sign_post_model,
groups = {snappy=3,not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
walkable = true,
sunlight_propagates = true,
drop = {
max_items = 2,
@ -76,9 +62,8 @@ minetest.register_node("homedecor:fence_brass_with_sign", {
},
})
minetest.register_node("homedecor:fence_wrought_iron_with_sign", {
homedecor.register("fence_wrought_iron_with_sign", {
description = S("Wrought Iron Fence/railing with sign"),
drawtype = "nodebox",
tiles = {
"homedecor_sign_wrought_iron_post_top.png",
"homedecor_sign_wrought_iron_post_bottom.png",
@ -88,12 +73,9 @@ minetest.register_node("homedecor:fence_wrought_iron_with_sign", {
"homedecor_sign_wrought_iron_post_front.png",
},
wield_image = "homedecor_sign_wrought_iron_post.png",
paramtype = "light",
paramtype2 = "facedir",
node_box = sign_post_model,
groups = {snappy=3,not_in_creative_inventory=1},
sounds = default.node_sound_wood_defaults(),
walkable = true,
sunlight_propagates = true,
drop = {
max_items = 2,
@ -106,8 +88,7 @@ minetest.register_node("homedecor:fence_wrought_iron_with_sign", {
-- other types of fences
minetest.register_node("homedecor:fence_picket", {
drawtype = "nodebox",
homedecor.register("fence_picket", {
description = S("Unpainted Picket Fence"),
tiles = {
"homedecor_blanktile.png",
@ -117,12 +98,8 @@ minetest.register_node("homedecor:fence_picket", {
"homedecor_fence_picket_backside.png",
"homedecor_fence_picket.png"
},
paramtype = "light",
is_ground_content = true,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.4, 0.5, 0.5, 0.5 }
@ -133,8 +110,7 @@ minetest.register_node("homedecor:fence_picket", {
},
})
minetest.register_node("homedecor:fence_picket_corner", {
drawtype = "nodebox",
homedecor.register("fence_picket_corner", {
description = S("Unpainted Picket Fence Corner"),
tiles = {
"homedecor_blanktile.png",
@ -144,12 +120,8 @@ minetest.register_node("homedecor:fence_picket_corner", {
"homedecor_fence_picket_backside.png",
"homedecor_fence_picket.png",
},
paramtype = "light",
is_ground_content = true,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = {
@ -166,8 +138,7 @@ minetest.register_node("homedecor:fence_picket_corner", {
},
})
minetest.register_node("homedecor:fence_picket_white", {
drawtype = "nodebox",
homedecor.register("fence_picket_white", {
description = S("White Picket Fence"),
tiles = {
"homedecor_blanktile.png",
@ -177,12 +148,8 @@ minetest.register_node("homedecor:fence_picket_white", {
"homedecor_fence_picket_white_backside.png",
"homedecor_fence_picket_white.png"
},
paramtype = "light",
is_ground_content = true,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.4, 0.5, 0.5, 0.5 }
@ -193,8 +160,7 @@ minetest.register_node("homedecor:fence_picket_white", {
},
})
minetest.register_node("homedecor:fence_picket_corner_white", {
drawtype = "nodebox",
homedecor.register("fence_picket_corner_white", {
description = S("White Picket Fence Corner"),
tiles = {
"homedecor_blanktile.png",
@ -204,12 +170,8 @@ minetest.register_node("homedecor:fence_picket_corner_white", {
"homedecor_fence_picket_white_backside.png",
"homedecor_fence_picket_white.png",
},
paramtype = "light",
is_ground_content = true,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = {
@ -226,8 +188,7 @@ minetest.register_node("homedecor:fence_picket_corner_white", {
},
})
minetest.register_node("homedecor:fence_privacy", {
drawtype = "nodebox",
homedecor.register("fence_privacy", {
description = S("Wooden Privacy Fence"),
tiles = {
"homedecor_fence_privacy_tb.png",
@ -237,12 +198,8 @@ minetest.register_node("homedecor:fence_privacy", {
"homedecor_fence_privacy_backside.png",
"homedecor_fence_privacy_front.png"
},
paramtype = "light",
is_ground_content = true,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 5/16, 0.5, 0.5, 8/16 }
@ -258,8 +215,7 @@ minetest.register_node("homedecor:fence_privacy", {
},
})
minetest.register_node("homedecor:fence_privacy_corner", {
drawtype = "nodebox",
homedecor.register("fence_privacy_corner", {
description = S("Wooden Privacy Fence Corner"),
tiles = {
"homedecor_fence_privacy_corner_top.png",
@ -269,12 +225,8 @@ minetest.register_node("homedecor:fence_privacy_corner", {
"homedecor_fence_privacy_backside.png",
"homedecor_fence_privacy_corner_front.png"
},
paramtype = "light",
is_ground_content = true,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = {
@ -298,16 +250,11 @@ minetest.register_node("homedecor:fence_privacy_corner", {
},
})
minetest.register_node("homedecor:fence_barbed_wire", {
drawtype = "nodebox",
homedecor.register("fence_barbed_wire", {
description = S("Barbed Wire Fence"),
tiles = {"homedecor_fence_barbed_wire.png"},
paramtype = "light",
is_ground_content = true,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.375, 0.5, 0.5, 0.5 }
@ -322,18 +269,13 @@ minetest.register_node("homedecor:fence_barbed_wire", {
},
})
minetest.register_node("homedecor:fence_barbed_wire_corner", {
drawtype = "nodebox",
homedecor.register("fence_barbed_wire_corner", {
description = S("Barbed Wire Fence Corner"),
tiles = {
"homedecor_fence_barbed_wire.png"
},
paramtype = "light",
is_ground_content = true,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = {
@ -354,8 +296,7 @@ minetest.register_node("homedecor:fence_barbed_wire_corner", {
},
})
minetest.register_node("homedecor:fence_chainlink", {
drawtype = "nodebox",
homedecor.register("fence_chainlink", {
description = S("Chainlink Fence"),
tiles = {
"homedecor_fence_chainlink_tb.png",
@ -365,12 +306,8 @@ minetest.register_node("homedecor:fence_chainlink", {
"homedecor_fence_chainlink_fb.png",
"homedecor_fence_chainlink_fb.png",
},
paramtype = "light",
is_ground_content = true,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.375, 0.5, 0.5, 0.5 }
@ -387,8 +324,7 @@ minetest.register_node("homedecor:fence_chainlink", {
},
})
minetest.register_node("homedecor:fence_chainlink_corner", {
drawtype = "nodebox",
homedecor.register("fence_chainlink_corner", {
description = S("Chainlink Fence Corner"),
tiles = {
"homedecor_fence_chainlink_corner_top.png",
@ -398,12 +334,8 @@ minetest.register_node("homedecor:fence_chainlink_corner", {
"homedecor_fence_chainlink_corner_front.png",
"homedecor_fence_chainlink_corner_front.png",
},
paramtype = "light",
is_ground_content = true,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = {
@ -427,8 +359,7 @@ minetest.register_node("homedecor:fence_chainlink_corner", {
},
})
minetest.register_node("homedecor:fence_wrought_iron_2", {
drawtype = "nodebox",
homedecor.register("fence_wrought_iron_2", {
description = S("Wrought Iron fence (type 2)"),
tiles = {
"homedecor_fence_wrought_iron_2_tb.png",
@ -438,12 +369,8 @@ minetest.register_node("homedecor:fence_wrought_iron_2", {
"homedecor_fence_wrought_iron_2_fb.png",
"homedecor_fence_wrought_iron_2_fb.png"
},
paramtype = "light",
is_ground_content = true,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.42, 0.5, 0.5, 0.5 }
@ -462,8 +389,7 @@ minetest.register_node("homedecor:fence_wrought_iron_2", {
},
})
minetest.register_node("homedecor:fence_wrought_iron_2_corner", {
drawtype = "nodebox",
homedecor.register("fence_wrought_iron_2_corner", {
description = S("Wrought Iron fence (type 2) Corner"),
tiles = {
"homedecor_fence_corner_wrought_iron_2_tb.png",
@ -473,12 +399,8 @@ minetest.register_node("homedecor:fence_wrought_iron_2_corner", {
"homedecor_fence_corner_wrought_iron_2_fb.png^[transformFX",
"homedecor_fence_corner_wrought_iron_2_fb.png"
},
paramtype = "light",
is_ground_content = true,
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
walkable = true,
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = {

View File

@ -13,12 +13,9 @@ for _, i in ipairs(table_colors) do
desc = S("Table")
end
minetest.register_node("homedecor:table"..color, {
homedecor.register("table"..color, {
description = desc,
tiles = { "forniture_wood"..color..".png" },
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
@ -65,12 +62,9 @@ for i in ipairs(chaircolors) do
chairtiles = { "forniture_wood.png" }
end
minetest.register_node("homedecor:chair"..color, {
homedecor.register("chair"..color, {
description = S("Kitchen chair (%s)"):format(name),
tiles = chairtiles,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
@ -90,13 +84,10 @@ for i in ipairs(chaircolors) do
})
if color ~= "" then
minetest.register_node("homedecor:armchair"..color, {
homedecor.register("armchair"..color, {
description = S("Armchair (%s)"):format(name),
tiles = { "forniture_armchair_top"..color..".png" },
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
@ -137,11 +128,11 @@ minetest.register_node(":homedecor:openframe_bookshelf", {
drawtype = "mesh",
mesh = "homedecor_openframe_bookshelf.obj",
tiles = { "homedecor_openframe_bookshelf.png" },
paramtype = "light",
paramtype2 = "facedir",
is_ground_content = false,
groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3},
sounds = default.node_sound_wood_defaults(),
paramtype = "light",
paramtype2 = "facedir",
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }
@ -198,7 +189,7 @@ end
for _, color in ipairs(bedcolors) do
minetest.register_node("homedecor:bed_"..color.."_head", {
homedecor.register("bed_"..color.."_head", {
tiles = {
"homedecor_bed_"..color.."_top1.png",
"homedecor_bed_bottom1.png",
@ -207,9 +198,6 @@ for _, color in ipairs(bedcolors) do
"homedecor_bed_head1.png",
"homedecor_bed_"..color.."_head2.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, not_in_creative_inventory=1},
node_box = {
type = "fixed",
@ -224,13 +212,10 @@ for _, color in ipairs(bedcolors) do
{-0.3125, -0.125, 0.0625, 0.3125, 0.0625, 0.4375}, -- NodeBox8
}
},
selection_box = {
type = "fixed",
fixed = { 0, 0, 0, 0, 0, 0 }
}
selection_box = homedecor.nodebox.null
})
minetest.register_node("homedecor:bed_"..color.."_foot", {
homedecor.register("bed_"..color.."_foot", {
tiles = {
"homedecor_bed_"..color.."_top2.png",
"homedecor_bed_bottom2.png",
@ -241,9 +226,6 @@ for _, color in ipairs(bedcolors) do
},
inventory_image = "homedecor_bed_"..color.."_inv.png",
description = S("Bed (%s)"):format(color),
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = {
type = "fixed",
@ -262,24 +244,13 @@ for _, color in ipairs(bedcolors) do
on_construct = function(pos)
bed_extension(pos, color)
end,
on_place = function(itemstack, placer, pointed_thing)
return homedecor.stack_sideways(itemstack, placer, pointed_thing,
"homedecor:bed_"..color.."_foot", "homedecor:bed_"..color.."_head", false)
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local fdir = oldnode.param2
if not fdir or fdir > 3 then return end
local pos2 = { x = pos.x + homedecor.fdir_to_fwd[fdir+1][1], y=pos.y, z = pos.z + homedecor.fdir_to_fwd[fdir+1][2] }
if minetest.get_node(pos2).name == "homedecor:bed_"..color.."_head" then
minetest.remove_node(pos2)
end
expand = { forward = "homedecor:bed_"..color.."_head" },
after_unexpand = function(pos)
unextend_bed(pos, color)
end
end,
})
minetest.register_node("homedecor:bed_"..color.."_footext", {
homedecor.register("bed_"..color.."_footext", {
tiles = {
"homedecor_bed_"..color.."_top2.png",
"homedecor_bed_bottom2.png",
@ -288,9 +259,6 @@ for _, color in ipairs(bedcolors) do
"homedecor_bed_foot2ext.png",
"homedecor_bed_"..color.."_foot1ext.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, not_in_creative_inventory=1},
node_box = {
type = "fixed",
@ -306,13 +274,8 @@ for _, color in ipairs(bedcolors) do
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 1.5 }
},
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local fdir = oldnode.param2
if not fdir or fdir > 3 then return end
local pos2 = { x = pos.x + homedecor.fdir_to_fwd[fdir+1][1], y=pos.y, z = pos.z + homedecor.fdir_to_fwd[fdir+1][2] }
if minetest.get_node(pos2).name == "homedecor:bed_"..color.."_head" then
minetest.remove_node(pos2)
end
expand = { forward = "homedecor:bed_"..color.."_head" },
after_unexpand = function(pos)
unextend_bed(pos, color)
end,
drop = "homedecor:bed_"..color.."_foot"
@ -320,7 +283,7 @@ for _, color in ipairs(bedcolors) do
end
minetest.register_node("homedecor:wardrobe_top", {
homedecor.register("wardrobe_top", {
tiles = {
"forniture_wood.png",
"forniture_wood.png",
@ -329,9 +292,6 @@ minetest.register_node("homedecor:wardrobe_top", {
"forniture_wood.png^[transformR90",
"homedecor_wardrobe_frontt.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3, not_in_creative_inventory=1},
node_box = {
type = "fixed",
@ -341,13 +301,10 @@ minetest.register_node("homedecor:wardrobe_top", {
{-0.4375, -0.4375, -0.5, -0.0625, 0.4375, -0.4375}, -- NodeBox3
}
},
selection_box = {
type = "fixed",
fixed = { 0, 0, 0, 0, 0, 0 }
},
selection_box = homedecor.nodebox.null,
})
minetest.register_node("homedecor:wardrobe_bottom", {
homedecor.register("wardrobe_bottom", {
tiles = {
"forniture_wood.png",
"forniture_wood.png^[transformR180",
@ -358,9 +315,6 @@ minetest.register_node("homedecor:wardrobe_bottom", {
},
inventory_image = "homedecor_wardrobe_inv.png",
description = "Wardrobe",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = {
type = "fixed",
@ -375,52 +329,14 @@ minetest.register_node("homedecor:wardrobe_bottom", {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 1.5, 0.5 }
},
on_place = function(itemstack, placer, pointed_thing)
return homedecor.stack_vertically(itemstack, placer, pointed_thing,
"homedecor:wardrobe_bottom", "homedecor:wardrobe_top")
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local pos2 = { x = pos.x, y=pos.y + 1, z = pos.z }
if minetest.get_node(pos2).name == "homedecor:wardrobe_top" then
minetest.remove_node(pos2)
end
end,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",
"size[8,8]"..
"list[current_name;main;0,0;8,3;]"..
"list[current_player;main;0,4;8,4;]")
meta:set_string("infotext", S("Wardrobe cabinet"))
local inv = meta:get_inventory()
inv:set_size("main", 24)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", S("%s moves stuff in wardrobe at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", S("%s moves stuff to wardrobe at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", S("%s takes stuff from wardrobe at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
expand = { top="homedecor:wardrobe_top" },
infotext = S("Wardrobe cabinet"),
inventory = {
size=24,
},
})
minetest.register_node("homedecor:simple_bench", {
homedecor.register("simple_bench", {
tiles = {
"homedecor_generic_wood.png",
"homedecor_generic_wood.png",
@ -430,9 +346,6 @@ minetest.register_node("homedecor:simple_bench", {
"homedecor_bench_large_2_left_back.png^[transformFX"
},
description = "Simple Bench",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = {
type = "fixed",
@ -444,8 +357,7 @@ minetest.register_node("homedecor:simple_bench", {
},
})
minetest.register_node("homedecor:bench_large_1_left", {
homedecor.register("bench_large_1_left", {
description = "Garden Bench (style 1)",
tiles = {
"homedecor_bench_large_1_left_top.png",
@ -456,9 +368,6 @@ minetest.register_node("homedecor:bench_large_1_left", {
"homedecor_bench_large_1_left_front.png"
},
inventory_image = "homedecor_bench_large_1_inv.png",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = {
type = "fixed",
@ -476,21 +385,10 @@ minetest.register_node("homedecor:bench_large_1_left", {
type = "fixed",
fixed = { -0.5, -0.5, -0.09375, 1.5, 0.5, 0.5 }
},
on_place = function(itemstack, placer, pointed_thing)
return homedecor.stack_sideways(itemstack, placer, pointed_thing,
"homedecor:bench_large_1_left", "homedecor:bench_large_1_right", true)
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local fdir = oldnode.param2
if not fdir or fdir > 3 then return end
local pos2 = { x = pos.x + homedecor.fdir_to_right[fdir+1][1], y=pos.y, z = pos.z + homedecor.fdir_to_right[fdir+1][2] }
if minetest.get_node(pos2).name == "homedecor:bench_large_1_right" then
minetest.remove_node(pos2)
end
end
expand = { right="homedecor:bench_large_1_right" },
})
minetest.register_node("homedecor:bench_large_1_right", {
homedecor.register("bench_large_1_right", {
tiles = {
"homedecor_bench_large_1_left_top.png^[transformFX",
"homedecor_bench_large_1_left_bottom.png^[transformFX",
@ -499,9 +397,6 @@ minetest.register_node("homedecor:bench_large_1_right", {
"homedecor_bench_large_1_left_back.png^[transformFX",
"homedecor_bench_large_1_left_front.png^[transformFX"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = {
type = "fixed",
@ -515,14 +410,11 @@ minetest.register_node("homedecor:bench_large_1_right", {
{0.25, -0.5, -0.0625, 0.3125, -0.25, 0}, -- NodeBox7
}
},
selection_box = {
type = "fixed",
fixed = { 0, 0, 0, 0, 0, 0 }
},
selection_box = homedecor.nodebox.null,
})
minetest.register_node("homedecor:bench_large_2_left", {
homedecor.register("bench_large_2_left", {
description = "Garden Bench (style 2)",
tiles = {
"homedecor_generic_wood.png",
@ -533,9 +425,6 @@ minetest.register_node("homedecor:bench_large_2_left", {
"homedecor_bench_large_2_left_back.png^[transformFX"
},
inventory_image = "homedecor_bench_large_2_inv.png",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = {
type = "fixed",
@ -562,21 +451,10 @@ minetest.register_node("homedecor:bench_large_2_left", {
type = "fixed",
fixed = { -0.5, -0.5, -0.15625, 1.5, 0.5, 0.5 }
},
on_place = function(itemstack, placer, pointed_thing)
return homedecor.stack_sideways(itemstack, placer, pointed_thing,
"homedecor:bench_large_2_left", "homedecor:bench_large_2_right", true)
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local fdir = oldnode.param2
if not fdir or fdir > 3 then return end
local pos2 = { x = pos.x + homedecor.fdir_to_right[fdir+1][1], y=pos.y, z = pos.z + homedecor.fdir_to_right[fdir+1][2] }
if minetest.get_node(pos2).name == "homedecor:bench_large_2_right" then
minetest.remove_node(pos2)
end
end
expand = { right="homedecor:bench_large_2_right" },
})
minetest.register_node("homedecor:bench_large_2_right", {
homedecor.register("bench_large_2_right", {
tiles = {
"homedecor_generic_wood.png",
"homedecor_generic_wood.png",
@ -585,9 +463,6 @@ minetest.register_node("homedecor:bench_large_2_right", {
"homedecor_bench_large_2_right_back.png",
"homedecor_bench_large_2_right_back.png^[transformFX"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
node_box = {
type = "fixed",
@ -610,13 +485,10 @@ minetest.register_node("homedecor:bench_large_2_right", {
{-0.5, -0.25, -0.0290173, 0.5, -0.125, 0.0125346}, -- NodeBox16
}
},
selection_box = {
type = "fixed",
fixed = { 0, 0, 0, 0, 0, 0 }
},
selection_box = homedecor.nodebox.null,
})
minetest.register_node("homedecor:deckchair_head", {
homedecor.register("deckchair_head", {
tiles = {
"homedecor_deckchair_top_c1.png",
"homedecor_deckchair_sides.png",
@ -625,9 +497,6 @@ minetest.register_node("homedecor:deckchair_head", {
"homedecor_deckchair_sides.png",
"homedecor_deckchair_front.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = { snappy = 3, not_in_creative_inventory = 1 },
node_box = {
type = "fixed",
@ -648,13 +517,10 @@ minetest.register_node("homedecor:deckchair_head", {
{-0.375, -0.5, 0, -0.3125, -0.25, 0.0625}, -- NodeBox14
}
},
selection_box = {
type = "fixed",
fixed = { 0, 0, 0, 0, 0, 0 }
}
selection_box = homedecor.nodebox.null
})
minetest.register_node("homedecor:deckchair_foot", {
homedecor.register("deckchair_foot", {
tiles = {
"homedecor_deckchair_top_c2.png",
"homedecor_deckchair_sides.png",
@ -664,9 +530,6 @@ minetest.register_node("homedecor:deckchair_foot", {
},
description = "Deck chair",
inventory_image = "homedecor_deckchair_inv.png",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = { snappy = 3 },
node_box = {
type = "fixed",
@ -684,28 +547,14 @@ minetest.register_node("homedecor:deckchair_foot", {
type = "fixed",
fixed = { -0.45, -0.5, -0.5, 0.45, 0.35, 1.5 }
},
on_place = function(itemstack, placer, pointed_thing)
return homedecor.stack_sideways(itemstack, placer, pointed_thing,
"homedecor:deckchair_foot", "homedecor:deckchair_head", false)
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local fdir = oldnode.param2
if not fdir or fdir > 3 then return end
local pos2 = { x = pos.x + homedecor.fdir_to_fwd[fdir+1][1], y=pos.y, z = pos.z + homedecor.fdir_to_fwd[fdir+1][2] }
if minetest.get_node(pos2).name == "homedecor:deckchair_head" then
minetest.remove_node(pos2)
end
end
expand = { forward="homedecor:deckchair_head" },
})
minetest.register_node("homedecor:wall_shelf", {
homedecor.register("wall_shelf", {
description = "Wall Shelf",
tiles = {
"homedecor_wood_table_large_edges.png",
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = { snappy = 3 },
node_box = {
type = "fixed",
@ -716,7 +565,7 @@ minetest.register_node("homedecor:wall_shelf", {
}
})
minetest.register_node("homedecor:grandfather_clock_bottom", {
homedecor.register("grandfather_clock_bottom", {
description = "Grandfather Clock",
tiles = {
"homedecor_grandfather_clock_sides.png",
@ -727,9 +576,6 @@ minetest.register_node("homedecor:grandfather_clock_bottom", {
"homedecor_grandfather_clock_bottom.png"
},
inventory_image = "homedecor_grandfather_clock_inv.png",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = { snappy = 3 },
node_box = {
type = "fixed",
@ -744,19 +590,10 @@ minetest.register_node("homedecor:grandfather_clock_bottom", {
type = "fixed",
fixed = { -0.4, -0.5, -0.4, 0.4, 1.5, 0.4 }
},
on_place = function(itemstack, placer, pointed_thing)
return homedecor.stack_vertically(itemstack, placer, pointed_thing,
"homedecor:grandfather_clock_bottom", "homedecor:grandfather_clock_top")
end,
after_dig_node = function(pos, oldnode, oldmetadata, digger)
local pos2 = { x = pos.x, y=pos.y + 1, z = pos.z }
if minetest.get_node(pos2).name == "homedecor:grandfather_clock_top" then
minetest.remove_node(pos2)
end
end,
expand = { top="homedecor:grandfather_clock_top" },
})
minetest.register_node("homedecor:grandfather_clock_top", {
homedecor.register("grandfather_clock_top", {
tiles = {
"homedecor_grandfather_clock_sides.png",
"homedecor_grandfather_clock_sides.png",
@ -765,9 +602,6 @@ minetest.register_node("homedecor:grandfather_clock_top", {
"homedecor_grandfather_clock_sides.png",
"homedecor_grandfather_clock_top.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = { snappy = 3, not_in_creative_inventory=1 },
node_box = {
type = "fixed",
@ -778,10 +612,7 @@ minetest.register_node("homedecor:grandfather_clock_top", {
{-0.3125, -0.5, -0.3125, 0.3125, 0.5, 0.4}, -- NodeBox4
}
},
selection_box = {
type = "fixed",
fixed = { 0, 0, 0, 0, 0, 0 }
},
selection_box = homedecor.nodebox.null,
})
-- Aliases for 3dforniture mod.

View File

@ -1,203 +0,0 @@
local S = homedecor.gettext
minetest.register_node("homedecor:toilet", {
description = S("Toilet"),
tiles = { "forniture_marble.png" },
drawtype = "nodebox",
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{ -0.20, -0.50, -0.20, 0.20, -0.45, 0.50, },
{ -0.10, -0.45, -0.10, 0.10, 0.00, 0.50, },
{ -0.30, -0.20, -0.30, 0.30, 0.00, 0.35, },
{ -0.25, 0.00, -0.25, 0.25, 0.05, 0.25, },
{ -0.30, 0.00, 0.30, 0.30, 0.40, 0.50, },
{ -0.05, 0.40, 0.35, 0.05, 0.45, 0.45, },
},
},
groups = {cracky=3,},
sounds = default.node_sound_stone_defaults(),
on_punch = function (pos, node, puncher)
node.name = "homedecor:toilet_open"
minetest.set_node(pos, node)
end,
})
minetest.register_node("homedecor:toilet_open", {
tiles = {
"forniture_marble_top_toilet.png",
"forniture_marble.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{ -0.20, -0.50, -0.20, 0.20, -0.45, 0.50, },
{ -0.10, -0.45, -0.10, 0.10, -0.20, 0.50, },
{ -0.10, -0.20, 0.30, 0.10, 0.00, 0.50, },
{ -0.30, -0.20, 0.10, 0.30, 0.00, 0.35, },
{ -0.30, -0.20, -0.30, -0.10, -0.15, 0.10, },
{ -0.10, -0.20, -0.30, 0.10, -0.15, -0.10, },
{ 0.10, -0.20, -0.30, 0.30, -0.15, 0.10, },
{ -0.30, -0.15, -0.30, -0.20, 0.00, 0.10, },
{ -0.20, -0.15, -0.30, 0.20, 0.00, -0.20, },
{ 0.20, -0.15, -0.30, 0.30, 0.00, 0.10, },
{ -0.25, 0.00, 0.20, 0.25, 0.50, 0.25, },
{ -0.30, 0.00, 0.30, 0.30, 0.40, 0.50, },
},
},
drop = "homedecor:toilet",
groups = {cracky = 3,},
--sounds = {dig = "3dforniture_dig_toilet", gain=0.5},
sounds = default.node_sound_stone_defaults(),
on_punch = function (pos, node, puncher)
node.name = "homedecor:toilet"
minetest.set_node(pos, node)
minetest.sound_play("homedecor_toilet_flush", {
pos=pos,
max_hear_distance = 5,
gain = 1,
})
end,
})
--Sink
minetest.register_node("homedecor:sink", {
description = S("Sink"),
tiles = {
"forniture_marble_top_sink.png",
"forniture_marble.png"
},
inventory_image="3dforniture_inv_sink.png",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{ -0.15, 0.35, 0.20, 0.15, 0.40, 0.50, },
{ -0.25, 0.40, 0.40, 0.25, 0.45, 0.50, },
{ -0.25, 0.40, 0.15, -0.15, 0.45, 0.40, },
{ 0.15, 0.40, 0.15, 0.25, 0.45, 0.40, },
{ -0.15, 0.40, 0.15, 0.15, 0.45, 0.20, },
{ -0.30, 0.45, 0.40, 0.30, 0.50, 0.50, },
{ -0.30, 0.45, 0.10, -0.25, 0.50, 0.40, },
{ 0.25, 0.45, 0.10, 0.30, 0.50, 0.40, },
{ -0.25, 0.45, 0.10, 0.25, 0.50, 0.15, },
{-0.1, -0.5, 0.3, 0.1, 0.4, 0.5},
},
},
selection_box = {
type = "fixed",
fixed = {-0.3,-0.5,0.1, 0.3,0.5,0.5},
},
groups = {cracky=2,},
sounds = default.node_sound_stone_defaults(),
})
--Taps
minetest.register_node("homedecor:taps", {
description = S("Taps"),
tiles = { "forniture_metal.png" },
inventory_image="3dforniture_inv_taps.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{ -0.25, -0.450, 0.49, 0.25, -0.30, 0.50, },
{ -0.05, -0.400, 0.25, 0.05, -0.35, 0.50, },
{ -0.05, -0.425, 0.25, 0.05, -0.40, 0.30, },
{ -0.20, -0.400, 0.45, -0.15, -0.35, 0.50, },
{ -0.20, -0.450, 0.40, -0.15, -0.30, 0.45, },
{ -0.25, -0.400, 0.40, -0.10, -0.35, 0.45, },
{ 0.15, -0.400, 0.45, 0.20, -0.35, 0.50, },
{ 0.15, -0.450, 0.40, 0.20, -0.30, 0.45, },
{ 0.10, -0.400, 0.40, 0.25, -0.35, 0.45, },
},
},
selection_box = {
type = "fixed",
fixed = { -0.25, -0.45, 0.25, 0.25, -0.3, 0.5 },
},
groups = {cracky=2,},
sounds = default.node_sound_stone_defaults(),
})
--Shower Tray
minetest.register_node("homedecor:shower_tray", {
description = S("Shower Tray"),
tiles = {
"forniture_marble_base_ducha_top.png",
"forniture_marble.png"
},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
legacy_facedir_simple = true,
node_box = {
type = "fixed",
fixed = {
{ -0.50, -0.50, -0.50, 0.50, -0.45, 0.50, },
{ -0.50, -0.45, -0.50, 0.50, -0.40, -0.45, },
{ -0.50, -0.45, 0.45, 0.50, -0.40, 0.50, },
{ -0.50, -0.45, -0.45, -0.45, -0.40, 0.45, },
{ 0.45, -0.45, -0.45, 0.50, -0.40, 0.45, },
},
},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, -0.4, 0.5 },
},
groups = {cracky=2,},
sounds = default.node_sound_stone_defaults(),
})
--Shower Head
minetest.register_node("homedecor:shower_head", {
description = S("Shower Head"),
tiles = { "forniture_metal.png" },
inventory_image="3dforniture_inv_shower_head.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{ -0.10, -0.50, 0.10, 0.10, -0.40, 0.30, },
{ -0.05, -0.40, 0.15, 0.05, -0.30, 0.25, },
{ -0.05, -0.35, 0.25, 0.05, -0.30, 0.50, },
{ -0.10, -0.40, 0.49, 0.10, -0.25, 0.50, },
},
},
selection_box = {
type = "fixed",
fixed = { -0.1, -0.5, 0.1, 0.1, -0.25, 0.5 },
},
groups = {cracky=2,},
sounds = default.node_sound_stone_defaults(),
})
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")

View File

@ -1,13 +1,10 @@
local S = homedecor.gettext
minetest.register_node("homedecor:bars", {
homedecor.register("bars", {
description = S("Bars"),
tiles = { "forniture_black_metal.png" },
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
@ -26,13 +23,10 @@ minetest.register_node("homedecor:bars", {
})
--L Binding Bars
minetest.register_node("homedecor:L_binding_bars", {
homedecor.register("L_binding_bars", {
description = S("Binding Bars"),
tiles = { "forniture_black_metal.png" },
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
@ -48,14 +42,11 @@ minetest.register_node("homedecor:L_binding_bars", {
groups = {cracky=1,}
})
minetest.register_node("homedecor:chains", {
homedecor.register("chains", {
description = S("Chains"),
tiles = { "forniture_black_metal.png" },
inventory_image="3dforniture_inv_chains.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
@ -116,9 +107,8 @@ minetest.register_node("homedecor:chains", {
groups = {cracky=1},
})
minetest.register_node("homedecor:torch_wall", {
homedecor.register("torch_wall", {
description = S("Wall Torch"),
drawtype = "nodebox",
tiles = {
"forniture_torch_wall_s.png",
"forniture_torch_wall_i.png",
@ -133,8 +123,6 @@ minetest.register_node("homedecor:torch_wall", {
},
},
inventory_image="3dforniture_inv_torch_wall.png",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {

View File

@ -0,0 +1,115 @@
local S = homedecor.gettext
-- selects which node was pointed at based on it being known, and either clickable or buildable_to
local function select_node(pointed_thing)
local pos = pointed_thing.under
local def = minetest.registered_nodes[minetest.get_node(pos).name]
if not def or (not def.on_rightclick and not def.buildable_to) then
pos = pointed_thing.above
def = minetest.registered_nodes[minetest.get_node(pos).name]
end
return pos, def
end
-- abstract function checking if 2 given nodes can and may be build to a place
local function is_buildable_to(placer_name, pos, def, pos2)
local def = def or minetest.registered_nodes[minetest.get_node(pos).name]
local def2 = minetest.registered_nodes[minetest.get_node(pos2).name]
return def and def.buildable_to and def2 and def2.buildable_to
and not minetest.is_protected(pos, placer_name)
and not minetest.is_protected(pos2, placer_name)
end
-- place one or two nodes if and only if both can be placed
local function stack(itemstack, placer, fdir, pos, def, pos2, node1, node2)
local placer_name = placer:get_player_name() or ""
if is_buildable_to(placer_name, pos, def, pos2) then
local fdir = fdir or minetest.dir_to_facedir(placer:get_look_dir())
minetest.set_node(pos, { name = node1, param2 = fdir })
node2 = node2 or "air" -- this can be used to clear buildable_to nodes even though we are using a multinode mesh
minetest.set_node(pos2, { name = node2, param2 = (node2 ~= "air" and fdir) or nil })
-- temporary check if this is a locked node to set its infotext
local nodename = itemstack:get_name()
if string.find(nodename, "_locked") then
local meta = minetest.get_meta(pos)
meta:set_string("owner", placer_name)
meta:set_string("infotext", S("Locked %s (owned by %s)"):format(minetest.registered_nodes[nodename].infotext, placer_name))
end
if not homedecor.expect_infinite_stacks then
itemstack:take_item()
return itemstack
end
end
end
-- Stack one node above another
-- leave the last argument nil if it's one 2m high node
function homedecor.stack_vertically(itemstack, placer, pointed_thing, node1, node2)
local pos, def = select_node(pointed_thing)
if def.on_rightclick then
return def.on_rightclick(pointed_thing.under, minetest.get_node(pos), placer, itemstack)
end
local top_pos = { x=pos.x, y=pos.y+1, z=pos.z }
return stack(itemstack, placer, nil, pos, def, top_pos, node1, node2)
end
-- Stack one door node above another
-- like homedecor.stack_vertically but tests first if it was placed as a right wing, then uses node1_right and node2_right instead
local fdir_to_left = {
{ -1, 0 },
{ 0, 1 },
{ 1, 0 },
{ 0, -1 },
}
function homedecor.stack_wing(itemstack, placer, pointed_thing, node1, node2, node1_right, node2_right)
local pos, def = select_node(pointed_thing)
if def.on_rightclick then
return def.on_rightclick(pointed_thing.under, minetest.get_node(pos), placer, itemstack)
end
local forceright = placer:get_player_control()["sneak"]
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
local is_right_wing = node1 == minetest.get_node({ x = pos.x + fdir_to_left[fdir+1][1], y=pos.y, z = pos.z + fdir_to_left[fdir+1][2] }).name
if forceright or is_right_wing then
node1, node2 = node1_right, node2_right
end
local top_pos = { x=pos.x, y=pos.y+1, z=pos.z }
return stack(itemstack, placer, fdir, pos, def, top_pos, node1, node2)
end
-- Place one node right of or behind another
homedecor.fdir_to_right = {
{ 1, 0 },
{ 0, -1 },
{ -1, 0 },
{ 0, 1 },
}
homedecor.fdir_to_fwd = {
{ 0, 1 },
{ 1, 0 },
{ 0, -1 },
{ -1, 0 },
}
function homedecor.stack_sideways(itemstack, placer, pointed_thing, node1, node2, dir)
local pos, def = select_node(pointed_thing)
if def.on_rightclick then
return def.on_rightclick(pointed_thing.under, minetest.get_node(pos), placer, itemstack)
end
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
local fdir_transform = dir and homedecor.fdir_to_right or homedecor.fdir_to_fwd
local pos2 = { x = pos.x + fdir_transform[fdir+1][1], y=pos.y, z = pos.z + fdir_transform[fdir+1][2] }
return stack(itemstack, placer, fdir, pos, def, pos2, node1, node2)
end

View File

@ -345,45 +345,3 @@ function homedecor.register_furnace(name, furnacedef)
})
end
homedecor.register_furnace("homedecor:oven", {
description = S("Oven"),
tile_format = "homedecor_oven_%s%s.png",
output_slots = 4,
output_width = 2,
cook_speed = 1.25,
})
homedecor.register_furnace("homedecor:oven_steel", {
description = S("Oven (stainless steel)"),
tile_format = "homedecor_oven_steel_%s%s.png",
output_slots = 4,
output_width = 2,
cook_speed = 1.25,
})
homedecor.register_furnace("homedecor:microwave_oven", {
description = S("Microwave Oven"),
tiles = {
"homedecor_microwave_top.png", "homedecor_microwave_top.png^[transformR180",
"homedecor_microwave_top.png^[transformR270", "homedecor_microwave_top.png^[transformR90",
"homedecor_microwave_top.png^[transformR180", "homedecor_microwave_front.png"
},
tiles_active = {
"homedecor_microwave_top.png", "homedecor_microwave_top.png^[transformR180",
"homedecor_microwave_top.png^[transformR270", "homedecor_microwave_top.png^[transformR90",
"homedecor_microwave_top.png^[transformR180", "homedecor_microwave_front_active.png"
},
output_slots = 2,
output_width = 2,
cook_speed = 1.5,
extra_nodedef_fields = {
drawtype = "nodebox",
paramtype = "light",
--paramtype2 = "facedir", -- Not needed, set by register_furnace
node_box = {
type = "fixed",
fixed = { { -0.5, -0.5, -0.125, 0.5, 0.125, 0.5 } },
},
},
})

View File

@ -0,0 +1,161 @@
-- Locked Stuff for Home Decor mod, by Kaeza
--
-- The code is mostly copypasta from default:chest_locked, with a few
-- tidbits to ease creation of new items, should need arise.
local S = homedecor.gettext
--[[
| create_locked ( name, infotext )
|
| Description:
| This function takes a base node name such as "homedecor:refrigerator",
| copies the definition from the original item into a new table, modifies
| it a bit, and registers a new node with a "_locked" suffix such as
| "homedecor:refrigerator_locked". The new node behaves identically to
| the base node, except that moving items to/from the node's inventory
| is only allowed for the original placer. In addition, it register a new
| shapeless recipe for the node, using the base node plus a steel ingot.
|
| Arguments:
| name The base node name
| infotext The infotext description (in case the name is too long).
|
| Example Usage:
| create_locked("homedecor:refrigerator", "Locked Fridge")
| ^ This generates a new "Locked Refrigerator" node, whose infotext is
| "Locked Fridge (owned by <placer>)".
|
| Notes:
| If <infotext> is not specified (or is nil), the infotext will be the
| base node's description prefixed by "Locked ".
|
| The ABM for the locked oven is defined in oven.lua.
]]
local function create_locked ( name, infotext )
local def = { }
for k, v in pairs(minetest.registered_nodes[name]) do
def[k] = v
end
def.type = nil
def.name = nil
def.description = S("%s (Locked)"):format(def.description)
local after_place_node = def.after_place_node
def.after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos)
meta:set_string("owner", placer:get_player_name() or "")
meta:set_string("infotext", S("%s (owned by %s)"):format(infotext,meta:get_string("owner")))
if (after_place_node) then
return after_place_node(pos, placer)
end
end
local allow_metadata_inventory_move = def.allow_metadata_inventory_move;
def.allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
if (player:get_player_name() ~= meta:get_string("owner")) then
minetest.log("action", S("%s tried to access a %s belonging to %s at %s"):format(
player:get_player_name(),
infotext,
meta:get_string("owner"),
minetest.pos_to_string(pos)
))
return 0
end
if (allow_metadata_inventory_move) then
return allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player)
else
return count
end
end
local allow_metadata_inventory_put = def.allow_metadata_inventory_put;
def.allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if (player:get_player_name() ~= meta:get_string("owner")) then
minetest.log("action", S("%s tried to access a %s belonging to %s at %s"):format(
player:get_player_name(),
infotext,
meta:get_string("owner"),
minetest.pos_to_string(pos)
))
return 0
end
if (allow_metadata_inventory_put) then
return allow_metadata_inventory_put(pos, listname, index, stack, player)
else
return stack:get_count()
end
end
local allow_metadata_inventory_take = def.allow_metadata_inventory_take;
def.allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if (player:get_player_name() ~= meta:get_string("owner")) then
minetest.log("action", S("%s tried to access a %s belonging to %s at %s"):format(
player:get_player_name(),
infotext,
meta:get_string("owner"),
minetest.pos_to_string(pos)
))
return 0
end
if (allow_metadata_inventory_take) then
return allow_metadata_inventory_take(pos, listname, index, stack, player)
else
return stack:get_count()
end
end
minetest.register_node(name.."_locked", def)
minetest.register_craft({
output = name.."_locked",
type = "shapeless",
recipe = {
name,
"default:steel_ingot",
}
})
end
local items = {
{ "refrigerator_white_bottom",
"Refrigerator" },
{ "refrigerator_steel_bottom",
"Refrigerator (stainless steel)" },
{ "kitchen_cabinet",
"Cabinet" },
{ "kitchen_cabinet_steel",
"Cabinet (stainless steel top)" },
{ "kitchen_cabinet_granite",
"Cabinet (granite top)" },
{ "kitchen_cabinet_marble",
"Cabinet (marble top)" },
{ "kitchen_cabinet_half",
"Cabinet" },
{ "kitchen_cabinet_with_sink",
"Cabinet" },
{ "nightstand_oak_one_drawer",
"Nightstand" },
{ "nightstand_oak_two_drawers",
"Nightstand" },
{ "nightstand_mahogany_one_drawer",
"Nightstand" },
{ "nightstand_mahogany_two_drawers",
"Nightstand" },
{ "filing_cabinet",
"Filing cabinet" },
{ "oven",
"Oven" },
{ "oven_active",
"Oven (active)" },
{ "oven_steel",
"Oven (stainless steel)" },
{ "oven_steel_active",
"Oven (stainless steel, active)" },
{ "microwave_oven",
"Microwave Oven" },
{ "microwave_oven_active",
"Microwave Oven (active)" },
}
for _,item in ipairs(items) do
local name, info = item[1], item[2];
create_locked("homedecor:"..name, S("Locked "..info));
end

View File

@ -0,0 +1,39 @@
-- please keep any non-generic nodeboxe with its node definition
-- this file should not accumulate any left over nodeboxes
-- but is meant to host any abstractions or calculations based on nodeboxes
-- a box is defined as {x1, y1, z1, x2, y2, z2}
homedecor.box = {
slab_y = function(height, shift) return { -0.5, -0.5+(shift or 0), -0.5, 0.5, -0.5+height+(shift or 0), 0.5 } end,
slab_z = function(depth) return { -0.5, -0.5, -0.5+depth, 0.5, 0.5, 0.5 } end,
bar_y = function(radius) return {-radius, -0.5, -radius, radius, 0.5, radius} end,
cuboid = function(radius_x, radius_y, radius_z) return {-radius_x, -radius_y, -radius_z, radius_x, radius_y, radius_z} end,
}
homedecor.nodebox = {
-- { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 },
-- can be used in-place as:
-- { type="regular" },
regular = { type="regular" },
null = { type = "fixed", fixed = { 0, 0, 0, 0, 0, 0 } },
}
local mt = {}
mt.__index = function(table, key)
local ref = homedecor.box[key]
local ref_type = type(ref)
if ref_type == "function" then
return function(...)
return { type = "fixed", fixed = ref(...) }
end
elseif ref_type == "table" then
return { type = "fixed", fixed = ref }
elseif ref_type == "nil" then
error(key .. "could not be found among nodebox presets and functions")
end
error("unexpected datatype " .. tostring(type(ref)) .. " while looking for " .. key)
end
setmetatable(homedecor.nodebox, mt)

View File

@ -0,0 +1,155 @@
homedecor = homedecor or {}
local S = homedecor.gettext
local default_can_dig = function(pos,player)
local meta = minetest.get_meta(pos)
return meta:get_inventory():is_empty("main")
end
local default_inventory_size = 32
local default_inventory_formspecs = {
["4"]="size[8,6]"..
"list[context;main;2,0;4,1;]"..
"list[current_player;main;0,2;8,4;]",
["6"]="size[8,6]"..
"list[context;main;1,0;6,1;]"..
"list[current_player;main;0,2;8,4;]",
["8"]="size[8,6]"..
"list[context;main;0,0;8,1;]"..
"list[current_player;main;0,2;8,4;]",
["12"]="size[8,7]"..
"list[context;main;1,0;6,2;]"..
"list[current_player;main;0,3;8,4;]",
["16"]="size[8,7]"..
"list[context;main;0,0;8,2;]"..
"list[current_player;main;0,3;8,4;]",
["24"]="size[8,8]"..
"list[context;main;0,0;8,3;]"..
"list[current_player;main;0,4;8,4;]",
["32"]="size[8,9]".. default.gui_bg .. default.gui_bg_img .. default.gui_slots ..
"list[context;main;0,0.3;8,4;]"..
"list[current_player;main;0,4.85;8,1;]"..
"list[current_player;main;0,6.08;8,3;8]"..
default.get_hotbar_bg(0,4.85),
["50"]="size[10,10]"..
"list[context;main;0,0;10,5;]"..
"list[current_player;main;1,6;8,4;]",
}
local function get_formspec_by_size(size)
--TODO heuristic to use the "next best size"
local formspec = default_inventory_formspecs[tostring(size)]
return formspec or default_inventory_formspecs
end
--wrapper around minetest.register_node that sets sane defaults and interprets some specialized settings
function homedecor.register(name, def)
def.paramtype = def.paramtype or "light"
def.paramtype2 = def.paramtype2 or "facedir"
def.drawtype = def.drawtype
or (def.mesh and "mesh")
or (def.node_box and "nodebox")
local infotext = def.infotext
--def.infotext = nil -- currently used to set locked refrigerator infotexts
-- handle inventory setting
-- inventory = {
-- size = 16
-- formspec = …
-- }
local inventory = def.inventory
def.inventory = nil
if inventory then
def.on_construct = def.on_construct or function(pos)
local meta = minetest.get_meta(pos)
if infotext then
meta:set_string("infotext", infotext)
end
local size = inventory.size or default_inventory_size
meta:get_inventory():set_size("main", size)
meta:set_string("formspec", inventory.formspec or get_formspec_by_size(size))
end
def.can_dig = def.can_dig or default_can_dig
def.on_metadata_inventory_move = def.on_metadata_inventory_move or function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", S("%s moves stuff in %s at %s"):format(
player:get_player_name(), name, minetest.pos_to_string(pos)
))
end
def.on_metadata_inventory_put = def.on_metadata_inventory_put or function(pos, listname, index, stack, player)
minetest.log("action", S("%s moves stuff to %s at %s"):format(
player:get_player_name(), name, minetest.pos_to_string(pos)
))
end
def.on_metadata_inventory_take = def.on_metadata_inventory_take or function(pos, listname, index, stack, player)
minetest.log("action", S("%s takes stuff from %s at %s"):format(
player:get_player_name(), name, minetest.pos_to_string(pos)
))
end
elseif infotext and not def.on_construct then
def.on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("infotext", infotext)
end
end
local expand = def.expand
def.expand = nil
local after_unexpand = def.after_unexpand
def.after_unexpand = nil
if expand then
def.on_place = def.on_place or function(itemstack, placer, pointed_thing)
if expand.top then
homedecor.stack_vertically(itemstack, placer, pointed_thing, itemstack:get_name(), expand.top)
end
if expand.right then
homedecor.stack_sideways(itemstack, placer, pointed_thing, itemstack:get_name(), expand.right, true)
end
if expand.forward then
homedecor.stack_sideways(itemstack, placer, pointed_thing, itemstack:get_name(), expand.forward, false)
end
end
def.after_dig_node = def.after_dig_node or function(pos, oldnode, oldmetadata, digger)
if expand.top and expand.forward ~= "air" then
local top_pos = { x=pos.x, y=pos.y+1, z=pos.z }
if minetest.get_node(top_pos).name == expand.top then
minetest.remove_node(top_pos)
end
end
local fdir = oldnode.param2
if not fdir or fdir > 3 then return end
if expand.right and expand.forward ~= "air" then
local right_pos = { x=pos.x+homedecor.fdir_to_right[fdir+1][1], y=pos.y, z=pos.z+homedecor.fdir_to_right[fdir+1][2] }
if minetest.get_node(right_pos).name == expand.right then
minetest.remove_node(right_pos)
end
end
if expand.forward and expand.forward ~= "air" then
local forward_pos = { x=pos.x+homedecor.fdir_to_fwd[fdir+1][1], y=pos.y, z=pos.z+homedecor.fdir_to_fwd[fdir+1][2] }
if minetest.get_node(forward_pos).name == expand.forward then
minetest.remove_node(forward_pos)
end
end
if after_unexpand then
after_unexpand(pos)
end
end
end
-- register the actual minetest node
minetest.register_node("homedecor:" .. name, def)
end

View File

@ -57,123 +57,6 @@ function homedecor.table_copy(t)
return nt
end
--
function homedecor.get_nodedef_field(nodename, fieldname)
if not minetest.registered_nodes[nodename] then
return nil
end
return minetest.registered_nodes[nodename][fieldname]
end
-- Place a two-node-tall single object (e.g. a floor lamp)
function homedecor.place_twonode_vertical(itemstack, placer, pointed_thing, node)
local pos = pointed_thing.under
local pnode = minetest.get_node(pointed_thing.under)
local rnodedef = minetest.registered_nodes[pnode.name]
if not rnodedef["buildable_to"] then
pos = pointed_thing.above
end
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos2 = { x = pos.x, y=pos.y + 1, z = pos.z }
local tnode = minetest.get_node(pos)
local tnode2 = minetest.get_node(pos2)
if homedecor.get_nodedef_field(tnode.name, "buildable_to")
and homedecor.get_nodedef_field(tnode2.name, "buildable_to")
and not minetest.is_protected(pos, placer:get_player_name())
and not minetest.is_protected(pos2, placer:get_player_name()) then
minetest.add_node(pos, { name = node, param2 = fdir })
if not homedecor.expect_infinite_stacks then
itemstack:take_item()
return itemstack
end
end
end
-- Stack one node above another
function homedecor.stack_vertically(itemstack, placer, pointed_thing, node1, node2)
local pos = pointed_thing.under
local pnode = minetest.get_node(pointed_thing.under)
local rnodedef = minetest.registered_nodes[pnode.name]
if not rnodedef["buildable_to"] then
pos = pointed_thing.above
end
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos2 = { x = pos.x, y=pos.y + 1, z = pos.z }
local tnode = minetest.get_node(pos)
local tnode2 = minetest.get_node(pos2)
if homedecor.get_nodedef_field(tnode.name, "buildable_to")
and homedecor.get_nodedef_field(tnode2.name, "buildable_to")
and not minetest.is_protected(pos, placer:get_player_name())
and not minetest.is_protected(pos2, placer:get_player_name()) then
minetest.add_node(pos, { name = node1, param2 = fdir })
minetest.add_node(pos2, { name = node2, param2 = fdir })
if not homedecor.expect_infinite_stacks then
itemstack:take_item()
return itemstack
end
end
end
-- Place one node right of or behind another
homedecor.fdir_to_right = {
{ 1, 0 },
{ 0, -1 },
{ -1, 0 },
{ 0, 1 },
}
homedecor.fdir_to_fwd = {
{ 0, 1 },
{ 1, 0 },
{ 0, -1 },
{ -1, 0 },
}
function homedecor.stack_sideways(itemstack, placer, pointed_thing, node1, node2, dir)
local pos = pointed_thing.under
local pnode = minetest.get_node(pointed_thing.under)
local rnodedef = minetest.registered_nodes[pnode.name]
if not rnodedef["buildable_to"] then
pos = pointed_thing.above
end
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
local pos2
if dir then
pos2 = { x = pos.x + homedecor.fdir_to_right[fdir+1][1], y=pos.y, z = pos.z + homedecor.fdir_to_right[fdir+1][2] }
else
pos2 = { x = pos.x + homedecor.fdir_to_fwd[fdir+1][1], y=pos.y, z = pos.z + homedecor.fdir_to_fwd[fdir+1][2] }
end
local tnode = minetest.get_node(pos)
local tnode2 = minetest.get_node(pos2)
if homedecor.get_nodedef_field(tnode.name, "buildable_to")
and homedecor.get_nodedef_field(tnode2.name, "buildable_to")
and not minetest.is_protected(pos, placer:get_player_name())
and not minetest.is_protected(pos2, placer:get_player_name()) then
minetest.add_node(pos, { name = node1, param2 = fdir })
minetest.add_node(pos2, { name = node2, param2 = fdir })
if not homedecor.expect_infinite_stacks then
itemstack:take_item()
return itemstack
end
end
end
-- Determine if the item being pointed at is the underside of a node (e.g a ceiling)
function homedecor.find_ceiling(itemstack, placer, pointed_thing)
@ -222,8 +105,17 @@ function homedecor.find_ceiling(itemstack, placer, pointed_thing)
return isceiling, pos
end
-- load various other components
-- nodebox arithmetics and helpers
-- (please keep non-generic nodeboxes with their node definition)
dofile(homedecor.modpath.."/handlers/nodeboxes.lua")
-- expand and unexpand decor
dofile(homedecor.modpath.."/handlers/expansion.lua")
-- register nodes that cook stuff
dofile(homedecor.modpath.."/handlers/furnaces.lua")
-- glue it all together into a registration function
dofile(homedecor.modpath.."/handlers/registration.lua")
-- load various other components
dofile(homedecor.modpath.."/misc-nodes.lua") -- the catch-all for all misc nodes
dofile(homedecor.modpath.."/tables.lua")
dofile(homedecor.modpath.."/electronics.lua")
@ -237,14 +129,15 @@ dofile(homedecor.modpath.."/doors_and_gates.lua")
dofile(homedecor.modpath.."/fences.lua")
dofile(homedecor.modpath.."/lighting.lua")
dofile(homedecor.modpath.."/kitchen_cabinet.lua")
dofile(homedecor.modpath.."/refrigerator.lua")
dofile(homedecor.modpath.."/misc-bathroom.lua")
dofile(homedecor.modpath.."/kitchen_appliances.lua")
dofile(homedecor.modpath.."/kitchen_furniture.lua")
dofile(homedecor.modpath.."/bathroom_furniture.lua")
dofile(homedecor.modpath.."/bathroom_sanitation.lua")
dofile(homedecor.modpath.."/laundry.lua")
dofile(homedecor.modpath.."/furnaces.lua")
dofile(homedecor.modpath.."/nightstands.lua")
dofile(homedecor.modpath.."/clocks.lua")
dofile(homedecor.modpath.."/misc-electrical.lua")
@ -256,14 +149,11 @@ dofile(homedecor.modpath.."/crafts.lua")
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.."/climate-control.lua")
dofile(homedecor.modpath.."/cobweb.lua")
dofile(homedecor.modpath.."/locked.lua")
dofile(homedecor.modpath.."/handlers/locked.lua")
print("[HomeDecor] "..S("Loaded!"))

View File

@ -0,0 +1,438 @@
-- This file supplies refrigerators
local S = homedecor.gettext
-- nodebox models
local fridge_model_bottom = {
type = "fixed",
fixed = {
{0, -0.4375, -0.4375, 0.5, 0.5, 0.5}, -- NodeBox1
{-0.5, -0.5, -0.42, 0.5, 0.5, 0.5}, -- NodeBox2
{-0.5, -0.4375, -0.4375, -0.0625, 0.5, 0.5}, -- NodeBox3
{0, 0.25, -0.5, 0.0625, 0.3125, -0.4375}, -- NodeBox4
{-0.125, 0.25, -0.5, -0.0625, 0.3125, -0.4375}, -- NodeBox5
{0, 0.25, -0.5, 0.0625, 0.5, -0.473029}, -- NodeBox6
{-0.125, 0.25, -0.5, -0.0625, 0.5, -0.473029}, -- NodeBox7
}
}
local fridge_model_top = {
type = "fixed",
fixed = {
{0, -0.5, -0.4375, 0.5, 0.5, 0.5}, -- NodeBox1
{-0.0625, -0.5, -0.42, 0, 0.5, 0.5}, -- NodeBox2
{-0.5, -0.5, -0.4375, -0.0625, -0.4375, 0.5}, -- NodeBox3
{-0.5, -0.5, -0.4375, -0.4375, 0.5, 0.5}, -- NodeBox4
{-0.5, -0.1875, -0.4375, -0.0625, 0.5, 0.5}, -- NodeBox5
{-0.4375, -0.4375, -0.125, -0.0625, -0.1875, 0.5}, -- NodeBox6
{-0.125, -0.4375, -0.4375, -0.0625, -0.1875, -0.125}, -- NodeBox7
{-0.3125, -0.3125, -0.307054, -0.25, -0.1875, -0.286307}, -- NodeBox8
{-0.125, 0, -0.5, -0.0625, 0.0625, -0.4375}, -- NodeBox9
{0, 0, -0.5, 0.0625, 0.0625, -0.4375}, -- NodeBox10
{0, -0.5, -0.5, 0.0625, 0.0625, -0.473029}, -- NodeBox11
{-0.125, -0.5, -0.5, -0.0625, 0.0625, -0.473029}, -- NodeBox12
}
}
-- steel-textured fridge
homedecor.register("refrigerator_steel_bottom", {
tiles = {
"default_steel_block.png",
"homedecor_refrigerator_steel_bottom.png",
"homedecor_refrigerator_steel_sides1.png",
"homedecor_refrigerator_steel_sides1.png^[transformFX",
"homedecor_refrigerator_steel_back1.png",
"homedecor_refrigerator_steel_front2.png"
},
inventory_image = "homedecor_refrigerator_steel_inv.png",
description = S("Refrigerator (stainless steel)"),
groups = {snappy=3},
node_box = fridge_model_bottom,
selection_box = homedecor.nodebox.slab_y(2),
expand = {
top="homedecor:refrigerator_steel_top"
},
infotext=S("Refrigerator"),
inventory = {
size=50,
lockable=true,
},
})
homedecor.register("refrigerator_steel_top", {
tiles = {
"homedecor_refrigerator_steel_top.png",
"default_steel_block.png",
"homedecor_refrigerator_steel_sides1.png",
"homedecor_refrigerator_steel_sides1.png^[transformFX",
"homedecor_refrigerator_steel_back1.png",
"homedecor_refrigerator_steel_front1.png"
},
groups = {snappy=3},
node_box = fridge_model_top,
selection_box = homedecor.nodebox.null,
})
-- white, enameled fridge
homedecor.register("refrigerator_white_bottom", {
tiles = {
"default_steel_block.png",
"homedecor_refrigerator_white_bottom.png",
"homedecor_refrigerator_white_sides1.png",
"homedecor_refrigerator_white_sides1.png^[transformFX",
"homedecor_refrigerator_white_back1.png",
"homedecor_refrigerator_white_front2.png"
},
inventory_image = "homedecor_refrigerator_white_inv.png",
description = S("Refrigerator"),
groups = {snappy=3},
node_box = fridge_model_bottom,
selection_box = homedecor.nodebox.slab_y(2),
expand = {
top="homedecor:refrigerator_white_top"
},
infotext=S("Refrigerator"),
inventory = {
size=50,
lockable=true
},
})
homedecor.register("refrigerator_white_top", {
tiles = {
"homedecor_refrigerator_white_top.png",
"default_steel_block.png",
"homedecor_refrigerator_white_sides1.png",
"homedecor_refrigerator_white_sides1.png^[transformFX",
"homedecor_refrigerator_white_back1.png",
"homedecor_refrigerator_white_front1.png"
},
groups = {snappy=3},
node_box = fridge_model_top,
selection_box = homedecor.nodebox.null,
})
-- convert the old single-node fridges to the new two-node models
minetest.register_abm({
nodenames = { "homedecor:refrigerator" },
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local fdir = node.param2
local p_top = { x=pos.x, y=pos.y+1, z=pos.z }
minetest.swap_node(pos, { name = "homedecor:refrigerator_white_bottom", param2 = fdir })
minetest.set_node(p_top, { name = "homedecor:refrigerator_white_top", param2 = fdir })
end
})
minetest.register_abm({
nodenames = { "homedecor:refrigerator_locked" },
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local fdir = node.param2
local p_top = { x=pos.x, y=pos.y+1, z=pos.z }
minetest.swap_node(pos, { name = "homedecor:refrigerator_white_bottom_locked", param2 = fdir })
minetest.set_node(p_top, { name = "homedecor:refrigerator_white_top", param2 = fdir })
end
})
minetest.register_abm({
nodenames = { "homedecor:refrigerator_steel" },
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local fdir = node.param2
local p_top = { x=pos.x, y=pos.y+1, z=pos.z }
minetest.swap_node(pos, { name = "homedecor:refrigerator_steel_bottom", param2 = fdir })
minetest.set_node(p_top, { name = "homedecor:refrigerator_steel_top", param2 = fdir })
end
})
minetest.register_abm({
nodenames = { "homedecor:refrigerator_steel_locked" },
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local fdir = node.param2
local p_top = { x=pos.x, y=pos.y+1, z=pos.z }
minetest.swap_node(pos, { name = "homedecor:refrigerator_steel_bottom_locked", param2 = fdir })
minetest.set_node(p_top, { name = "homedecor:refrigerator_steel_top", param2 = fdir })
end
})
-- kitchen "furnaces"
homedecor.register_furnace("homedecor:oven", {
description = S("Oven"),
tile_format = "homedecor_oven_%s%s.png",
output_slots = 4,
output_width = 2,
cook_speed = 1.25,
})
homedecor.register_furnace("homedecor:oven_steel", {
description = S("Oven (stainless steel)"),
tile_format = "homedecor_oven_steel_%s%s.png",
output_slots = 4,
output_width = 2,
cook_speed = 1.25,
})
homedecor.register_furnace("homedecor:microwave_oven", {
description = S("Microwave Oven"),
tiles = {
"homedecor_microwave_top.png", "homedecor_microwave_top.png^[transformR180",
"homedecor_microwave_top.png^[transformR270", "homedecor_microwave_top.png^[transformR90",
"homedecor_microwave_top.png^[transformR180", "homedecor_microwave_front.png"
},
tiles_active = {
"homedecor_microwave_top.png", "homedecor_microwave_top.png^[transformR180",
"homedecor_microwave_top.png^[transformR270", "homedecor_microwave_top.png^[transformR90",
"homedecor_microwave_top.png^[transformR180", "homedecor_microwave_front_active.png"
},
output_slots = 2,
output_width = 2,
cook_speed = 1.5,
extra_nodedef_fields = {
drawtype = "nodebox",
paramtype = "light",
--paramtype2 = "facedir", -- Not needed, set by register_furnace
node_box = {
type = "fixed",
fixed = { { -0.5, -0.5, -0.125, 0.5, 0.125, 0.5 } },
},
},
})
-- coffee!
-- coffee!
-- coffee!
homedecor.register("coffee_maker", {
tiles = {
"homedecor_coffeemaker_top.png",
"homedecor_coffeemaker_bottom.png",
"homedecor_coffeemaker_right.png",
"homedecor_coffeemaker_right.png^[transformFX",
"homedecor_coffeemaker_back.png",
"homedecor_coffeemaker_front.png"
},
description = "Coffee Maker",
inventory_image = "homedecor_coffeemaker_inv.png",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = {snappy=3},
node_box = {
type = "fixed",
fixed = {
{0.0625, -0.5, -0.025, 0.375, -0.375, 0.5}, -- NodeBox1
{0.0625, -0.375, 0.3125, 0.375, 0, 0.5}, -- NodeBox2
{0.0625, -0.052, 0.02, 0.375, 0.19, 0.5}, -- NodeBox3
{0.078, -0.375, 0, 0.36, -0.0625, 0.3125}, -- NodeBox4
{0.1875, -0.098, -0.0525, 0.25, -0.078, 0}, -- NodeBox5
{0.1875, -0.36, -0.090, 0.25, -0.078, -0.0525}, -- NodeBox6
{0.1875, -0.36, -0.0525, 0.25, -0.34, 0}, -- NodeBox7
{-0.1875, -0.5, -0.3125, -0.1, -0.4, -0.225}, -- NodeBox8
{-0.1975, -0.5, -0.3225, -0.1, -0.375, -0.3125}, -- NodeBox9
{-0.1975, -0.5, -0.235, -0.1, -0.375, -0.225}, -- NodeBox10
{-0.1975, -0.5, -0.3225, -0.1875, -0.375, -0.225}, -- NodeBox11
{-0.11, -0.5, -0.3225, -0.1, -0.375, -0.225}, -- NodeBox12
{-0.1, -0.485, -0.2838, -0.06, -0.475, -0.2638}, -- NodeBox13
{-0.1, -0.4, -0.2838, -0.06, -0.39, -0.2638}, -- NodeBox14
{-0.075, -0.485, -0.2838, -0.06, -0.39, -0.2638}, -- NodeBox15
}
},
selection_box = {
type = "fixed",
fixed = { -0.22, -0.5, -0.35, 0.4, 0.21, 0.5 }
}
})
local fdir_to_steampos = {
x = { 0.15, 0.275, -0.15, -0.275 },
z = { 0.275, -0.15, -0.275, 0.15 }
}
minetest.register_abm({
nodenames = "homedecor:coffee_maker",
interval = 2,
chance = 1,
action = function(pos, node)
local fdir = node.param2
if fdir and fdir < 4 then
local steamx = fdir_to_steampos.x[fdir + 1]
local steamz = fdir_to_steampos.z[fdir + 1]
minetest.add_particlespawner({
amount = 1,
time = 1,
minpos = {x=pos.x - steamx, y=pos.y - 0.35, z=pos.z - steamz},
maxpos = {x=pos.x - steamx, y=pos.y - 0.35, z=pos.z - steamz},
minvel = {x=-0.003, y=0.01, z=-0.003},
maxvel = {x=0.003, y=0.01, z=-0.003},
minacc = {x=0.0,y=-0.0,z=-0.0},
maxacc = {x=0.0,y=0.003,z=-0.0},
minexptime = 2,
maxexptime = 5,
minsize = 1,
maxsize = 1.2,
collisiondetection = false,
texture = "homedecor_steam.png",
})
end
end
})
homedecor.register("toaster", {
description = "Toaster",
tiles = {
"homedecor_toaster_sides.png",
"homedecor_toaster_sides.png",
"homedecor_toaster_sides.png",
"homedecor_toaster_sides.png",
"homedecor_toaster_sides.png",
"homedecor_toaster_sides.png"
},
inventory_image = "homedecor_toaster_inv.png",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = { snappy=3 },
node_box = {
type = "fixed",
fixed = {
{-0.0625, -0.5, -0.125, 0.125, -0.3125, 0.125}, -- NodeBox1
},
},
on_rightclick = function(pos, node, clicker)
local fdir = node.param2
minetest.set_node(pos, { name = "homedecor:toaster_loaf", param2 = fdir })
minetest.sound_play("toaster", {
pos = pos,
gain = 1.0,
max_hear_distance = 5
})
end
})
homedecor.register("toaster_loaf", {
tiles = {
"homedecor_toaster_toploaf.png",
"homedecor_toaster_sides.png",
"homedecor_toaster_sides.png",
"homedecor_toaster_sides.png",
"homedecor_toaster_sides.png",
"homedecor_toaster_sides.png"
},
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
sunlight_propagates = true,
groups = { snappy=3, not_in_creative_inventory=1 },
node_box = {
type = "fixed",
fixed = {
{-0.0625, -0.5, -0.125, 0.125, -0.3125, 0.125}, -- NodeBox1
{-0.03125, -0.3125, -0.0935, 0, -0.25, 0.0935}, -- NodeBox2
{0.0625, -0.3125, -0.0935, 0.0935, -0.25, 0.0935}, -- NodeBox3
},
},
on_rightclick = function(pos, node, clicker)
local fdir = node.param2
minetest.set_node(pos, { name = "homedecor:toaster", param2 = fdir })
end,
drop = "homedecor:toaster"
})
homedecor.register("dishwasher", {
description = "Dishwasher",
drawtype = "nodebox",
tiles = {
"homedecor_dishwasher_top.png",
"homedecor_dishwasher_bottom.png",
"homedecor_dishwasher_sides.png",
"homedecor_dishwasher_sides.png^[transformFX",
"homedecor_dishwasher_back.png",
"homedecor_dishwasher_front.png"
},
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.4375, 0.5},
{-0.5, -0.5, -0.5, 0.5, 0.5, -0.4375},
{-0.5, -0.5, -0.5, 0.5, 0.1875, 0.1875},
{-0.4375, -0.5, -0.5, 0.4375, 0.4375, 0.4375},
}
},
selection_box = { type = "regular" },
groups = { snappy = 3 },
})
homedecor.register("dishwasher_wood", {
description = "Dishwasher",
tiles = {
"homedecor_kitchen_cabinet_top.png",
"homedecor_dishwasher_bottom.png",
"homedecor_dishwasher_sides.png",
"homedecor_dishwasher_sides.png^[transformFX",
"homedecor_dishwasher_back.png",
"homedecor_dishwasher_front.png"
},
paramtype = "light",
paramtype2 = "facedir",
groups = { snappy = 3 },
})
homedecor.register("dishwasher_steel", {
description = "Dishwasher",
tiles = {
"homedecor_kitchen_cabinet_top_steel.png",
"homedecor_dishwasher_bottom.png",
"homedecor_dishwasher_sides.png",
"homedecor_dishwasher_sides.png^[transformFX",
"homedecor_dishwasher_back.png",
"homedecor_dishwasher_front.png"
},
paramtype = "light",
paramtype2 = "facedir",
groups = { snappy = 3 },
})
homedecor.register("dishwasher_marble", {
description = "Dishwasher",
tiles = {
"homedecor_kitchen_cabinet_top_marble.png",
"homedecor_dishwasher_bottom.png",
"homedecor_dishwasher_sides.png",
"homedecor_dishwasher_sides.png^[transformFX",
"homedecor_dishwasher_back.png",
"homedecor_dishwasher_front.png"
},
paramtype = "light",
paramtype2 = "facedir",
groups = { snappy = 3 },
})
homedecor.register("dishwasher_granite", {
description = "Dishwasher",
tiles = {
"homedecor_kitchen_cabinet_top_granite.png",
"homedecor_dishwasher_bottom.png",
"homedecor_dishwasher_sides.png",
"homedecor_dishwasher_sides.png^[transformFX",
"homedecor_dishwasher_back.png",
"homedecor_dishwasher_front.png"
},
paramtype = "light",
paramtype2 = "facedir",
groups = { snappy = 3 },
})

View File

@ -1,170 +0,0 @@
-- This file supplies Kitchen cabinets and kitchen sink
local S = homedecor.gettext
local counter_materials = { "", "granite", "marble", "steel" }
for _, mat in ipairs(counter_materials) do
local desc = S("Kitchen Cabinet")
local material = ""
if mat ~= "" then
desc = S("Kitchen Cabinet ("..mat.." top)")
material = "_"..mat
end
minetest.register_node('homedecor:kitchen_cabinet'..material, {
description = desc,
tiles = { 'homedecor_kitchen_cabinet_top'..material..'.png',
'homedecor_kitchen_cabinet_bottom.png',
'homedecor_kitchen_cabinet_sides.png',
'homedecor_kitchen_cabinet_sides.png',
'homedecor_kitchen_cabinet_sides.png',
'homedecor_kitchen_cabinet_front.png'},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",
"size[8,8]"..
"list[current_name;main;0,0;8,3;]"..
"list[current_player;main;0,4;8,4;]")
meta:set_string("infotext", S("Kitchen Cabinet"))
local inv = meta:get_inventory()
inv:set_size("main", 24)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", S("%s moves stuff in kitchen cabinet at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", S("%s moves stuff to kitchen cabinet at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", S("%s takes stuff from kitchen cabinet at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
})
end
minetest.register_node('homedecor:kitchen_cabinet_half', {
drawtype="nodebox",
description = S('Half-height Kitchen Cabinet (on ceiling)'),
tiles = { 'homedecor_kitchen_cabinet_sides.png',
'homedecor_kitchen_cabinet_bottom.png',
'homedecor_kitchen_cabinet_sides.png',
'homedecor_kitchen_cabinet_sides.png',
'homedecor_kitchen_cabinet_sides.png',
'homedecor_kitchen_cabinet_front_half.png'},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.5, 0, -0.5, 0.5, 0.5, 0.5 }
},
node_box = {
type = "fixed",
fixed = { -0.5, 0, -0.5, 0.5, 0.5, 0.5 }
},
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",
"size[8,7]"..
"list[current_name;main;1,0;6,2;]"..
"list[current_player;main;0,3;8,4;]")
meta:set_string("infotext", S("Kitchen Cabinet"))
local inv = meta:get_inventory()
inv:set_size("main", 12)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", S("%s moves stuff in kitchen cabinet at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", S("%s moves stuff to kitchen cabinet at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", S("%s takes stuff from kitchen cabinet at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
})
minetest.register_node('homedecor:kitchen_cabinet_with_sink', {
description = S("Kitchen Cabinet with sink"),
drawtype = "mesh",
mesh = "homedecor_kitchen_sink.obj",
tiles = { "homedecor_kitchen_sink.png" },
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",
"size[8,7]"..
"list[current_name;main;0,0;8,2;]"..
"list[current_player;main;0,3;8,4;]")
meta:set_string("infotext", S("Under-sink cabinet"))
local inv = meta:get_inventory()
inv:set_size("main", 16)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", S("%s moves stuff in kitchen cabinet at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", S("%s moves stuff to kitchen cabinet at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", S("%s takes stuff from kitchen cabinet at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
})

View File

@ -0,0 +1,134 @@
-- This file supplies Kitchen cabinets and kitchen sink
local S = homedecor.gettext
local counter_materials = { "", "granite", "marble", "steel" }
for _, mat in ipairs(counter_materials) do
local desc = S("Kitchen Cabinet")
local material = ""
if mat ~= "" then
desc = S("Kitchen Cabinet ("..mat.." top)")
material = "_"..mat
end
homedecor.register("kitchen_cabinet"..material, {
description = desc,
tiles = { 'homedecor_kitchen_cabinet_top'..material..'.png',
'homedecor_kitchen_cabinet_bottom.png',
'homedecor_kitchen_cabinet_sides.png',
'homedecor_kitchen_cabinet_sides.png',
'homedecor_kitchen_cabinet_sides.png',
'homedecor_kitchen_cabinet_front.png'},
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
infotext=S("Kitchen Cabinet"),
inventory = {
size=24,
},
})
end
local kitchen_cabinet_half_box = homedecor.nodebox.slab_y(0.5, 0.5)
homedecor.register("kitchen_cabinet_half", {
description = S('Half-height Kitchen Cabinet (on ceiling)'),
tiles = { 'homedecor_kitchen_cabinet_sides.png',
'homedecor_kitchen_cabinet_bottom.png',
'homedecor_kitchen_cabinet_sides.png',
'homedecor_kitchen_cabinet_sides.png',
'homedecor_kitchen_cabinet_sides.png',
'homedecor_kitchen_cabinet_front_half.png'},
selection_box = kitchen_cabinet_half_box,
node_box = kitchen_cabinet_half_box,
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
infotext=S("Kitchen Cabinet"),
inventory = {
size=12,
},
})
homedecor.register("kitchen_cabinet_with_sink", {
description = S("Kitchen Cabinet with sink"),
mesh = "homedecor_kitchen_sink.obj",
tiles = { "homedecor_kitchen_sink.png" },
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
infotext=S("Under-sink cabinet"),
inventory = {
size=16,
},
})
homedecor.register("copper_pans", {
description = "Copper pans",
tiles = {
"homedecor_polished_copper.png"
},
inventory_image = "homedecor_copper_pans_inv.png",
groups = { snappy=3 },
node_box = {
type = "fixed",
fixed = {
{-0.375, -0.5, -0.1875, -0.0625, -0.48, 0.125}, -- NodeBox1
{-0.375, -0.48, -0.1875, -0.36, -0.3125, 0.125}, -- NodeBox2
{-0.0775, -0.48, -0.1875, -0.0625, -0.3125, 0.125}, -- NodeBox3
{-0.375, -0.48, 0.11, -0.0625, -0.3125, 0.125}, -- NodeBox4
{-0.375, -0.48, -0.1875, -0.0625, -0.3125, -0.1725}, -- NodeBox5
{-0.25, -0.36, -0.5, -0.1875, -0.33, -0.1875}, -- NodeBox6
{0.0625, -0.5, 0, 0.375, -0.48, 0.3125}, -- NodeBox7
{0.0625, -0.48, 0, 0.0775, -0.3125, 0.3125}, -- NodeBox8
{0.36, -0.48, 0, 0.375, -0.3125, 0.3125}, -- NodeBox9
{0.0625, -0.48, 0, 0.375, -0.3125, 0.0175}, -- NodeBox10
{0.0625, -0.48, 0.295, 0.375, -0.3125, 0.3125}, -- NodeBox11
{0.1875, -0.36, -0.3125, 0.25, -0.33, 0}, -- NodeBox12
}
},
selection_box = {
type = "fixed",
fixed = { -0.375, -0.5, -0.5, 0.375, -0.3125, 0.3125 }
},
on_place = minetest.rotate_node
})
homedecor.register("kitchen_faucet", {
tiles = { "homedecor_bright_metal.png" },
inventory_image = "homedecor_kitchen_faucet_inv.png",
description = "Kitchen Faucet",
groups = {snappy=3},
node_box = {
type = "fixed",
fixed = {
{0, -0.5, 0.375, 0.0625, -0.1875, 0.4375}, -- NodeBox1
{0, -0.1875, 0.35, 0.0625, -0.15, 0.4375}, -- NodeBox2
{0, -0.15, 0.32, 0.0625, -0.11, 0.41}, -- NodeBox3
{0.007, -0.12, 0.17, 0.055, -0.11, 0.1285}, -- NodeBox4
{0, -0.11, 0.125, 0.0625, -0.07, 0.37}, -- NodeBox5
{-0.05, -0.48, 0.385, 0.115, -0.455, 0.43}, -- NodeBox6
{-0.05, -0.49, 0.395, 0.115, -0.445, 0.42}, -- NodeBox7
}
},
selection_box = {
type = "fixed",
fixed = { -0.055, -0.5, 0.125, 0.12, -0.065, 0.4375 }
},
})
homedecor.register("paper_towel", {
mesh = "homedecor_paper_towel.obj",
tiles = { "homedecor_paper_towel.png" },
inventory_image = "homedecor_paper_towel_inv.png",
description = "Paper towels",
groups = { snappy=3 },
selection_box = {
type = "fixed",
fixed = { -0.4375, 0.125, 0.0625, 0.4375, 0.4375, 0.5 }
},
collision_box = {
type = "fixed",
fixed = { -0.4375, 0.125, 0.0625, 0.4375, 0.4375, 0.5 }
}
})

View File

@ -1,8 +1,7 @@
-- laundry devices
minetest.register_node("homedecor:washing_machine", {
homedecor.register("washing_machine", {
description = "Washing Machine",
drawtype = "nodebox",
tiles = {
"homedecor_washing_machine_top.png",
"homedecor_washing_machine_bottom.png",
@ -11,8 +10,6 @@ minetest.register_node("homedecor:washing_machine", {
"homedecor_washing_machine_back.png",
"homedecor_washing_machine_front.png"
},
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
@ -20,16 +17,12 @@ minetest.register_node("homedecor:washing_machine", {
{-0.5, -0.5, 0.3125, 0.5, 0.5, 0.5},
}
},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
},
selection_box = { type = "regular" },
groups = { snappy = 3 },
})
minetest.register_node("homedecor:dryer", {
homedecor.register("dryer", {
description = "Tumble dryer",
drawtype = "nodebox",
tiles = {
"homedecor_dryer_top.png",
"homedecor_dryer_bottom.png",
@ -38,8 +31,6 @@ minetest.register_node("homedecor:dryer", {
"homedecor_dryer_back.png",
"homedecor_dryer_front.png"
},
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
@ -47,10 +38,7 @@ minetest.register_node("homedecor:dryer", {
{-0.5, -0.5, 0.3125, 0.5, 0.5, 0.5},
}
},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
},
selection_box = { type = "regular" },
groups = { snappy = 3 },
})

View File

@ -61,11 +61,19 @@ for i in ipairs(colors) do
})
end
local glowlight_nodebox = {
half = homedecor.nodebox.slab_y(1/2),
quarter = homedecor.nodebox.slab_y(1/4),
small_cube = {
type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
},
}
-- Yellow
minetest.register_node('homedecor:glowlight_half_yellow', {
homedecor.register("glowlight_half_yellow", {
description = S("Yellow Glowlight (thick)"),
drawtype = "nodebox",
tiles = {
'homedecor_glowlight_yellow_top.png',
'homedecor_glowlight_yellow_bottom.png',
@ -74,28 +82,16 @@ minetest.register_node('homedecor:glowlight_half_yellow', {
'homedecor_glowlight_thick_yellow_sides.png',
'homedecor_glowlight_thick_yellow_sides.png'
},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }
},
node_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }
},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = glowlight_nodebox.half,
node_box = glowlight_nodebox.half,
groups = { snappy = 3 },
light_source = LIGHT_MAX,
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_node('homedecor:glowlight_quarter_yellow', {
homedecor.register("glowlight_quarter_yellow", {
description = S("Yellow Glowlight (thin)"),
drawtype = "nodebox",
tiles = {
'homedecor_glowlight_yellow_top.png',
'homedecor_glowlight_yellow_bottom.png',
@ -104,19 +100,8 @@ minetest.register_node('homedecor:glowlight_quarter_yellow', {
'homedecor_glowlight_thin_yellow_sides.png',
'homedecor_glowlight_thin_yellow_sides.png'
},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }
},
node_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }
},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = glowlight_nodebox.quarter,
node_box = glowlight_nodebox.quarter,
groups = { snappy = 3 },
light_source = LIGHT_MAX-1,
sounds = default.node_sound_wood_defaults(),
@ -125,9 +110,8 @@ minetest.register_node('homedecor:glowlight_quarter_yellow', {
-- White
minetest.register_node('homedecor:glowlight_half_white', {
homedecor.register("glowlight_half_white", {
description = S("White Glowlight (thick)"),
drawtype = "nodebox",
tiles = {
'homedecor_glowlight_white_top.png',
'homedecor_glowlight_white_bottom.png',
@ -136,28 +120,16 @@ minetest.register_node('homedecor:glowlight_half_white', {
'homedecor_glowlight_thick_white_sides.png',
'homedecor_glowlight_thick_white_sides.png'
},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }
},
node_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0, 0.5 }
},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = glowlight_nodebox.half,
node_box = glowlight_nodebox.half,
groups = { snappy = 3 },
light_source = LIGHT_MAX,
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_node('homedecor:glowlight_quarter_white', {
homedecor.register("glowlight_quarter_white", {
description = S("White Glowlight (thin)"),
drawtype = "nodebox",
tiles = {
'homedecor_glowlight_white_top.png',
'homedecor_glowlight_white_bottom.png',
@ -166,19 +138,8 @@ minetest.register_node('homedecor:glowlight_quarter_white', {
'homedecor_glowlight_thin_white_sides.png',
'homedecor_glowlight_thin_white_sides.png'
},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }
},
node_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, -0.25, 0.5 }
},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = glowlight_nodebox.quarter,
node_box = glowlight_nodebox.quarter,
groups = { snappy = 3 },
light_source = LIGHT_MAX-1,
sounds = default.node_sound_wood_defaults(),
@ -187,9 +148,8 @@ minetest.register_node('homedecor:glowlight_quarter_white', {
-- Glowlight "cubes"
minetest.register_node('homedecor:glowlight_small_cube_yellow', {
homedecor.register("glowlight_small_cube_yellow", {
description = S("Yellow Glowlight (small cube)"),
drawtype = "nodebox",
tiles = {
'homedecor_glowlight_cube_yellow_tb.png',
'homedecor_glowlight_cube_yellow_tb.png',
@ -198,28 +158,16 @@ minetest.register_node('homedecor:glowlight_small_cube_yellow', {
'homedecor_glowlight_cube_yellow_sides.png',
'homedecor_glowlight_cube_yellow_sides.png'
},
selection_box = {
type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
},
node_box = {
type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = glowlight_nodebox.small_cube,
node_box = glowlight_nodebox.small_cube,
groups = { snappy = 3 },
light_source = LIGHT_MAX-1,
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_node('homedecor:glowlight_small_cube_white', {
homedecor.register("glowlight_small_cube_white", {
description = S("White Glowlight (small cube)"),
drawtype = "nodebox",
tiles = {
'homedecor_glowlight_cube_white_tb.png',
'homedecor_glowlight_cube_white_tb.png',
@ -228,26 +176,15 @@ minetest.register_node('homedecor:glowlight_small_cube_white', {
'homedecor_glowlight_cube_white_sides.png',
'homedecor_glowlight_cube_white_sides.png'
},
selection_box = {
type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
},
node_box = {
type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = glowlight_nodebox.small_cube,
node_box = glowlight_nodebox.small_cube,
groups = { snappy = 3 },
light_source = LIGHT_MAX-1,
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.register_node("homedecor:plasma_lamp", {
homedecor.register("plasma_lamp", {
description = "Plasma Lamp",
drawtype = "glasslike_framed",
tiles = {"homedecor_gold_block.png","homedecor_glass_face_clean.png"},
@ -258,7 +195,6 @@ minetest.register_node("homedecor:plasma_lamp", {
}
},
-- use_texture_alpha = true,
paramtype = "light",
light_source = LIGHT_MAX - 1,
sunlight_propagates = true,
groups = {cracky=3,oddly_breakable_by_hand=3},
@ -268,9 +204,8 @@ minetest.register_node("homedecor:plasma_lamp", {
end
})
minetest.register_node('homedecor:candle', {
homedecor.register("candle", {
description = S("Thick Candle"),
drawtype = "nodebox",
tiles = {
'homedecor_candle_top.png',
'homedecor_candle_top.png',
@ -291,15 +226,12 @@ minetest.register_node('homedecor:candle', {
}
},
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
groups = { snappy = 3 },
light_source = LIGHT_MAX-4,
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node('homedecor:candle_thin', {
homedecor.register("candle_thin", {
description = S("Little Candle"),
inventory_image = 'homedecor_candle_inv.png',
drawtype = "plantlike",
@ -313,22 +245,17 @@ minetest.register_node('homedecor:candle_thin', {
}
},
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
walkable = false,
groups = { snappy = 3 },
light_source = LIGHT_MAX-4,
})
minetest.register_node('homedecor:oil_lamp', {
homedecor.register("oil_lamp", {
description = S("Oil lamp"),
drawtype = "plantlike",
tiles = { 'homedecor_oil_lamp.png' },
inventory_image = 'homedecor_oil_lamp.png',
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = {
@ -340,15 +267,12 @@ minetest.register_node('homedecor:oil_lamp', {
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node('homedecor:wall_lantern', {
homedecor.register("wall_lantern", {
description = S("Wall lantern"),
drawtype = "plantlike",
tiles = { 'homedecor_wall_lantern.png' },
inventory_image = 'homedecor_wall_lantern.png',
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = {
@ -360,20 +284,16 @@ minetest.register_node('homedecor:wall_lantern', {
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node('homedecor:lattice_lantern_large', {
homedecor.register("lattice_lantern_large", {
description = S("Lattice lantern (large)"),
tiles = { 'homedecor_lattice_lantern_large.png' },
sunlight_propagates = false,
paramtype = "light",
walkable = true,
groups = { snappy = 3 },
light_source = LIGHT_MAX,
sounds = default.node_sound_wood_defaults(),
})
minetest.register_node('homedecor:lattice_lantern_small', {
homedecor.register("lattice_lantern_small", {
description = S("Lattice lantern (small)"),
drawtype = "nodebox",
tiles = {
'homedecor_lattice_lantern_small_tb.png',
'homedecor_lattice_lantern_small_tb.png',
@ -387,10 +307,6 @@ minetest.register_node('homedecor:lattice_lantern_small', {
type = "fixed",
fixed = { -0.25, -0.5, -0.25, 0.25, 0, 0.25 }
},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
groups = { snappy = 3 },
light_source = LIGHT_MAX-1,
sounds = default.node_sound_wood_defaults(),
@ -418,12 +334,10 @@ local function reg_lamp(suffix, nxt, tilesuffix, light, color)
colordesc = " (white)"
end
minetest.register_node("homedecor:table_lamp"..lampcolor.."_"..suffix, {
homedecor.register("table_lamp"..lampcolor.."_"..suffix, {
description = S("Table Lamp "..colordesc),
drawtype = "mesh",
mesh = "homedecor_table_lamp.obj",
tiles = { "homedecor_table_standing_lamp"..lampcolor.."_"..suffix..".png" },
paramtype = "light",
walkable = false,
light_source = light,
selection_box = tlamp_cbox,
@ -441,13 +355,11 @@ local function reg_lamp(suffix, nxt, tilesuffix, light, color)
-- standing lamps
minetest.register_node("homedecor:standing_lamp"..lampcolor.."_"..suffix, {
homedecor.register("standing_lamp"..lampcolor.."_"..suffix, {
description = S("Standing Lamp"..colordesc),
drawtype = "mesh",
mesh = "homedecor_standing_lamp.obj",
tiles = { "homedecor_table_standing_lamp"..lampcolor.."_"..suffix..".png" },
inventory_image = "homedecor_standing_lamp"..lampcolor.."_inv.png",
paramtype = "light",
walkable = false,
light_source = light,
groups = {cracky=2,oddly_breakable_by_hand=1,
@ -455,15 +367,12 @@ local function reg_lamp(suffix, nxt, tilesuffix, light, color)
},
selection_box = slamp_cbox,
collision_box = slamp_cbox,
on_place = function(itemstack, placer, pointed_thing)
return homedecor.place_twonode_vertical(itemstack, placer, pointed_thing,
"homedecor:standing_lamp"..lampcolor.."_"..suffix)
end,
on_punch = function(pos, node, puncher)
node.name = "homedecor:standing_lamp"..lampcolor.."_"..repl[suffix]
minetest.set_node(pos, node)
nodeupdate(pos)
end,
expand = { top="air" },
})
-- "bottom" in the node name is obsolete now, as "top" node doesn't exist anymore.

View File

@ -1,161 +0,0 @@
-- Locked Stuff for Home Decor mod, by Kaeza
--
-- The code is mostly copypasta from default:chest_locked, with a few
-- tidbits to ease creation of new items, should need arise.
local S = homedecor.gettext
--[[
| create_locked ( name, infotext )
|
| Description:
| This function takes a base node name such as "homedecor:refrigerator",
| copies the definition from the original item into a new table, modifies
| it a bit, and registers a new node with a "_locked" suffix such as
| "homedecor:refrigerator_locked". The new node behaves identically to
| the base node, except that moving items to/from the node's inventory
| is only allowed for the original placer. In addition, it register a new
| shapeless recipe for the node, using the base node plus a steel ingot.
|
| Arguments:
| name The base node name
| infotext The infotext description (in case the name is too long).
|
| Example Usage:
| create_locked("homedecor:refrigerator", "Locked Fridge")
| ^ This generates a new "Locked Refrigerator" node, whose infotext is
| "Locked Fridge (owned by <placer>)".
|
| Notes:
| If <infotext> is not specified (or is nil), the infotext will be the
| base node's description prefixed by "Locked ".
|
| The ABM for the locked oven is defined in oven.lua.
]]
local function create_locked ( name, infotext )
local def = { }
for k, v in pairs(minetest.registered_nodes[name]) do
def[k] = v
end
def.type = nil
def.name = nil
def.description = S("%s (Locked)"):format(def.description)
local after_place_node = def.after_place_node
def.after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos)
meta:set_string("owner", placer:get_player_name() or "")
meta:set_string("infotext", S("%s (owned by %s)"):format(infotext,meta:get_string("owner")))
if (after_place_node) then
return after_place_node(pos, placer)
end
end
local allow_metadata_inventory_move = def.allow_metadata_inventory_move;
def.allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
local meta = minetest.get_meta(pos)
if (player:get_player_name() ~= meta:get_string("owner")) then
minetest.log("action", S("%s tried to access a %s belonging to %s at %s"):format(
player:get_player_name(),
infotext,
meta:get_string("owner"),
minetest.pos_to_string(pos)
))
return 0
end
if (allow_metadata_inventory_move) then
return allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player)
else
return count
end
end
local allow_metadata_inventory_put = def.allow_metadata_inventory_put;
def.allow_metadata_inventory_put = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if (player:get_player_name() ~= meta:get_string("owner")) then
minetest.log("action", S("%s tried to access a %s belonging to %s at %s"):format(
player:get_player_name(),
infotext,
meta:get_string("owner"),
minetest.pos_to_string(pos)
))
return 0
end
if (allow_metadata_inventory_put) then
return allow_metadata_inventory_put(pos, listname, index, stack, player)
else
return stack:get_count()
end
end
local allow_metadata_inventory_take = def.allow_metadata_inventory_take;
def.allow_metadata_inventory_take = function(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos)
if (player:get_player_name() ~= meta:get_string("owner")) then
minetest.log("action", S("%s tried to access a %s belonging to %s at %s"):format(
player:get_player_name(),
infotext,
meta:get_string("owner"),
minetest.pos_to_string(pos)
))
return 0
end
if (allow_metadata_inventory_take) then
return allow_metadata_inventory_take(pos, listname, index, stack, player)
else
return stack:get_count()
end
end
minetest.register_node(name.."_locked", def)
minetest.register_craft({
output = name.."_locked",
type = "shapeless",
recipe = {
name,
"default:steel_ingot",
}
})
end
local items = {
{ "refrigerator_white_bottom",
"Refrigerator" },
{ "refrigerator_steel_bottom",
"Refrigerator (stainless steel)" },
{ "kitchen_cabinet",
"Cabinet" },
{ "kitchen_cabinet_steel",
"Cabinet (stainless steel top)" },
{ "kitchen_cabinet_granite",
"Cabinet (granite top)" },
{ "kitchen_cabinet_marble",
"Cabinet (marble top)" },
{ "kitchen_cabinet_half",
"Cabinet" },
{ "kitchen_cabinet_with_sink",
"Cabinet" },
{ "nightstand_oak_one_drawer",
"Nightstand" },
{ "nightstand_oak_two_drawers",
"Nightstand" },
{ "nightstand_mahogany_one_drawer",
"Nightstand" },
{ "nightstand_mahogany_two_drawers",
"Nightstand" },
{ "filing_cabinet",
"Filing cabinet" },
{ "oven",
"Oven" },
{ "oven_active",
"Oven (active)" },
{ "oven_steel",
"Oven (stainless steel)" },
{ "oven_steel_active",
"Oven (stainless steel, active)" },
{ "microwave_oven",
"Microwave Oven" },
{ "microwave_oven_active",
"Microwave Oven (active)" },
}
for _,item in ipairs(items) do
local name, info = item[1], item[2];
create_locked("homedecor:"..name, S("Locked "..info));
end

View File

@ -1,7 +1,4 @@
minetest.register_node("homedecor:power_outlet", {
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
homedecor.register("power_outlet", {
description = "Power Outlet",
tiles = {
"homedecor_outlet_edges.png",
@ -28,10 +25,7 @@ minetest.register_node("homedecor:power_outlet", {
sounds = default.node_sound_stone_defaults()
})
minetest.register_node("homedecor:light_switch", {
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
homedecor.register("light_switch", {
description = "Light switch",
tiles = {
"homedecor_light_switch_edges.png",
@ -60,3 +54,25 @@ minetest.register_node("homedecor:light_switch", {
sounds = default.node_sound_stone_defaults()
})
homedecor.register("doorbell", {
tiles = { "homedecor_doorbell.png" },
inventory_image = "homedecor_doorbell_inv.png",
description = "Doorbell",
groups = {snappy=3},
node_box = {
type = "fixed",
fixed = {
{-0.0625, 0, 0.46875, 0.0625, 0.1875, 0.5}, -- NodeBox1
{-0.03125, 0.0625, 0.45, 0.03125, 0.125, 0.4675}, -- NodeBox2
}
},
on_punch = function(pos, node, puncher, pointed_thing)
minetest.sound_play("homedecor_doorbell", {
pos = pos,
gain = 1.0,
max_hear_distance = 15
})
end
})

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 B

After

Width:  |  Height:  |  Size: 165 B

View File

@ -2,8 +2,7 @@
local S = homedecor.gettext
minetest.register_node('homedecor:nightstand_oak_one_drawer', {
drawtype = "nodebox",
homedecor.register("nightstand_oak_one_drawer", {
description = S("Oak Nightstand with One Drawer"),
tiles = { 'homedecor_nightstand_oak_top.png',
'homedecor_nightstand_oak_bottom.png',
@ -11,14 +10,7 @@ minetest.register_node('homedecor:nightstand_oak_one_drawer', {
'homedecor_nightstand_oak_left.png',
'homedecor_nightstand_oak_back.png',
'homedecor_nightstand_oak_1_drawer_front.png'},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
},
selection_box = { type = "regular" },
node_box = {
type = "fixed",
fixed = {
@ -32,44 +24,13 @@ minetest.register_node('homedecor:nightstand_oak_one_drawer', {
},
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",
"size[8,6]"..
"list[current_name;main;0,0;8,1;]"..
"list[current_player;main;0,2;8,4;]")
meta:set_string("infotext", S("One-drawer Nightstand"))
local inv = meta:get_inventory()
inv:set_size("main", 8)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", S("%s moves stuff in nightstand at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", S("%s moves stuff to nightstand at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", S("%s takes stuff from nightstand at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
infotext=S("One-drawer Nightstand"),
inventory = {
size=8,
},
})
minetest.register_node('homedecor:nightstand_oak_two_drawers', {
drawtype = "nodebox",
homedecor.register("nightstand_oak_two_drawers", {
description = S("Oak Nightstand with Two Drawers"),
tiles = { 'homedecor_nightstand_oak_top.png',
'homedecor_nightstand_oak_bottom.png',
@ -77,14 +38,7 @@ minetest.register_node('homedecor:nightstand_oak_two_drawers', {
'homedecor_nightstand_oak_left.png',
'homedecor_nightstand_oak_back.png',
'homedecor_nightstand_oak_2_drawer_front.png'},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
},
selection_box = { type = "regular" },
node_box = {
type = "fixed",
fixed = {
@ -96,43 +50,13 @@ minetest.register_node('homedecor:nightstand_oak_two_drawers', {
},
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",
"size[8,7]"..
"list[current_name;main;0,0;8,2;]"..
"list[current_player;main;0,3;8,4;]")
meta:set_string("infotext", S("Two-drawer Nightstand"))
local inv = meta:get_inventory()
inv:set_size("main", 16)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", S("%s moves stuff in nightstand at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", S("%s moves stuff to nightstand at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", S("%s takes stuff from nightstand at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
infotext=S("Two-drawer Nightstand"),
inventory = {
size=16,
},
})
minetest.register_node('homedecor:nightstand_mahogany_one_drawer', {
drawtype = "nodebox",
homedecor.register("nightstand_mahogany_one_drawer", {
description = S("Mahogany Nightstand with One Drawer"),
tiles = { 'homedecor_nightstand_mahogany_top.png',
'homedecor_nightstand_mahogany_bottom.png',
@ -140,14 +64,7 @@ minetest.register_node('homedecor:nightstand_mahogany_one_drawer', {
'homedecor_nightstand_mahogany_left.png',
'homedecor_nightstand_mahogany_back.png',
'homedecor_nightstand_mahogany_1_drawer_front.png'},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
},
selection_box = { type = "regular" },
node_box = {
type = "fixed",
fixed = {
@ -161,44 +78,13 @@ minetest.register_node('homedecor:nightstand_mahogany_one_drawer', {
},
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",
"size[8,6]"..
"list[current_name;main;0,0;8,1;]"..
"list[current_player;main;0,2;8,4;]")
meta:set_string("infotext", S("One-drawer Nightstand"))
local inv = meta:get_inventory()
inv:set_size("main", 8)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", S("%s moves stuff in nightstand at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", S("%s moves stuff to nightstand at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", S("%s takes stuff from nightstand at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
infotext=S("One-drawer Nightstand"),
inventory = {
size=8,
},
})
minetest.register_node('homedecor:nightstand_mahogany_two_drawers', {
drawtype = "nodebox",
homedecor.register("nightstand_mahogany_two_drawers", {
description = S("Mahogany Nightstand with Two Drawers"),
tiles = { 'homedecor_nightstand_mahogany_top.png',
'homedecor_nightstand_mahogany_bottom.png',
@ -206,14 +92,7 @@ minetest.register_node('homedecor:nightstand_mahogany_two_drawers', {
'homedecor_nightstand_mahogany_left.png',
'homedecor_nightstand_mahogany_back.png',
'homedecor_nightstand_mahogany_2_drawer_front.png'},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.5, 0.5, 0.5, 0.5 }
},
selection_box = { type = "regular" },
node_box = {
type = "fixed",
fixed = {
@ -225,37 +104,8 @@ minetest.register_node('homedecor:nightstand_mahogany_two_drawers', {
},
groups = { snappy = 3 },
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",
"size[8,7]"..
"list[current_name;main;0,0;8,2;]"..
"list[current_player;main;0,3;8,4;]")
meta:set_string("infotext", S("Two-drawer Nightstand"))
local inv = meta:get_inventory()
inv:set_size("main", 16)
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", S("%s moves stuff in nightstand at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", S("%s moves stuff to nightstand at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", S("%s takes stuff from nightstand at %s"):format(
player:get_player_name(),
minetest.pos_to_string(pos)
))
end,
infotext=S("Two-drawer Nightstand"),
inventory = {
size=16,
},
})

View File

@ -1,9 +1,8 @@
--Various kinds of paintings
for i = 1,20 do
minetest.register_node("homedecor:painting_"..i, {
homedecor.register("painting_"..i, {
description = "Decorative painting #"..i,
drawtype = "nodebox",
tiles = {
"homedecor_painting_edges.png",
"homedecor_painting_edges.png",
@ -12,8 +11,6 @@ for i = 1,20 do
"homedecor_painting_back.png",
"homedecor_painting"..i..".png"
},
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {

Some files were not shown because too many files have changed in this diff Show More