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,152 +1,141 @@
-- 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; };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 0, 0, 17, 32, 32, 12 }, -- Monitor Screen
{ 3, 3, 29, 26, 26, 3 }, -- Monitor Tube
{ 0, 0, 0, 32, 4, 17 }, -- Keyboard
});
description = "SheFriendSOO";
tiles_off = { front=true; };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 0, 0, 17, 32, 32, 12 }, -- Monitor Screen
{ 3, 3, 29, 26, 26, 3 }, -- Monitor Tube
{ 0, 0, 0, 32, 4, 17 }, -- Keyboard
});
});
-- 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; };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 0, 0, 4, 32, 3, 24 }, -- Keyboard
{ 0, 3, 25, 32, 21, 3 }, -- Screen
});
node_box_off = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 0, 0, 4, 32, 3, 24 }, -- Keyboard
{ 0, 3, 4, 32, 3, 24 }, -- Screen
});
description = "Pony Vanio";
tiles_off = { front=true; top=true; left=true; right=true; back=true; };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 0, 0, 4, 32, 3, 24 }, -- Keyboard
{ 0, 3, 25, 32, 21, 3 }, -- Screen
});
node_box_off = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 0, 0, 4, 32, 3, 24 }, -- Keyboard
{ 0, 3, 4, 32, 3, 24 }, -- Screen
});
});
-- 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; };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 0, 0, 11, 32, 6, 21 }, -- Console
{ 1, 0, 1, 4, 2, 9 }, -- Controller 1 L Grip
{ 10, 0, 1, 4, 2, 9 }, -- Controller 1 R Grip
{ 5, 0, 4, 5, 2, 5 }, -- Controller 1 Center
{ 18, 0, 1, 4, 2, 9 }, -- Controller 2 L Grip
{ 27, 0, 1, 4, 2, 9 }, -- Controller 2 R Grip
{ 22, 0, 4, 5, 2, 5 }, -- Controller 2 Center
});
description = "Pony SlayStation";
tiles_off = { top=true; };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 0, 0, 11, 32, 6, 21 }, -- Console
{ 1, 0, 1, 4, 2, 9 }, -- Controller 1 L Grip
{ 10, 0, 1, 4, 2, 9 }, -- Controller 1 R Grip
{ 5, 0, 4, 5, 2, 5 }, -- Controller 1 Center
{ 18, 0, 1, 4, 2, 9 }, -- Controller 2 L Grip
{ 27, 0, 1, 4, 2, 9 }, -- Controller 2 R Grip
{ 22, 0, 4, 5, 2, 5 }, -- Controller 2 Center
});
});
-- 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; };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 2, 2, 11, 28, 3, 19 }, -- Console (Upper part)
{ 2, 0, 11, 26, 2, 19 }, -- Console (Lower part)
{ 1, 0, 1, 4, 2, 9 }, -- Controller 1 L Grip
{ 10, 0, 1, 4, 2, 9 }, -- Controller 1 R Grip
{ 5, 0, 1, 5, 2, 8 }, -- Controller 1 Center
{ 18, 0, 1, 4, 2, 9 }, -- Controller 2 L Grip
{ 27, 0, 1, 4, 2, 9 }, -- Controller 2 R Grip
{ 22, 0, 1, 5, 2, 8 }, -- Controller 2 Center
});
description = "Pony SlayStation 2";
tiles_off = { front=true; };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 2, 2, 11, 28, 3, 19 }, -- Console (Upper part)
{ 2, 0, 11, 26, 2, 19 }, -- Console (Lower part)
{ 1, 0, 1, 4, 2, 9 }, -- Controller 1 L Grip
{ 10, 0, 1, 4, 2, 9 }, -- Controller 1 R Grip
{ 5, 0, 1, 5, 2, 8 }, -- Controller 1 Center
{ 18, 0, 1, 4, 2, 9 }, -- Controller 2 L Grip
{ 27, 0, 1, 4, 2, 9 }, -- Controller 2 R Grip
{ 22, 0, 1, 5, 2, 8 }, -- Controller 2 Center
});
});
-- Sinclair ZX Spectrum lookalike
computer.register("computer:specter", {
description = "SX Specter";
tiles_off = { };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 3, 0, 0, 26, 4, 17 }, -- Keyboard
{ 18, 0, 18, 12, 6, 14 }, -- Tape Player
});
description = "SX Specter";
tiles_off = { };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 3, 0, 0, 26, 4, 17 }, -- Keyboard
{ 18, 0, 18, 12, 6, 14 }, -- Tape Player
});
});
-- Nintendo Wii lookalike.
-- Nintendo Wii lookalike
computer.register("computer:wee", {
description = "Nientiendo Wee";
tiles_off = { front=true; };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 11, 0, 3, 10, 6, 26 }, -- Base
{ 12, 6, 4, 8, 22, 24 }, -- Top
});
description = "Nientiendo Wee";
tiles_off = { front=true; };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 11, 0, 3, 10, 6, 26 }, -- Base
{ 12, 6, 4, 8, 22, 24 }, -- Top
});
});
-- Apple iPad lookalike.
-- Apple iPad lookalike
minetest.register_node("computer:piepad", {
description = "Snapple Piepad",
drawtype = "signlike",
tiles = {"computer_piepad_inv.png"},
inventory_image = "computer_piepad_inv.png",
wield_image = "computer_piepad_inv.png",
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "wallmounted",
light_source = 10,
walkable = false,
groups = { snappy=3, cracky=3, choppy=3, oddly_breakable_by_hand=3},
selection_box = {type = "wallmounted"},
sounds = default.node_sound_wood_defaults()
description = "Snapple Piepad",
drawtype = "signlike",
tiles = {"computer_piepad_inv.png"},
inventory_image = "computer_piepad_inv.png",
wield_image = "computer_piepad_inv.png",
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "wallmounted",
light_source = 10,
walkable = false,
groups = { snappy=3, cracky=3, choppy=3, oddly_breakable_by_hand=3},
selection_box = {type = "wallmounted"},
sounds = default.node_sound_wood_defaults()
})
-- Commodore 64 lookalike
computer.register("computer:admiral64", {
description = "Admiral64";
tiles_off = { };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 0, 0, 0, 32, 4, 18 }, -- Keyboard
});
description = "Admiral64";
tiles_off = { };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 0, 0, 0, 32, 4, 18 }, -- Keyboard
});
});
-- Commodore 128 lookalike
computer.register("computer:admiral128", {
description = "Admiral128";
tiles_off = { };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 0, 0, 0, 32, 4, 27 }, -- Keyboard
});
description = "Admiral128";
tiles_off = { };
node_box = computer.pixelnodebox(32, {
-- X Y Z W H L
{ 0, 0, 0, 32, 4, 27 }, -- Keyboard
});
});
---------------------------------------------------------------------------------
----------------------------added by crazyginger72-------------------------------
---------------------------------------------------------------------------------
-- Generic Flat Screen LCD (16x9) with keyboard
minetest.register_node("computer:monitor_on", {
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 =
"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
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,36 +148,25 @@ 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' ,
drop = 'computer:monitor',
on_rightclick = function ( pos, node, clicker, itemstack)
node.name = "computer:monitor";
minetest.set_node(pos, node);
nodeupdate(pos)
node.name = "computer:monitor";
minetest.set_node(pos, node);
nodeupdate(pos)
end
})
minetest.register_node("computer:monitor_bios", {
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' ,
drop = 'computer:monitor',
})
minetest.register_node("computer:monitor_loading", {
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' ,
drop = 'computer:monitor',
})
minetest.register_node("computer:monitor_login", {
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' ,
drop = 'computer:monitor',
})
minetest.register_node("computer:monitor_desktop", {
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' ,
drop = 'computer:monitor',
})
minetest.register_node("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)
node.name = "computer:monitor_on";
minetest.set_node(pos, node);
nodeupdate(pos)
end
})
--WIFI Router (linksys look-a-like)
minetest.register_node("computer:router", {
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", {
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",
@ -430,25 +339,24 @@ computer.register("computer:admiral128", {
{-0.1875, -0.5, -0.3125, 0.1875, 0.3125, 0.4375},
},
},
drop = 'computer:tower' ,
drop = 'computer:tower',
on_rightclick = function ( pos, node, clicker, itemstack)
node.name = "computer:tower";
minetest.set_node(pos, node);
nodeupdate(pos)
end
node.name = "computer:tower";
minetest.set_node(pos, node);
nodeupdate(pos)
end
})
minetest.register_node("computer:tower", {
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",
@ -465,24 +373,23 @@ computer.register("computer:admiral128", {
},
},
on_rightclick = function ( pos, node, clicker, itemstack)
node.name = "computer:tower_on";
minetest.set_node(pos, node);
nodeupdate(pos)
end
node.name = "computer:tower_on";
minetest.set_node(pos, node);
nodeupdate(pos)
end
})
-- 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,104 +404,80 @@ 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",
tiles = {
'computer_server_t.png',
'computer_server_bt.png',
'computer_server_l.png',
'computer_server_r.png',
'computer_server_bt.png',
'computer_server_f_off.png'
},
inventory_image = "computer_server_inv.png",
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
groups = { snappy = 3 },
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
},
node_box = {
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";
minetest.set_node(pos, node);
nodeupdate(pos)
end,
on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.above
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then
minetest.chat_send_player( placer:get_player_name(), "Not enough vertical space to place a server!" )
return
end
return minetest.item_place(itemstack, placer, pointed_thing)
end,
drawtype = "nodebox",
description = "Rack Server",
tiles = {
'computer_server_t.png',
'computer_server_bt.png',
'computer_server_l.png',
'computer_server_r.png',
'computer_server_bt.png',
'computer_server_f_off.png'
},
inventory_image = "computer_server_inv.png",
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
groups = {snappy=3},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
},
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
},
sounds = default.node_sound_wood_defaults(),
on_rightclick = function ( pos, node, clicker, itemstack)
node.name = "computer:server_on";
minetest.set_node(pos, node);
nodeupdate(pos)
end,
on_place = function(itemstack, placer, pointed_thing)
local pos = pointed_thing.above
if minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}).name ~= "air" then
minetest.chat_send_player( placer:get_player_name(), "Not enough vertical space to place a server!" )
return
end
return minetest.item_place(itemstack, placer, pointed_thing)
end
})
minetest.register_node("computer:server_on", {
drawtype = "nodebox",
description = "Rack Server",
tiles = {
'computer_server_t.png',
'computer_server_bt.png',
'computer_server_r.png',
'computer_server_l.png',
'computer_server_bt.png',
'computer_server_f_on.png',
},
inventory_image = "computer_server_inv.png",
sunlight_propagates = false,
paramtype = "light",
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},
},
node_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.25, 0.5, 1.125, 0.4375},
},
sounds = default.node_sound_wood_defaults(),
drawtype = "nodebox",
description = "Rack Server",
tiles = {
'computer_server_t.png',
'computer_server_bt.png',
'computer_server_r.png',
'computer_server_l.png',
'computer_server_bt.png',
'computer_server_f_on.png',
},
inventory_image = "computer_server_inv.png",
sunlight_propagates = false,
paramtype = "light",
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},
},
node_box = {
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 ,
node.name = "computer:server";
minetest.set_node(pos, node);
nodeupdate(pos)
end
})

View File

@ -2,99 +2,99 @@
computer = { };
computer.register = function ( name, def )
local nodename = name;
if (name:sub(1, 1) == ":") then name = name:sub(2); end
local modname, basename = name:match("^([^:]+):(.*)");
local TEXPFX = modname.."_"..basename.."_";
local ONSTATE = modname..":"..basename;
local OFFSTATE = modname..":"..basename.."_off";
local def = def;
minetest.register_node(ONSTATE, {
drawtype = "nodebox";
paramtype = "light";
paramtype2 = "facedir";
description = def.description;
groups = { snappy=2, choppy=2, oddly_breakable_by_hand=2 };
tiles = {
TEXPFX.."tp.png",
TEXPFX.."bt.png",
TEXPFX.."rt.png",
TEXPFX.."lt.png",
TEXPFX.."bk.png",
TEXPFX.."ft.png",
};
node_box = def.node_box;
selection_box = def.node_box;
on_rightclick = function ( pos, node, clicker, itemstack)
if (def.on_turn_off) then
if (def.on_turn_off(pos, node, clicker, itemstack)) then return; end
end
node.name = OFFSTATE;
minetest.set_node(pos, node);
nodeupdate(pos);
end;
});
minetest.register_node(OFFSTATE, {
drawtype = "nodebox";
paramtype = "light";
paramtype2 = "facedir";
groups = { snappy=2, choppy=2, oddly_breakable_by_hand=2,
not_in_creative_inventory=1 };
tiles = {
(TEXPFX.."tp"..(def.tiles_off.top and "_off" or "")..".png"),
(TEXPFX.."bt"..(def.tiles_off.bottom and "_off" or "")..".png"),
(TEXPFX.."rt"..(def.tiles_off.right and "_off" or "")..".png"),
(TEXPFX.."lt"..(def.tiles_off.left and "_off" or "")..".png"),
(TEXPFX.."bk"..(def.tiles_off.back and "_off" or "")..".png"),
(TEXPFX.."ft"..(def.tiles_off.front and "_off" or "")..".png"),
};
node_box = def.node_box_off or def.node_box;
selection_box = def.node_box_off or def.node_box;
on_rightclick = function ( pos, node, clicker, itemstack)
if (def.on_turn_on) then
if (def.on_turn_on(pos, node, clicker, itemstack)) then return; end
end
node.name = ONSTATE;
minetest.set_node(pos, node);
nodeupdate(pos);
end;
drop = ONSTATE;
});
local nodename = name;
if (name:sub(1, 1) == ":") then name = name:sub(2); end
local modname, basename = name:match("^([^:]+):(.*)");
local TEXPFX = modname.."_"..basename.."_";
local ONSTATE = modname..":"..basename;
local OFFSTATE = modname..":"..basename.."_off";
local def = def;
minetest.register_node(ONSTATE, {
drawtype = "nodebox";
paramtype = "light";
paramtype2 = "facedir";
description = def.description;
groups = { snappy=2, choppy=2, oddly_breakable_by_hand=2 };
tiles = {
TEXPFX.."tp.png",
TEXPFX.."bt.png",
TEXPFX.."rt.png",
TEXPFX.."lt.png",
TEXPFX.."bk.png",
TEXPFX.."ft.png",
};
node_box = def.node_box;
selection_box = def.node_box;
on_rightclick = function ( pos, node, clicker, itemstack)
if (def.on_turn_off) then
if (def.on_turn_off(pos, node, clicker, itemstack)) then return; end
end
node.name = OFFSTATE;
minetest.set_node(pos, node);
nodeupdate(pos);
end;
});
minetest.register_node(OFFSTATE, {
drawtype = "nodebox";
paramtype = "light";
paramtype2 = "facedir";
groups = { snappy=2, choppy=2, oddly_breakable_by_hand=2,
not_in_creative_inventory=1 };
tiles = {
(TEXPFX.."tp"..(def.tiles_off.top and "_off" or "")..".png"),
(TEXPFX.."bt"..(def.tiles_off.bottom and "_off" or "")..".png"),
(TEXPFX.."rt"..(def.tiles_off.right and "_off" or "")..".png"),
(TEXPFX.."lt"..(def.tiles_off.left and "_off" or "")..".png"),
(TEXPFX.."bk"..(def.tiles_off.back and "_off" or "")..".png"),
(TEXPFX.."ft"..(def.tiles_off.front and "_off" or "")..".png"),
};
node_box = def.node_box_off or def.node_box;
selection_box = def.node_box_off or def.node_box;
on_rightclick = function ( pos, node, clicker, itemstack)
if (def.on_turn_on) then
if (def.on_turn_on(pos, node, clicker, itemstack)) then return; end
end
node.name = ONSTATE;
minetest.set_node(pos, node);
nodeupdate(pos);
end;
drop = ONSTATE;
});
end
computer.register_handheld = function ( name, def )
local nodename = name;
if (name:sub(1, 1) == ":") then name = name:sub(2); end
local modname, basename = name:match("^([^:]+):(.*)");
local TEXPFX = modname.."_"..basename.."_inv";
local ONSTATE = modname..":"..basename;
local OFFSTATE = modname..":"..basename.."_off";
local on_use = def.on_use;
minetest.register_craftitem(ONSTATE, {
description = def.description;
inventory_image = TEXPFX..".png";
wield_image = TEXPFX..".png";
});
local nodename = name;
if (name:sub(1, 1) == ":") then name = name:sub(2); end
local modname, basename = name:match("^([^:]+):(.*)");
local TEXPFX = modname.."_"..basename.."_inv";
local ONSTATE = modname..":"..basename;
local OFFSTATE = modname..":"..basename.."_off";
local on_use = def.on_use;
minetest.register_craftitem(ONSTATE, {
description = def.description;
inventory_image = TEXPFX..".png";
wield_image = TEXPFX..".png";
});
end
computer.pixelnodebox = function ( size, boxes )
local fixed = { };
local i, box;
for i, box in ipairs(boxes) do
local x, y, z, w, h, l = unpack(box);
fixed[#fixed + 1] = {
(x / size) - 0.5,
(y / size) - 0.5,
(z / size) - 0.5,
((x + w) / size) - 0.5,
((y + h) / size) - 0.5,
((z + l) / size) - 0.5,
};
end
return {
type = "fixed";
fixed = fixed;
};
local fixed = { };
local i, box;
for i, box in ipairs(boxes) do
local x, y, z, w, h, l = unpack(box);
fixed[#fixed + 1] = {
(x / size) - 0.5,
(y / size) - 0.5,
(z / size) - 0.5,
((x + w) / size) - 0.5,
((y + h) / size) - 0.5,
((z + l) / size) - 0.5,
};
end
return {
type = "fixed";
fixed = fixed;
};
end
local MODPATH = minetest.get_modpath("computer");

View File

@ -14,63 +14,63 @@ end
if (not minetest.get_modpath("homedecor")) then
minetest.register_craftitem(":homedecor:plastic_sheeting", {
description = S("Plastic sheet"),
inventory_image = "homedecor_plastic_sheeting.png",
})
minetest.register_craftitem(":homedecor:plastic_sheeting", {
description = S("Plastic sheet"),
inventory_image = "homedecor_plastic_sheeting.png",
})
minetest.register_craftitem(":homedecor:plastic_base", {
description = S("Unprocessed Plastic base"),
wield_image = "homedecor_plastic_base.png",
inventory_image = "homedecor_plastic_base_inv.png",
})
minetest.register_craftitem(":homedecor:plastic_base", {
description = S("Unprocessed Plastic base"),
wield_image = "homedecor_plastic_base.png",
inventory_image = "homedecor_plastic_base_inv.png",
})
minetest.register_craft({
type = "shapeless",
output = 'homedecor:plastic_base 6',
recipe = { "default:junglegrass",
"default:junglegrass",
"default:junglegrass"
}
})
minetest.register_craft({
type = "shapeless",
output = 'homedecor:plastic_base 6',
recipe = { "default:junglegrass",
"default:junglegrass",
"default:junglegrass"
}
})
minetest.register_craft({
type = "shapeless",
output = 'homedecor:plastic_base 3',
recipe = { "default:dry_shrub",
"default:dry_shrub",
"default:dry_shrub"
},
})
minetest.register_craft({
type = "shapeless",
output = 'homedecor:plastic_base 3',
recipe = { "default:dry_shrub",
"default:dry_shrub",
"default:dry_shrub"
},
})
minetest.register_craft({
type = "shapeless",
output = 'homedecor:plastic_base 4',
recipe = { "default:leaves",
"default:leaves",
"default:leaves",
"default:leaves",
"default:leaves",
"default:leaves"
}
})
minetest.register_craft({
type = "shapeless",
output = 'homedecor:plastic_base 4',
recipe = { "default:leaves",
"default:leaves",
"default:leaves",
"default:leaves",
"default:leaves",
"default:leaves"
}
})
minetest.register_craft({
type = "cooking",
output = "homedecor:plastic_sheeting",
recipe = "homedecor:plastic_base",
})
minetest.register_craft({
type = "cooking",
output = "homedecor:plastic_sheeting",
recipe = "homedecor:plastic_base",
})
minetest.register_craft({
type = 'fuel',
recipe = 'homedecor:plastic_base',
burntime = 30,
})
minetest.register_craft({
type = 'fuel',
recipe = 'homedecor:plastic_base',
burntime = 30,
})
minetest.register_craft({
type = 'fuel',
recipe = 'homedecor:plastic_sheeting',
burntime = 30,
})
minetest.register_craft({
type = 'fuel',
recipe = 'homedecor:plastic_sheeting',
burntime = 30,
})
end -- not homedecor

View File

@ -3,132 +3,132 @@
-- License is WTFPL (see README.txt).
minetest.register_craft({
output = "computer:shefriendSOO";
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:glass", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:wood", "homedecor:plastic_sheeting", },
};
output = "computer:shefriendSOO";
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:glass", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:wood", "homedecor:plastic_sheeting", },
};
});
minetest.register_craft({
output = "computer:slaystation";
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:wood", "homedecor:plastic_sheeting", },
};
output = "computer:slaystation";
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:wood", "homedecor:plastic_sheeting", },
};
});
minetest.register_craft({
output = "computer:vanio";
recipe = {
{ "homedecor:plastic_sheeting", "", "", },
{ "default:glass", "", "" },
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
};
output = "computer:vanio";
recipe = {
{ "homedecor:plastic_sheeting", "", "", },
{ "default:glass", "", "" },
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
};
});
minetest.register_craft({
output = "computer:specter";
recipe = {
{ "", "", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
};
output = "computer:specter";
recipe = {
{ "", "", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
};
});
minetest.register_craft({
output = "computer:slaystation2";
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting", },
};
output = "computer:slaystation2";
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting", },
};
});
minetest.register_craft({
output = "computer:admiral64";
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "default:wood", "default:wood", "default:wood", },
};
output = "computer:admiral64";
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "default:wood", "default:wood", "default:wood", },
};
});
minetest.register_craft({
output = "computer:admiral128";
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot", },
};
output = "computer:admiral128";
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "default:steel_ingot", "default:steel_ingot", "default:steel_ingot", },
};
});
minetest.register_craft({
output = "computer:wee";
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:copper_ingot", "homedecor:plastic_sheeting", },
};
output = "computer:wee";
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:copper_ingot", "homedecor:plastic_sheeting", },
};
});
minetest.register_craft({
output = "computer:piepad";
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:glass", "homedecor:plastic_sheeting", },
};
output = "computer:piepad";
recipe = {
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:glass", "homedecor:plastic_sheeting", },
};
});
--new stuff
minetest.register_craft({
output = "computer:monitor";
recipe = {
{ "homedecor:plastic_sheeting", "default:glass","", },
{ "homedecor:plastic_sheeting", "default:glass","", },
{ "homedecor:plastic_sheeting", "default:mese_crystal_fragment", "homedecor:plastic_sheeting", },
};
output = "computer:monitor";
recipe = {
{ "homedecor:plastic_sheeting", "default:glass","", },
{ "homedecor:plastic_sheeting", "default:glass","", },
{ "homedecor:plastic_sheeting", "default:mese_crystal_fragment", "homedecor:plastic_sheeting", },
};
});
minetest.register_craft({
output = "computer:router";
recipe = {
{ "default:steel_ingot","","", },
{ "default:steel_ingot" ,"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "default:mese_crystal_fragment","homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
};
output = "computer:router";
recipe = {
{ "default:steel_ingot","","", },
{ "default:steel_ingot" ,"homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
{ "default:mese_crystal_fragment","homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
};
});
minetest.register_craft({
output = "computer:tower";
recipe = {
{ "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:mese_crystal", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting", },
};
output = "computer:tower";
recipe = {
{ "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:mese_crystal", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:steel_ingot", "homedecor:plastic_sheeting", },
};
});
minetest.register_craft({
output = "computer:printer";
recipe = {
{ "homedecor:plastic_sheeting", "default:steel_ingot","", },
{ "homedecor:plastic_sheeting", "default:mese_crystal", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:coal_lump", "homedecor:plastic_sheeting", },
};
output = "computer:printer";
recipe = {
{ "homedecor:plastic_sheeting", "default:steel_ingot","", },
{ "homedecor:plastic_sheeting", "default:mese_crystal", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "default:coal_lump", "homedecor:plastic_sheeting", },
};
});
minetest.register_craft({
output = "computer:printer";
recipe = {
{ "homedecor:plastic_sheeting", "default:steel_ingot","", },
{ "homedecor:plastic_sheeting", "default:mese_crystal", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "dye:black", "homedecor:plastic_sheeting", },
};
output = "computer:printer";
recipe = {
{ "homedecor:plastic_sheeting", "default:steel_ingot","", },
{ "homedecor:plastic_sheeting", "default:mese_crystal", "homedecor:plastic_sheeting", },
{ "homedecor:plastic_sheeting", "dye:black", "homedecor:plastic_sheeting", },
};
});
minetest.register_craft({
output = "computer:server";
recipe = {
{ "computer:tower", "computer:tower", "computer:tower", },
{ "computer:tower", "computer:tower", "computer:tower", },
{ "computer:tower", "computer:tower", "computer:tower", },
};
output = "computer:server";
recipe = {
{ "computer:tower", "computer:tower", "computer:tower", },
{ "computer:tower", "computer:tower", "computer:tower", },
{ "computer:tower", "computer:tower", "computer:tower", },
};
});

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", {
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,
-- 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.
sunlight_propagates = true,
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
--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)
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,})
-- This swaps the smoky version with the smokeless version. ~ LazyJ
minetest.set_node(pos, {name = "fake_fire:smokeless_fire"})
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
-- SMOKELESS FIRE (DOES NOT TRIGGER SMOKE ABM)
minetest.register_node("fake_fire:smokeless_fire", {
description = "Smokeless, Fake Fire",
-- 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 = {
},
swap_on_punch = "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}},
},
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
},
inventory_image = 'fake_fire.png',
swap_on_punch = "fake_fire:fake_fire",
})
-- SMOKEY ICE FIRE (TRIGGERS SMOKE ABM)
minetest.register_node("fake_fire:ice_fire", {
description = "Smoky, Fake, 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", {
description = "Smokeless, Fake, 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,60 +69,27 @@ 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",
selection_box = {
type = "fixed",
fixed = {-0.3125, -0.1875, 0.3125, 0.3125, 0.5, 0.5}
},
node_box = {
},
node_box = {
type = "fixed",
fixed = {-0.3125, -0.1875, 0.3125, 0.3125, 0.5, 0.5}
},
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 },
visual = "mesh",
collisionbox = homedecor.nodebox.null,
visual = "mesh",
mesh = "homedecor_desk_fan.b3d",
textures = {"homedecor_desk_fan_uv.png"},
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,14 +153,11 @@ 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},
groups = {snappy=3},
node_box = {
type = "fixed",
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

@ -8,19 +8,16 @@ minetest.register_node("homedecor:cobweb_corner", {
paramtype2 = "wallmounted",
sunlight_propagates = true,
liquid_viscosity = 8,
liquidtype = "source",
liquid_alternative_flowing = "homedecor:cobweb_corner",
liquid_alternative_source = "homedecor:cobweb_corner",
liquid_renewable = false,
liquid_range = 0,
liquidtype = "source",
liquid_alternative_flowing = "homedecor:cobweb_corner",
liquid_alternative_source = "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)
after_place_node = function(pos, placer, itemstack, pointed_thing)
homedecor.rotate_cobweb(pos)
end
})
@ -34,11 +31,11 @@ minetest.register_node("homedecor:cobweb_centered", {
paramtype2 = "facedir",
sunlight_propagates = true,
liquid_viscosity = 8,
liquidtype = "source",
liquid_alternative_flowing = "homedecor:cobweb_centered",
liquid_alternative_source = "homedecor:cobweb_centered",
liquid_renewable = false,
liquid_range = 0,
liquidtype = "source",
liquid_alternative_flowing = "homedecor:cobweb_centered",
liquid_alternative_source = "homedecor:cobweb_centered",
liquid_renewable = false,
liquid_range = 0,
walkable = false,
selection_box = {
type = "fixed",
@ -61,11 +58,11 @@ minetest.register_node("homedecor:cobweb_flat", {
paramtype2 = "facedir",
sunlight_propagates = true,
liquid_viscosity = 8,
liquidtype = "source",
liquid_alternative_flowing = "homedecor:cobweb_flat",
liquid_alternative_source = "homedecor:cobweb_flat",
liquid_renewable = false,
liquid_range = 0,
liquidtype = "source",
liquid_alternative_flowing = "homedecor:cobweb_flat",
liquid_alternative_source = "homedecor:cobweb_flat",
liquid_renewable = false,
liquid_range = 0,
walkable = false,
selection_box = {
type = "fixed",
@ -88,16 +85,13 @@ minetest.register_node("homedecor:cobweb_plantlike", {
paramtype2 = "facedir",
sunlight_propagates = true,
liquid_viscosity = 8,
liquidtype = "source",
liquid_alternative_flowing = "homedecor:cobweb_plantlike",
liquid_alternative_source = "homedecor:cobweb_plantlike",
liquid_renewable = false,
liquid_range = 0,
liquidtype = "source",
liquid_alternative_flowing = "homedecor:cobweb_plantlike",
liquid_alternative_source = "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',
@ -29,24 +24,19 @@ minetest.register_node('homedecor:speaker_small', {
'homedecor_speaker_back.png',
'homedecor_speaker_front.png'
},
selection_box = {
type = "fixed",
fixed = { -0.2, -0.5, 0, 0.2, 0, 0.4 }
},
node_box = {
type = "fixed",
fixed = { -0.2, -0.5, 0, 0.2, 0, 0.4 }
},
sunlight_propagates = false,
paramtype = "light",
paramtype2 = "facedir",
walkable = true,
selection_box = {
type = "fixed",
fixed = { -0.2, -0.5, 0, 0.2, 0, 0.4 }
},
node_box = {
type = "fixed",
fixed = { -0.2, -0.5, 0, 0.2, 0, 0.4 }
},
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',
@ -93,21 +77,16 @@ minetest.register_node('homedecor:television', {
aspect_w=16,
aspect_h=16,
length=80.0
}
}
}
},
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,17 +118,14 @@ minetest.register_node("homedecor:telephone", {
},
inventory_image = "homedecor_telephone_inv.png",
description = "Telephone",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
groups = {snappy=3},
node_box = {
type = "fixed",
fixed = {
{-0.1875, -0.5, -0.1875, 0.1875, -0.4375, 0.15}, -- NodeBox1
{-0.125, -0.5, -0.130, 0.125, -0.3675, 0.15}, -- NodeBox2
{-0.175, -0.4375, -0.175, 0.175, -0.42, 0.15}, -- NodeBox3
{-0.16, -0.42, -0.16, 0.16, -0.4025, 0.15}, -- NodeBox4
{-0.16, -0.42, -0.16, 0.16, -0.4025, 0.15}, -- NodeBox4
{-0.145, -0.4025, -0.145, 0.145, -0.385, 0.15}, -- NodeBox5
{-0.11, -0.385, -0.115, 0.11, -0.35, 0.15}, -- NodeBox6
{-0.095, -0.5, -0.1, 0.095, -0.3325, 0.15}, -- NodeBox7
@ -168,6 +142,6 @@ minetest.register_node("homedecor:telephone", {
selection_box = {
type = "fixed",
fixed = { -0.25, -0.5, -0.1875, 0.25, -0.21, 0.15 }
}
}
})

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,10 +88,9 @@ minetest.register_node("homedecor:fence_wrought_iron_with_sign", {
-- other types of fences
minetest.register_node("homedecor:fence_picket", {
drawtype = "nodebox",
description = S("Unpainted Picket Fence"),
tiles = {
homedecor.register("fence_picket", {
description = S("Unpainted Picket Fence"),
tiles = {
"homedecor_blanktile.png",
"homedecor_blanktile.png",
"homedecor_fence_picket.png",
@ -117,24 +98,19 @@ 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 }
},
node_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.498, 0.5, 0.5, 0.498 }
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.4, 0.5, 0.5, 0.5 }
},
node_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.498, 0.5, 0.5, 0.498 }
},
})
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,10 +138,9 @@ minetest.register_node("homedecor:fence_picket_corner", {
},
})
minetest.register_node("homedecor:fence_picket_white", {
drawtype = "nodebox",
description = S("White Picket Fence"),
tiles = {
homedecor.register("fence_picket_white", {
description = S("White Picket Fence"),
tiles = {
"homedecor_blanktile.png",
"homedecor_blanktile.png",
"homedecor_fence_picket_white.png",
@ -177,24 +148,19 @@ 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 }
},
node_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.498, 0.5, 0.5, 0.498 }
},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.4, 0.5, 0.5, 0.5 }
},
node_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.498, 0.5, 0.5, 0.498 }
},
})
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,10 +188,9 @@ minetest.register_node("homedecor:fence_picket_corner_white", {
},
})
minetest.register_node("homedecor:fence_privacy", {
drawtype = "nodebox",
description = S("Wooden Privacy Fence"),
tiles = {
homedecor.register("fence_privacy", {
description = S("Wooden Privacy Fence"),
tiles = {
"homedecor_fence_privacy_tb.png",
"homedecor_fence_privacy_tb.png",
"homedecor_fence_privacy_sides.png",
@ -237,31 +198,26 @@ 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 }
},
node_box = {
type = "fixed",
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 5/16, 0.5, 0.5, 8/16 }
},
node_box = {
type = "fixed",
fixed = {
{ -8/16, -8/16, 5/16, -5/16, 8/16, 7/16 }, -- left part
{ -4/16, -8/16, 5/16, 3/16, 8/16, 7/16 }, -- middle part
{ 4/16, -8/16, 5/16, 8/16, 8/16, 7/16 }, -- right part
{ -8/16, -2/16, 7/16, 8/16, 2/16, 8/16 }, -- connecting rung
}
},
},
})
minetest.register_node("homedecor:fence_privacy_corner", {
drawtype = "nodebox",
description = S("Wooden Privacy Fence Corner"),
tiles = {
homedecor.register("fence_privacy_corner", {
description = S("Wooden Privacy Fence Corner"),
tiles = {
"homedecor_fence_privacy_corner_top.png",
"homedecor_fence_privacy_corner_bottom.png",
"homedecor_fence_privacy_corner_right.png",
@ -269,21 +225,17 @@ 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 = {
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
fixed = {
{ -0.5, -0.5, 5/16, 0.5, 0.5, 0.5 },
{ -0.5, -0.5, -0.5, -5/16, 0.5, 5/16 },
}
},
node_box = {
type = "fixed",
},
node_box = {
type = "fixed",
fixed = {
{ -7/16, -8/16, 5/16, -5/16, 8/16, 7/16 }, -- left part
{ -4/16, -8/16, 5/16, 3/16, 8/16, 7/16 }, -- middle part
@ -295,54 +247,44 @@ minetest.register_node("homedecor:fence_privacy_corner", {
{ -7/16, -8/16, -8/16, -5/16, 8/16, -5/16 }, -- front-most part
{ -8/16, -2/16, -8/16, -7/16, 2/16, 7/16 }, -- left-side connecting rung
}
},
},
})
minetest.register_node("homedecor:fence_barbed_wire", {
drawtype = "nodebox",
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 }
},
node_box = {
type = "fixed",
homedecor.register("fence_barbed_wire", {
description = S("Barbed Wire Fence"),
tiles = {"homedecor_fence_barbed_wire.png"},
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.375, 0.5, 0.5, 0.5 }
},
node_box = {
type = "fixed",
fixed = {
{ -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, -- left post
{ 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post
{ -6/16, -8/16, 7/16, 6/16, 8/16, 7/16 } -- the wire
}
},
},
})
minetest.register_node("homedecor:fence_barbed_wire_corner", {
drawtype = "nodebox",
description = S("Barbed Wire Fence Corner"),
tiles = {
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 = {
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
fixed = {
{ -0.5, -0.5, 0.375, 0.5, 0.5, 0.5 },
{ -0.5, -0.5, -0.5, -0.375, 0.5, 0.375 }
{ -0.5, -0.5, -0.5, -0.375, 0.5, 0.375 }
}
},
node_box = {
type = "fixed",
},
node_box = {
type = "fixed",
fixed = {
{ -8/16, -8/16, 6/16, -6/16, 8/16, 8/16 }, -- left post
{ 6/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post
@ -351,13 +293,12 @@ minetest.register_node("homedecor:fence_barbed_wire_corner", {
{ -8/16, -8/16, -8/16, -6/16, 8/16, -6/16 }, -- front post
{ -7/16, -8/16, -6/16, -7/16, 8/16, 6/16 } -- more wire
}
},
},
})
minetest.register_node("homedecor:fence_chainlink", {
drawtype = "nodebox",
description = S("Chainlink Fence"),
tiles = {
homedecor.register("fence_chainlink", {
description = S("Chainlink Fence"),
tiles = {
"homedecor_fence_chainlink_tb.png",
"homedecor_fence_chainlink_tb.png",
"homedecor_fence_chainlink_sides.png",
@ -365,18 +306,14 @@ 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 }
},
node_box = {
type = "fixed",
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.375, 0.5, 0.5, 0.5 }
},
node_box = {
type = "fixed",
fixed = {
{ -8/16, -8/16, 6/16, -7/16, 8/16, 8/16 }, -- left post
{ 7/16, -8/16, 6/16, 8/16, 8/16, 8/16 }, -- right post
@ -384,11 +321,10 @@ minetest.register_node("homedecor:fence_chainlink", {
{ -8/16, -8/16, 13/32, 8/16, -7/16, 15/32 }, -- bottom piece
{ -8/16, -8/16, 7/16, 8/16, 8/16, 7/16 } -- the chainlink itself
}
},
},
})
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,10 +359,9 @@ minetest.register_node("homedecor:fence_chainlink_corner", {
},
})
minetest.register_node("homedecor:fence_wrought_iron_2", {
drawtype = "nodebox",
description = S("Wrought Iron fence (type 2)"),
tiles = {
homedecor.register("fence_wrought_iron_2", {
description = S("Wrought Iron fence (type 2)"),
tiles = {
"homedecor_fence_wrought_iron_2_tb.png",
"homedecor_fence_wrought_iron_2_tb.png",
"homedecor_fence_wrought_iron_2_sides.png",
@ -438,18 +369,14 @@ 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 }
},
node_box = {
type = "fixed",
groups = {snappy=3},
sounds = default.node_sound_wood_defaults(),
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, 0.42, 0.5, 0.5, 0.5 }
},
node_box = {
type = "fixed",
fixed = {
{ -8/16, -8/16, 14/32, -7.75/16, 8/16, 16/32 }, -- left post
{ 7.75/16, -8/16, 14/32, 8/16, 8/16, 16/32 }, -- right post
@ -459,11 +386,10 @@ minetest.register_node("homedecor:fence_wrought_iron_2", {
{ -8/16, -8/16, 14/32, 8/16, -7.75/16, 16/32 }, -- bottom piece
{ -8/16, -8/16, 15/32, 8/16, 8/16, 15/32 } -- the grid itself
}
},
},
})
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,25 +13,22 @@ 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 = {
{ -0.4, -0.5, -0.4, -0.3, 0.4, -0.3 },
{ 0.3, -0.5, -0.4, 0.4, 0.4, -0.3 },
{ -0.4, -0.5, 0.3, -0.3, 0.4, 0.4 },
{ 0.3, -0.5, 0.3, 0.4, 0.4, 0.4 },
{ -0.5, 0.4, -0.5, 0.5, 0.5, 0.5 },
{ -0.4, -0.2, -0.3, -0.3, -0.1, 0.3 },
{ 0.3, -0.2, -0.4, 0.4, -0.1, 0.3 },
{ -0.3, -0.2, -0.4, 0.4, -0.1, -0.3 },
{ -0.3, -0.2, 0.3, 0.3, -0.1, 0.4 },
},
type = "fixed",
fixed = {
{ -0.4, -0.5, -0.4, -0.3, 0.4, -0.3 },
{ 0.3, -0.5, -0.4, 0.4, 0.4, -0.3 },
{ -0.4, -0.5, 0.3, -0.3, 0.4, 0.4 },
{ 0.3, -0.5, 0.3, 0.4, 0.4, 0.4 },
{ -0.5, 0.4, -0.5, 0.5, 0.5, 0.5 },
{ -0.4, -0.2, -0.3, -0.3, -0.1, 0.3 },
{ 0.3, -0.2, -0.4, 0.4, -0.1, 0.3 },
{ -0.3, -0.2, -0.4, 0.4, -0.1, -0.3 },
{ -0.3, -0.2, 0.3, 0.3, -0.1, 0.4 },
},
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
})
@ -65,38 +62,32 @@ for i in ipairs(chaircolors) do
chairtiles = { "forniture_wood.png" }
end
minetest.register_node("homedecor:chair"..color, {
description = S("Kitchen chair (%s)"):format(name),
homedecor.register("chair"..color, {
description = S("Kitchen chair (%s)"):format(name),
tiles = chairtiles,
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
type = "fixed",
fixed = {
{-0.3125, -0.5, 0.1875, -0.1875, 0.5, 0.3125},
{0.1875, -0.5, 0.1875, 0.3125, 0.5, 0.3125},
{-0.3125, -0.5, -0.3125, -0.1875, 0, -0.1875},
{0.1875, -0.5, -0.3125, 0.3125, 0, -0.1875},
{-0.3125, -0.125, -0.3125, 0.3125, 0, 0.3125},
{-0.25, 0.0625, 0.25, 0.25, 0.4375, 0.25},
},
},
},
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2},
})
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 }
@ -179,12 +170,12 @@ local function bed_extension(pos, color)
end
end
if string.find(bottomnode.name, "homedecor:bed_.*_foot$") then
if string.find(bottomnode.name, "homedecor:bed_.*_foot$") then
if fdir == bottomnode.param2 then
local newnode = string.gsub(bottomnode.name, "_foot", "_footext")
minetest.set_node({x=pos.x, y=pos.y-1.0, z=pos.z}, { name = newnode, param2 = fdir})
minetest.set_node({x=pos.x, y=pos.y-1.0, z=pos.z}, { name = newnode, param2 = fdir})
end
end
end
end
local function unextend_bed(pos, color)
@ -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,10 +315,7 @@ minetest.register_node("homedecor:wardrobe_bottom", {
},
inventory_image = "homedecor_wardrobe_inv.png",
description = "Wardrobe",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = {snappy=3},
groups = {snappy=3},
node_box = {
type = "fixed",
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,22 +346,18 @@ 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},
groups = {snappy=3},
node_box = {
type = "fixed",
fixed = {
{-0.5, -0.15, 0, 0.5, -0.05, 0.4},
{-0.4, -0.5, 0.1, -0.3, -0.15, 0.3},
{ 0.3, -0.5, 0.1, 0.4, -0.15, 0.3},
}
{-0.5, -0.15, 0, 0.5, -0.05, 0.4},
{-0.4, -0.5, 0.1, -0.3, -0.15, 0.3},
{ 0.3, -0.5, 0.1, 0.4, -0.15, 0.3},
}
},
})
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,10 +497,7 @@ 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 },
groups = { snappy = 3, not_in_creative_inventory = 1 },
node_box = {
type = "fixed",
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,10 +530,7 @@ minetest.register_node("homedecor:deckchair_foot", {
},
description = "Deck chair",
inventory_image = "homedecor_deckchair_inv.png",
drawtype = "nodebox",
paramtype = "light",
paramtype2 = "facedir",
groups = { snappy = 3 },
groups = { snappy = 3 },
node_box = {
type = "fixed",
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,162 +1,150 @@
local S = homedecor.gettext
minetest.register_node("homedecor:bars", {
description = S("Bars"),
tiles = { "forniture_black_metal.png" },
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{ -0.5, -0.50, -0.10, -0.4, 0.50, 0.10 },
{ -0.1, -0.50, -0.10, 0.1, 0.50, 0.10 },
{ 0.4, -0.50, -0.10, 0.5, 0.50, 0.10 },
{ -0.5, -0.50, -0.05, 0.5, -0.45, 0.05 },
{ -0.5, 0.45, -0.05, 0.5, 0.50, 0.05 },
},
},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.1, 0.5, 0.5, 0.1 },
},
groups = {cracky=1},
homedecor.register("bars", {
description = S("Bars"),
tiles = { "forniture_black_metal.png" },
sunlight_propagates = true,
node_box = {
type = "fixed",
fixed = {
{ -0.5, -0.50, -0.10, -0.4, 0.50, 0.10 },
{ -0.1, -0.50, -0.10, 0.1, 0.50, 0.10 },
{ 0.4, -0.50, -0.10, 0.5, 0.50, 0.10 },
{ -0.5, -0.50, -0.05, 0.5, -0.45, 0.05 },
{ -0.5, 0.45, -0.05, 0.5, 0.50, 0.05 },
},
},
selection_box = {
type = "fixed",
fixed = { -0.5, -0.5, -0.1, 0.5, 0.5, 0.1 },
},
groups = {cracky=1},
})
--L Binding Bars
minetest.register_node("homedecor: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 = {
{ -0.10, -0.50, -0.50, 0.10, 0.50, -0.40 },
{ -0.15, -0.50, -0.15, 0.15, 0.50, 0.15 },
{ 0.40, -0.50, -0.10, 0.50, 0.50, 0.10 },
{ 0.00, -0.50, -0.05, 0.50, -0.45, 0.05 },
{ -0.05, -0.50, -0.50, 0.05, -0.45, 0.00 },
{ 0.00, 0.45, -0.05, 0.50, 0.50, 0.05 },
{ -0.05, 0.45, -0.50, 0.05, 0.50, 0.00 },
},
},
groups = {cracky=1,}
homedecor.register("L_binding_bars", {
description = S("Binding Bars"),
tiles = { "forniture_black_metal.png" },
sunlight_propagates = true,
node_box = {
type = "fixed",
fixed = {
{ -0.10, -0.50, -0.50, 0.10, 0.50, -0.40 },
{ -0.15, -0.50, -0.15, 0.15, 0.50, 0.15 },
{ 0.40, -0.50, -0.10, 0.50, 0.50, 0.10 },
{ 0.00, -0.50, -0.05, 0.50, -0.45, 0.05 },
{ -0.05, -0.50, -0.50, 0.05, -0.45, 0.00 },
{ 0.00, 0.45, -0.05, 0.50, 0.50, 0.05 },
{ -0.05, 0.45, -0.50, 0.05, 0.50, 0.00 },
},
},
groups = {cracky=1,}
})
minetest.register_node("homedecor: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 = {
{ -0.45, 0.25, 0.45, -0.20, 0.50, 0.50, },
{ -0.35, 0.40, 0.35, -0.30, 0.45, 0.45, },
{ -0.35, 0.30, 0.35, -0.30, 0.35, 0.45, },
{ -0.35, 0.35, 0.30, -0.30, 0.40, 0.35, },
{ -0.40, 0.35, 0.35, -0.25, 0.40, 0.40, },
{ -0.40, 0.15, 0.35, -0.25, 0.20, 0.40, },
{ -0.45, 0.20, 0.35, -0.40, 0.35, 0.40, },
{ -0.25, 0.20, 0.35, -0.20, 0.35, 0.40, },
{ -0.35, 0.20, 0.30, -0.30, 0.25, 0.45, },
{ -0.35, 0.00, 0.30, -0.30, 0.05, 0.45, },
{ -0.35, 0.05, 0.25, -0.30, 0.20, 0.30, },
{ -0.35, 0.05, 0.45, -0.30, 0.20, 0.50, },
{ -0.40, 0.05, 0.35, -0.25, 0.10, 0.40, },
{ -0.40, -0.15, 0.35, -0.25, -0.10, 0.40, },
{ -0.45, -0.10, 0.35, -0.40, 0.05, 0.40, },
{ -0.25, -0.10, 0.35, -0.20, 0.05, 0.40, },
{ -0.35, -0.10, 0.30, -0.30, -0.05, 0.45, },
{ -0.35, -0.30, 0.30, -0.30, -0.25, 0.45, },
{ -0.35, -0.25, 0.25, -0.30, -0.10, 0.30, },
{ -0.35, -0.25, 0.45, -0.30, -0.10, 0.50, },
{ -0.40, -0.25, 0.35, -0.25, -0.20, 0.40, },
{ -0.40, -0.45, 0.35, -0.25, -0.40, 0.40, },
{ -0.45, -0.40, 0.35, -0.40, -0.25, 0.40, },
{ -0.25, -0.40, 0.35, -0.20, -0.25, 0.40, },
{ 0.20, 0.25, 0.45, 0.45, 0.50, 0.50, },
{ 0.30, 0.40, 0.35, 0.35, 0.45, 0.45, },
{ 0.30, 0.30, 0.35, 0.35, 0.35, 0.45, },
{ 0.30, 0.35, 0.30, 0.35, 0.40, 0.35, },
{ 0.25, 0.35, 0.35, 0.40, 0.40, 0.40, },
{ 0.25, 0.15, 0.35, 0.40, 0.20, 0.40, },
{ 0.20, 0.20, 0.35, 0.25, 0.35, 0.40, },
{ 0.40, 0.20, 0.35, 0.45, 0.35, 0.40, },
{ 0.30, 0.20, 0.30, 0.35, 0.25, 0.45, },
{ 0.30, 0.00, 0.30, 0.35, 0.05, 0.45, },
{ 0.30, 0.05, 0.25, 0.35, 0.20, 0.30, },
{ 0.30, 0.05, 0.45, 0.35, 0.20, 0.50, },
{ 0.25, 0.05, 0.35, 0.40, 0.10, 0.40, },
{ 0.25, -0.15, 0.35, 0.40, -0.10, 0.40, },
{ 0.20, -0.10, 0.35, 0.25, 0.05, 0.40, },
{ 0.40, -0.10, 0.35, 0.45, 0.05, 0.40, },
{ 0.30, -0.10, 0.30, 0.35, -0.05, 0.45, },
{ 0.30, -0.30, 0.30, 0.35, -0.25, 0.45, },
{ 0.30, -0.25, 0.25, 0.35, -0.10, 0.30, },
{ 0.30, -0.25, 0.45, 0.35, -0.10, 0.50, },
{ 0.25, -0.25, 0.35, 0.40, -0.20, 0.40, },
{ 0.25, -0.45, 0.35, 0.40, -0.40, 0.40, },
{ 0.20, -0.40, 0.35, 0.25, -0.25, 0.40, },
{ 0.40, -0.40, 0.35, 0.45, -0.25, 0.40, },
},
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, 1/4, 1/2, 1/2, 1/2},
},
groups = {cracky=1},
homedecor.register("chains", {
description = S("Chains"),
tiles = { "forniture_black_metal.png" },
inventory_image="3dforniture_inv_chains.png",
sunlight_propagates = true,
node_box = {
type = "fixed",
fixed = {
{ -0.45, 0.25, 0.45, -0.20, 0.50, 0.50, },
{ -0.35, 0.40, 0.35, -0.30, 0.45, 0.45, },
{ -0.35, 0.30, 0.35, -0.30, 0.35, 0.45, },
{ -0.35, 0.35, 0.30, -0.30, 0.40, 0.35, },
{ -0.40, 0.35, 0.35, -0.25, 0.40, 0.40, },
{ -0.40, 0.15, 0.35, -0.25, 0.20, 0.40, },
{ -0.45, 0.20, 0.35, -0.40, 0.35, 0.40, },
{ -0.25, 0.20, 0.35, -0.20, 0.35, 0.40, },
{ -0.35, 0.20, 0.30, -0.30, 0.25, 0.45, },
{ -0.35, 0.00, 0.30, -0.30, 0.05, 0.45, },
{ -0.35, 0.05, 0.25, -0.30, 0.20, 0.30, },
{ -0.35, 0.05, 0.45, -0.30, 0.20, 0.50, },
{ -0.40, 0.05, 0.35, -0.25, 0.10, 0.40, },
{ -0.40, -0.15, 0.35, -0.25, -0.10, 0.40, },
{ -0.45, -0.10, 0.35, -0.40, 0.05, 0.40, },
{ -0.25, -0.10, 0.35, -0.20, 0.05, 0.40, },
{ -0.35, -0.10, 0.30, -0.30, -0.05, 0.45, },
{ -0.35, -0.30, 0.30, -0.30, -0.25, 0.45, },
{ -0.35, -0.25, 0.25, -0.30, -0.10, 0.30, },
{ -0.35, -0.25, 0.45, -0.30, -0.10, 0.50, },
{ -0.40, -0.25, 0.35, -0.25, -0.20, 0.40, },
{ -0.40, -0.45, 0.35, -0.25, -0.40, 0.40, },
{ -0.45, -0.40, 0.35, -0.40, -0.25, 0.40, },
{ -0.25, -0.40, 0.35, -0.20, -0.25, 0.40, },
{ 0.20, 0.25, 0.45, 0.45, 0.50, 0.50, },
{ 0.30, 0.40, 0.35, 0.35, 0.45, 0.45, },
{ 0.30, 0.30, 0.35, 0.35, 0.35, 0.45, },
{ 0.30, 0.35, 0.30, 0.35, 0.40, 0.35, },
{ 0.25, 0.35, 0.35, 0.40, 0.40, 0.40, },
{ 0.25, 0.15, 0.35, 0.40, 0.20, 0.40, },
{ 0.20, 0.20, 0.35, 0.25, 0.35, 0.40, },
{ 0.40, 0.20, 0.35, 0.45, 0.35, 0.40, },
{ 0.30, 0.20, 0.30, 0.35, 0.25, 0.45, },
{ 0.30, 0.00, 0.30, 0.35, 0.05, 0.45, },
{ 0.30, 0.05, 0.25, 0.35, 0.20, 0.30, },
{ 0.30, 0.05, 0.45, 0.35, 0.20, 0.50, },
{ 0.25, 0.05, 0.35, 0.40, 0.10, 0.40, },
{ 0.25, -0.15, 0.35, 0.40, -0.10, 0.40, },
{ 0.20, -0.10, 0.35, 0.25, 0.05, 0.40, },
{ 0.40, -0.10, 0.35, 0.45, 0.05, 0.40, },
{ 0.30, -0.10, 0.30, 0.35, -0.05, 0.45, },
{ 0.30, -0.30, 0.30, 0.35, -0.25, 0.45, },
{ 0.30, -0.25, 0.25, 0.35, -0.10, 0.30, },
{ 0.30, -0.25, 0.45, 0.35, -0.10, 0.50, },
{ 0.25, -0.25, 0.35, 0.40, -0.20, 0.40, },
{ 0.25, -0.45, 0.35, 0.40, -0.40, 0.40, },
{ 0.20, -0.40, 0.35, 0.25, -0.25, 0.40, },
{ 0.40, -0.40, 0.35, 0.45, -0.25, 0.40, },
},
},
selection_box = {
type = "fixed",
fixed = {-1/2, -1/2, 1/4, 1/2, 1/2, 1/2},
},
groups = {cracky=1},
})
minetest.register_node("homedecor:torch_wall", {
description = S("Wall Torch"),
drawtype = "nodebox",
tiles = {
"forniture_torch_wall_s.png",
"forniture_torch_wall_i.png",
{
name="forniture_torch_wall_anim.png",
animation={
type="vertical_frames",
aspect_w=40,
aspect_h=40,
length=1.0,
},
},
},
inventory_image="3dforniture_inv_torch_wall.png",
paramtype = "light",
paramtype2 = "facedir",
node_box = {
type = "fixed",
fixed = {
{ -0.05, -0.45, 0.45, 0.05, -0.35, 0.50, },
{ -0.05, -0.35, 0.40, 0.05, -0.25, 0.50, },
{ -0.05, -0.25, 0.35, 0.05, -0.15, 0.45, },
{ -0.05, -0.15, 0.30, 0.05, -0.05, 0.40, },
{ -0.05, -0.05, 0.25, 0.05, 0.00, 0.35, },
{ -0.10, 0.00, 0.20, 0.10, 0.05, 0.40, },
{ -0.15, 0.05, 0.15, 0.15, 0.15, 0.45, },
{ -0.10, 0.15, 0.20, 0.10, 0.25, 0.40, },
{ -0.05, 0.25, 0.25, 0.05, 0.35, 0.35, },
},
},
sunlight_propagates = true,
walkable = false,
light_source = 14,
selection_box = {
type = "fixed",
fixed = { -0.15, -0.45, 0.15, 0.15,0.35, 0.5 },
},
groups = {cracky=2},
homedecor.register("torch_wall", {
description = S("Wall Torch"),
tiles = {
"forniture_torch_wall_s.png",
"forniture_torch_wall_i.png",
{
name="forniture_torch_wall_anim.png",
animation={
type="vertical_frames",
aspect_w=40,
aspect_h=40,
length=1.0,
},
},
},
inventory_image="3dforniture_inv_torch_wall.png",
node_box = {
type = "fixed",
fixed = {
{ -0.05, -0.45, 0.45, 0.05, -0.35, 0.50, },
{ -0.05, -0.35, 0.40, 0.05, -0.25, 0.50, },
{ -0.05, -0.25, 0.35, 0.05, -0.15, 0.45, },
{ -0.05, -0.15, 0.30, 0.05, -0.05, 0.40, },
{ -0.05, -0.05, 0.25, 0.05, 0.00, 0.35, },
{ -0.10, 0.00, 0.20, 0.10, 0.05, 0.40, },
{ -0.15, 0.05, 0.15, 0.15, 0.15, 0.45, },
{ -0.10, 0.15, 0.20, 0.10, 0.25, 0.40, },
{ -0.05, 0.25, 0.25, 0.05, 0.35, 0.35, },
},
},
sunlight_propagates = true,
walkable = false,
light_source = 14,
selection_box = {
type = "fixed",
fixed = { -0.15, -0.45, 0.15, 0.15,0.35, 0.5 },
},
groups = {cracky=2},
})
minetest.register_alias("3dforniture:bars", "homedecor:bars")

View File

@ -1,63 +1,63 @@
minetest.register_craft({
output = "homedecor:table", "homedecor:chair 2",
recipe = {
{ "group:wood","group:wood", "group:wood" },
{ "group:stick", "", "group:stick" },
},
output = "homedecor:table", "homedecor:chair 2",
recipe = {
{ "group:wood","group:wood", "group:wood" },
{ "group:stick", "", "group:stick" },
},
})
minetest.register_craft({
type = "shapeless",
output = "homedecor:table_mahogany",
recipe = {
output = "homedecor:table_mahogany",
recipe = {
"homedecor:table",
"dye:brown",
},
},
})
minetest.register_craft({
type = "shapeless",
output = "homedecor:table_mahogany",
recipe = {
output = "homedecor:table_mahogany",
recipe = {
"homedecor:table",
"unifieddyes:dark_orange",
},
},
})
minetest.register_craft({
type = "shapeless",
output = "homedecor:table_white",
recipe = {
output = "homedecor:table_white",
recipe = {
"homedecor:table",
"dye:white",
},
},
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:table",
burntime = 30,
type = "fuel",
recipe = "homedecor:table",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:table_mahogany",
burntime = 30,
type = "fuel",
recipe = "homedecor:table_mahogany",
burntime = 30,
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:table_white",
burntime = 30,
type = "fuel",
recipe = "homedecor:table_white",
burntime = 30,
})
minetest.register_craft({
output = "homedecor:chair 2",
recipe = {
{ "group:stick",""},
{ "group:wood","group:wood" },
{ "group:stick","group:stick" },
{ "group:stick",""},
{ "group:wood","group:wood" },
{ "group:stick","group:stick" },
},
})
@ -98,26 +98,26 @@ for _, color in ipairs(chaircolors) do
end
minetest.register_craft({
type = "fuel",
recipe = "homedecor:armchair",
burntime = 30,
type = "fuel",
recipe = "homedecor:armchair",
burntime = 30,
})
minetest.register_craft({
output = "homedecor:table_lamp_off",
recipe = {
{"default:paper","default:torch" ,"default:paper"},
{"","group:stick",""},
{"","stairs:slab_wood",""},
{"default:paper","default:torch" ,"default:paper"},
{"","group:stick",""},
{"","stairs:slab_wood",""},
},
})
minetest.register_craft({
output = "homedecor:table_lamp_off",
recipe = {
{"default:paper","default:torch" ,"default:paper"},
{"","group:stick",""},
{"","moreblocks:slab_wood",""},
{"default:paper","default:torch" ,"default:paper"},
{"","group:stick",""},
{"","moreblocks:slab_wood",""},
},
})
@ -131,9 +131,9 @@ minetest.register_craft({
})
minetest.register_craft({
type = "fuel",
recipe = "homedecor:table_lamp_off",
burntime = 10,
type = "fuel",
recipe = "homedecor:table_lamp_off",
burntime = 10,
})
local lamp_colors = { "blue", "green", "pink", "red", "violet" }
@ -143,18 +143,18 @@ for _, color in ipairs(lamp_colors) do
minetest.register_craft({
output = "homedecor:table_lamp_"..color.."_off",
recipe = {
{"wool:"..color,"default:torch" ,"wool:"..color},
{"","group:stick",""},
{"","stairs:slab_wood",""},
{"wool:"..color,"default:torch" ,"wool:"..color},
{"","group:stick",""},
{"","stairs:slab_wood",""},
},
})
minetest.register_craft({
output = "homedecor:table_lamp_"..color.."_off",
recipe = {
{"wool:"..color,"default:torch" ,"wool:"..color},
{"","group:stick",""},
{"","moreblocks:slab_wood",""},
{"wool:"..color,"default:torch" ,"wool:"..color},
{"","group:stick",""},
{"","moreblocks:slab_wood",""},
},
})
@ -176,9 +176,9 @@ for _, color in ipairs(lamp_colors) do
minetest.register_craft({
output = "homedecor:standing_lamp_bottom_"..color.."_off",
recipe = {
{"homedecor:table_lamp_"..color.."_off"},
{"group:stick"},
{"group:stick"},
{"homedecor:table_lamp_"..color.."_off"},
{"group:stick"},
{"group:stick"},
},
})
@ -194,62 +194,62 @@ for _, color in ipairs(lamp_colors) do
end
minetest.register_craft({
output = "homedecor:toilet",
recipe = {
{"","","bucket:bucket_water"},
{ "building_blocks:Marble","building_blocks:Marble", "building_blocks:Marble" },
{ "", "bucket:bucket_empty", "" },
},
output = "homedecor:toilet",
recipe = {
{"","","bucket:bucket_water"},
{ "building_blocks:Marble","building_blocks:Marble", "building_blocks:Marble" },
{ "", "bucket:bucket_empty", "" },
},
})
minetest.register_craft({
output = "homedecor:sink",
recipe = {
{ "building_blocks:Marble","bucket:bucket_empty", "building_blocks:Marble" },
},
output = "homedecor:sink",
recipe = {
{ "building_blocks:Marble","bucket:bucket_empty", "building_blocks:Marble" },
},
})
minetest.register_craft({
output = "homedecor:taps",
recipe = {
{ "default:steel_ingot","bucket:bucket_water", "default:steel_ingot" },
},
output = "homedecor:taps",
recipe = {
{ "default:steel_ingot","bucket:bucket_water", "default:steel_ingot" },
},
})
minetest.register_craft({
output = "homedecor:shower_tray",
recipe = {
{ "building_blocks:Marble","bucket:bucket_water", "building_blocks:Marble" },
},
output = "homedecor:shower_tray",
recipe = {
{ "building_blocks:Marble","bucket:bucket_water", "building_blocks:Marble" },
},
})
minetest.register_craft({
output = "homedecor:shower_head",
recipe = {
{"default:steel_ingot", "bucket:bucket_water"},
},
output = "homedecor:shower_head",
recipe = {
{"default:steel_ingot", "bucket:bucket_water"},
},
})
minetest.register_craft({
output = "homedecor:bars 6",
recipe = {
{ "default:steel_ingot","default:steel_ingot","default:steel_ingot" },
{ "homedecor:pole_wrought_iron","homedecor:pole_wrought_iron","homedecor:pole_wrought_iron" },
},
output = "homedecor:bars 6",
recipe = {
{ "default:steel_ingot","default:steel_ingot","default:steel_ingot" },
{ "homedecor:pole_wrought_iron","homedecor:pole_wrought_iron","homedecor:pole_wrought_iron" },
},
})
minetest.register_craft({
output = "homedecor:L_binding_bars 3",
recipe = {
{ "homedecor:bars","" },
{ "homedecor:bars","homedecor:bars" },
},
output = "homedecor:L_binding_bars 3",
recipe = {
{ "homedecor:bars","" },
{ "homedecor:bars","homedecor:bars" },
},
})
minetest.register_craft({
output = "homedecor:torch_wall 10",
recipe = {
{ "default:coal_lump" },
{ "default:steel_ingot" },
},
output = "homedecor:torch_wall 10",
recipe = {
{ "default:coal_lump" },
{ "default:steel_ingot" },
},
})

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

@ -46,132 +46,15 @@ end
--table copy
function homedecor.table_copy(t)
local nt = { };
for k, v in pairs(t) do
if type(v) == "table" then
nt[k] = homedecor.table_copy(v)
else
nt[k] = v
end
end
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
local nt = { };
for k, v in pairs(t) do
if type(v) == "table" then
nt[k] = homedecor.table_copy(v)
else
nt[k] = v
end
end
return nt
end
-- Determine if the item being pointed at is the underside of a node (e.g a ceiling)
@ -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,129 +204,109 @@ 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',
{name="homedecor_candle_sides.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=3.0}},
},
node_box = {
type = "fixed",
fixed = {
{ -0.125, -0.5, -0.125, 0.125, 0, 0.125 },
{ -0.125, 0, 0, 0.125, 0.5, 0 },
{ 0, 0, -0.125, 0, 0.5, 0.125 }
}
},
selection_box = {
type = "fixed",
fixed = {
{ -0.1875, -0.5, -0.1875, 0.1875, 0.5, 0.1875 },
}
},
node_box = {
type = "fixed",
fixed = {
{ -0.125, -0.5, -0.125, 0.125, 0, 0.125 },
{ -0.125, 0, 0, 0.125, 0.5, 0 },
{ 0, 0, -0.125, 0, 0.5, 0.125 }
}
},
selection_box = {
type = "fixed",
fixed = {
{ -0.1875, -0.5, -0.1875, 0.1875, 0.5, 0.1875 },
}
},
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",
tiles = {
{name="homedecor_candle.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1.0}},
},
selection_box = {
type = "fixed",
fixed = {
{ -0.1, -0.5, -0.1, 0.125, 0.05, 0.125 },
}
},
selection_box = {
type = "fixed",
fixed = {
{ -0.1, -0.5, -0.1, 0.125, 0.05, 0.125 },
}
},
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 = {
{ -0.3, -0.5, -0.3, 0.3, 0.5, 0.3 },
}
},
selection_box = {
type = "fixed",
fixed = {
{ -0.3, -0.5, -0.3, 0.3, 0.5, 0.3 },
}
},
groups = { snappy = 3 },
light_source = LIGHT_MAX-4,
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 = {
{ -0.3, -0.5, -0.3, 0.3, 0.5, 0.3 },
}
},
selection_box = {
type = "fixed",
fixed = {
{ -0.3, -0.5, -0.3, 0.3, 0.5, 0.3 },
}
},
groups = { snappy = 3 },
light_source = LIGHT_MAX-4,
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',
'homedecor_lattice_lantern_small_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 = {
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 }
},
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
})

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