import lrfurn mod
85
lrfurn/README.txt
Normal file
@ -0,0 +1,85 @@
|
||||
Living Room Furniture (lrfurn) mod for Minetest
|
||||
|
||||
|
||||
by thefamilygrog66
|
||||
|
||||
Description:
|
||||
Coloured Long Sofas (3 blocks wide), Sofas (2 blocks wide), Armchairs, Coffee Tables and End Tables, loosely based on PilzAdam's beds mod. There are 9 colours in all: red, orange, yellow, green, blue, violet, black, grey and white.
|
||||
|
||||
When you right-click on a long sofa, sofa or armchair, it transports you onto it, and replenishes your HP. Good if you've just escaped nasty mobs, didn't fare so well in battle, or just had a bad fall. The coffee table - which isn't coloured, just wooden - is pretty much just for decoration. It stands half a block high and nearly 2 blocks long. The end table is similar to the coffee table, though roughly half the length (i.e. only one block) and square.
|
||||
|
||||
Recipes:
|
||||
|
||||
Long Sofa
|
||||
|
||||
+---------------+---------------+---------------+
|
||||
| coloured wool | coloured wool | coloured wool |
|
||||
+---------------+---------------+---------------+
|
||||
| wood slab | wood slab | wood slab |
|
||||
+---------------+---------------+---------------+
|
||||
| stick | stick | stick |
|
||||
+---------------+---------------+---------------+
|
||||
|
||||
Sofa
|
||||
|
||||
+---------------+---------------+-------+
|
||||
| coloured wool | coloured wool | |
|
||||
+---------------+---------------+-------+
|
||||
| wood slab | wood slab | |
|
||||
+---------------+---------------+-------+
|
||||
| stick | stick | |
|
||||
+---------------+---------------+-------+
|
||||
|
||||
Armchair
|
||||
|
||||
+---------------+-------+-------+
|
||||
| coloured wool | | |
|
||||
+---------------+-------+-------+
|
||||
| wood slab | | |
|
||||
+---------------+-------+-------+
|
||||
| stick | | |
|
||||
+---------------+-------+-------+
|
||||
|
||||
Coffee Table (only wood texture)
|
||||
|
||||
+-----------+-----------+-----------+
|
||||
| | | |
|
||||
+-----------+-----------+-----------+
|
||||
| wood slab | wood slab | wood slab |
|
||||
+-----------+-----------+-----------+
|
||||
| stick | | stick |
|
||||
+-----------+-----------+-----------+
|
||||
|
||||
End Table (only wood texture)
|
||||
|
||||
+-----------+-----------+-----------+
|
||||
| | | |
|
||||
+-----------+-----------+-----------+
|
||||
| wood slab | wood slab | |
|
||||
+-----------+-----------+-----------+
|
||||
| stick | stick | |
|
||||
+-----------+-----------+-----------+
|
||||
|
||||
|
||||
Mod dependencies: default, wool
|
||||
|
||||
License:
|
||||
Sourcecode: WTFPL (see below)
|
||||
Graphics: WTFPL (see below)
|
||||
|
||||
See also:
|
||||
http://minetest.net/
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
94
lrfurn/armchairs.lua
Normal file
@ -0,0 +1,94 @@
|
||||
local armchairs_list = {
|
||||
{ "Red Armchair", "red"},
|
||||
{ "Orange Armchair", "orange"},
|
||||
{ "Yellow Armchair", "yellow"},
|
||||
{ "Green Armchair", "green"},
|
||||
{ "Blue Armchair", "blue"},
|
||||
{ "Violet Armchair", "violet"},
|
||||
{ "Black Armchair", "black"},
|
||||
{ "Grey Armchair", "grey"},
|
||||
{ "White Armchair", "white"},
|
||||
}
|
||||
|
||||
for i in ipairs(armchairs_list) do
|
||||
local armchairdesc = armchairs_list[i][1]
|
||||
local colour = armchairs_list[i][2]
|
||||
|
||||
minetest.register_node("lrfurn:armchair_"..colour, {
|
||||
description = armchairdesc,
|
||||
drawtype = "nodebox",
|
||||
tiles = {"lrfurn_armchair_top_"..colour..".png", "lrfurn_coffeetable_back.png", "lrfurn_sofa_left_side_"..colour..".png", "lrfurn_sofa_right_side_"..colour..".png", "lrfurn_sofa_back_"..colour..".png", "lrfurn_armchair_front_"..colour..".png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
stack_max = 1,
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
--legs
|
||||
{-0.4375, -0.5, -0.4375, -0.375, -0.375, -0.375},
|
||||
{0.375, -0.5, -0.4375, 0.4375, -0.375, -0.375},
|
||||
{-0.4375, -0.5, 0.375, -0.375, -0.375, 0.4375},
|
||||
{0.375, -0.5, 0.375, 0.4375, -0.375, 0.4375},
|
||||
|
||||
--base/cushion
|
||||
{-0.5, -0.375, -0.5, 0.5, 0, 0.5},
|
||||
|
||||
--back
|
||||
{-0.5, 0, 0.3125, 0.5, 0.5, 0.5},
|
||||
|
||||
--arms
|
||||
{-0.5, 0, -0.5, -0.3125, 0.25, 0.3125},
|
||||
{0.3125, 0, -0.5, 0.5, 0.25, 0.3125},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
||||
}
|
||||
},
|
||||
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
if not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
pos.y = pos.y-0.5
|
||||
clicker:setpos(pos)
|
||||
clicker:set_hp(20)
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lrfurn:armchair_"..colour,
|
||||
recipe = {
|
||||
{"wool:"..colour, "", "", },
|
||||
{"stairs:slab_wood", "", "", },
|
||||
{"default:stick", "", "", }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lrfurn:armchair_"..colour,
|
||||
recipe = {
|
||||
{"wool:"..colour, "", "", },
|
||||
{"moreblocks:slab_wood", "", "", },
|
||||
{"default:stick", "", "", }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lrfurn:armchair_"..colour,
|
||||
recipe = {
|
||||
{"wool:"..colour, "", "", },
|
||||
{"group:wood_slab", "", "", },
|
||||
{"default:stick", "", "", }
|
||||
}
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "armchairs loaded")
|
||||
end
|
123
lrfurn/coffeetable.lua
Normal file
@ -0,0 +1,123 @@
|
||||
minetest.register_node("lrfurn:coffeetable_back", {
|
||||
description = "Coffee Table",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
stack_max = 1,
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
--legs
|
||||
{-0.375, -0.5, -0.375, -0.3125, -0.0625, -0.3125},
|
||||
{0.3125, -0.5, -0.375, 0.375, -0.0625, -0.3125},
|
||||
|
||||
--tabletop
|
||||
{-0.4375, -0.0625, -0.4375, 0.4375, 0, 0.5},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.4375, -0.5, -0.4375, 0.4375, 0.0, 1.4375},
|
||||
}
|
||||
},
|
||||
|
||||
on_construct = function(pos)
|
||||
local node = minetest.env:get_node(pos)
|
||||
local param2 = node.param2
|
||||
node.name = "lrfurn:coffeetable_front"
|
||||
if param2 == 0 then
|
||||
pos.z = pos.z+1
|
||||
elseif param2 == 1 then
|
||||
pos.x = pos.x+1
|
||||
elseif param2 == 2 then
|
||||
pos.z = pos.z-1
|
||||
elseif param2 == 3 then
|
||||
pos.x = pos.x-1
|
||||
end
|
||||
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "air" ) then
|
||||
minetest.env:set_node(pos, node)
|
||||
end
|
||||
end,
|
||||
|
||||
on_destruct = function(pos)
|
||||
local node = minetest.env:get_node(pos)
|
||||
local param2 = node.param2
|
||||
if param2 == 0 then
|
||||
pos.z = pos.z+1
|
||||
elseif param2 == 1 then
|
||||
pos.x = pos.x+1
|
||||
elseif param2 == 2 then
|
||||
pos.z = pos.z-1
|
||||
elseif param2 == 3 then
|
||||
pos.x = pos.x-1
|
||||
end
|
||||
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "lrfurn:coffeetable_front" ) then
|
||||
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).param2 == param2 ) then
|
||||
minetest.env:remove_node(pos)
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("lrfurn:coffeetable_front", {
|
||||
drawtype = "nodebox",
|
||||
tiles = {"lrfurn_coffeetable_front.png", "lrfurn_coffeetable_front.png", "lrfurn_coffeetable_front.png", "lrfurn_coffeetable_front.png", "lrfurn_coffeetable_front.png", "lrfurn_coffeetable_front.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
--legs
|
||||
{-0.375, -0.5, 0.3125, -0.3125, -0.0625, 0.375},
|
||||
{0.3125, -0.5, 0.3125, 0.375, -0.0625, 0.375},
|
||||
|
||||
--tabletop
|
||||
{-0.4375, -0.0625, -0.5, 0.4375, 0, 0.4375},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0, 0, 0, 0, 0, 0},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_alias("lrfurn:coffeetable", "lrfurn:coffeetable_back")
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lrfurn:coffeetable",
|
||||
recipe = {
|
||||
{"", "", "", },
|
||||
{"stairs:slab_wood", "stairs:slab_wood", "stairs:slab_wood", },
|
||||
{"default:stick", "", "default:stick", }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lrfurn:coffeetable",
|
||||
recipe = {
|
||||
{"", "", "", },
|
||||
{"moreblocks:slab_wood", "moreblocks:slab_wood", "moreblocks:slab_wood", },
|
||||
{"default:stick", "", "default:stick", }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lrfurn:coffeetable",
|
||||
recipe = {
|
||||
{"", "", "", },
|
||||
{"group:wood_slab", "group:wood_slab", "group:wood_slab", },
|
||||
{"default:stick", "", "default:stick", }
|
||||
}
|
||||
})
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "coffeetable loaded")
|
||||
end
|
2
lrfurn/depends.txt
Normal file
@ -0,0 +1,2 @@
|
||||
default
|
||||
wool
|
60
lrfurn/endtable.lua
Normal file
@ -0,0 +1,60 @@
|
||||
minetest.register_node("lrfurn:endtable", {
|
||||
description = "End Table",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png", "lrfurn_coffeetable_back.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
stack_max = 1,
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
--legs
|
||||
{-0.375, -0.5, -0.375, -0.3125, -0.0625, -0.3125},
|
||||
{0.3125, -0.5, -0.375, 0.375, -0.0625, -0.3125},
|
||||
{-0.375, -0.5, 0.3125, -0.3125, -0.0625, 0.375},
|
||||
{0.3125, -0.5, 0.3125, 0.375, -0.0625, 0.375},
|
||||
|
||||
--tabletop
|
||||
{-0.4375, -0.0625, -0.4375, 0.4375, 0, 0.4375},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.4375, -0.5, -0.4375, 0.4375, 0.0, 0.4375},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lrfurn:endtable",
|
||||
recipe = {
|
||||
{"", "", "", },
|
||||
{"stairs:slab_wood", "stairs:slab_wood", "", },
|
||||
{"default:stick", "default:stick", "", }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lrfurn:endtable",
|
||||
recipe = {
|
||||
{"", "", "", },
|
||||
{"moreblocks:slab_wood", "moreblocks:slab_wood", "", },
|
||||
{"default:stick", "default:stick", "", }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lrfurn:endtable",
|
||||
recipe = {
|
||||
{"", "", "", },
|
||||
{"group:wood_slab", "group:wood_slab", "", },
|
||||
{"default:stick", "default:stick", "", }
|
||||
}
|
||||
})
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "endtable loaded")
|
||||
end
|
5
lrfurn/init.lua
Normal file
@ -0,0 +1,5 @@
|
||||
dofile(minetest.get_modpath("lrfurn").."/longsofas.lua")
|
||||
dofile(minetest.get_modpath("lrfurn").."/sofas.lua")
|
||||
dofile(minetest.get_modpath("lrfurn").."/armchairs.lua")
|
||||
dofile(minetest.get_modpath("lrfurn").."/coffeetable.lua")
|
||||
dofile(minetest.get_modpath("lrfurn").."/endtable.lua")
|
218
lrfurn/longsofas.lua
Normal file
@ -0,0 +1,218 @@
|
||||
local longsofas_list = {
|
||||
{ "Red Long Sofa", "red"},
|
||||
{ "Orange Long Sofa", "orange"},
|
||||
{ "Yellow Long Sofa", "yellow"},
|
||||
{ "Green Long Sofa", "green"},
|
||||
{ "Blue Long Sofa", "blue"},
|
||||
{ "Violet Long Sofa", "violet"},
|
||||
{ "Black Long Sofa", "black"},
|
||||
{ "Grey Long Sofa", "grey"},
|
||||
{ "White Long Sofa", "white"},
|
||||
}
|
||||
|
||||
for i in ipairs(longsofas_list) do
|
||||
local longsofadesc = longsofas_list[i][1]
|
||||
local colour = longsofas_list[i][2]
|
||||
|
||||
minetest.register_node("lrfurn:longsofa_right_"..colour, {
|
||||
description = longsofadesc,
|
||||
drawtype = "nodebox",
|
||||
tiles = {"lrfurn_sofa_right_top_"..colour..".png", "lrfurn_coffeetable_back.png", "lrfurn_sofa_right_front_"..colour..".png", "lrfurn_sofa_back_"..colour..".png", "lrfurn_sofa_left_side_"..colour..".png", "lrfurn_sofa_right_side_"..colour..".png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
stack_max = 1,
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
--legs
|
||||
{-0.4375, -0.5, -0.4375, -0.375, -0.375, -0.375},
|
||||
{0.375, -0.5, -0.4375, 0.4375, -0.375, -0.375},
|
||||
|
||||
--base/cushion
|
||||
{-0.5, -0.375, -0.5, 0.5, 0, 0.5},
|
||||
|
||||
--back
|
||||
{-0.5, 0, -0.5, -0.3125, 0.5, 0.5},
|
||||
|
||||
--arm
|
||||
{-0.3125, 0, -0.5, 0.5, 0.25, -0.3125},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 2.5},
|
||||
}
|
||||
},
|
||||
|
||||
on_construct = function(pos)
|
||||
local node = minetest.env:get_node(pos)
|
||||
local param2 = node.param2
|
||||
node.name = "lrfurn:longsofa_middle_"..colour
|
||||
if param2 == 0 then
|
||||
pos.z = pos.z+1
|
||||
elseif param2 == 1 then
|
||||
pos.x = pos.x+1
|
||||
elseif param2 == 2 then
|
||||
pos.z = pos.z-1
|
||||
elseif param2 == 3 then
|
||||
pos.x = pos.x-1
|
||||
end
|
||||
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "air" ) then
|
||||
minetest.env:set_node(pos, node)
|
||||
node.name = "lrfurn:longsofa_left_"..colour
|
||||
if param2 == 0 then
|
||||
pos.z = pos.z+1
|
||||
elseif param2 == 1 then
|
||||
pos.x = pos.x+1
|
||||
elseif param2 == 2 then
|
||||
pos.z = pos.z-1
|
||||
elseif param2 == 3 then
|
||||
pos.x = pos.x-1
|
||||
end
|
||||
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "air" ) then
|
||||
minetest.env:set_node(pos, node)
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
on_destruct = function(pos)
|
||||
local node = minetest.env:get_node(pos)
|
||||
local param2 = node.param2
|
||||
if param2 == 0 then
|
||||
pos.z = pos.z+1
|
||||
elseif param2 == 1 then
|
||||
pos.x = pos.x+1
|
||||
elseif param2 == 2 then
|
||||
pos.z = pos.z-1
|
||||
elseif param2 == 3 then
|
||||
pos.x = pos.x-1
|
||||
end
|
||||
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "lrfurn:longsofa_middle_"..colour ) then
|
||||
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).param2 == param2 ) then
|
||||
minetest.env:remove_node(pos)
|
||||
if param2 == 0 then
|
||||
pos.z = pos.z+1
|
||||
elseif param2 == 1 then
|
||||
pos.x = pos.x+1
|
||||
elseif param2 == 2 then
|
||||
pos.z = pos.z-1
|
||||
elseif param2 == 3 then
|
||||
pos.x = pos.x-1
|
||||
end
|
||||
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "lrfurn:longsofa_left_"..colour ) then
|
||||
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).param2 == param2 ) then
|
||||
minetest.env:remove_node(pos)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
if not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
pos.y = pos.y-0.5
|
||||
clicker:setpos(pos)
|
||||
clicker:set_hp(20)
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("lrfurn:longsofa_middle_"..colour, {
|
||||
drawtype = "nodebox",
|
||||
tiles = {"lrfurn_longsofa_middle_top_"..colour..".png", "lrfurn_coffeetable_back.png", "lrfurn_longsofa_middle_front_"..colour..".png", "lrfurn_sofa_back_"..colour..".png", "lrfurn_sofa_left_side_"..colour..".png", "lrfurn_sofa_right_side_"..colour..".png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
--legs
|
||||
{-0.4375, -0.5, -0.03125, -0.375, -0.375, 0.03125},
|
||||
{0.375, -0.5, -0.03125, 0.4375, -0.375, 0.03125},
|
||||
|
||||
--base/cushion
|
||||
{-0.5, -0.375, -0.5, 0.5, 0, 0.5},
|
||||
|
||||
--back
|
||||
{-0.5, 0, -0.5, -0.3125, 0.5, 0.5},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0, 0, 0, 0, 0, 0},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("lrfurn:longsofa_left_"..colour, {
|
||||
drawtype = "nodebox",
|
||||
tiles = {"lrfurn_sofa_left_top_"..colour..".png", "lrfurn_coffeetable_back.png", "lrfurn_sofa_left_front_"..colour..".png", "lrfurn_sofa_back_"..colour..".png", "lrfurn_sofa_left_side_"..colour..".png", "lrfurn_sofa_right_side_"..colour..".png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
--legs
|
||||
{-0.4375, -0.5, 0.375, -0.375, -0.375, 0.4375},
|
||||
{0.375, -0.5, 0.375, 0.4375, -0.375, 0.4375},
|
||||
|
||||
--base/cushion
|
||||
{-0.5, -0.375, -0.5, 0.5, 0, 0.5},
|
||||
|
||||
--back
|
||||
{-0.5, 0, -0.5, -0.3125, 0.5, 0.5},
|
||||
|
||||
--arm
|
||||
{-0.3125, 0, 0.3125, 0.5, 0.25, 0.5},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0, 0, 0, 0, 0, 0},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_alias("lrfurn:longsofa_"..colour, "lrfurn:longsofa_right_"..colour)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lrfurn:longsofa_"..colour,
|
||||
recipe = {
|
||||
{"wool:"..colour, "wool:"..colour, "wool:"..colour, },
|
||||
{"stairs:slab_wood", "stairs:slab_wood", "stairs:slab_wood", },
|
||||
{"default:stick", "default:stick", "default:stick", }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lrfurn:longsofa_"..colour,
|
||||
recipe = {
|
||||
{"wool:"..colour, "wool:"..colour, "wool:"..colour, },
|
||||
{"moreblocks:slab_wood", "moreblocks:slab_wood", "moreblocks:slab_wood", },
|
||||
{"default:stick", "default:stick", "default:stick", }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lrfurn:longsofa_"..colour,
|
||||
recipe = {
|
||||
{"wool:"..colour, "wool:"..colour, "wool:"..colour, },
|
||||
{"group:wood_slab", "group:wood_slab", "group:wood_slab", },
|
||||
{"default:stick", "default:stick", "default:stick", }
|
||||
}
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "long sofas loaded")
|
||||
end
|
162
lrfurn/sofas.lua
Normal file
@ -0,0 +1,162 @@
|
||||
local sofas_list = {
|
||||
{ "Red Sofa", "red"},
|
||||
{ "Orange Sofa", "orange"},
|
||||
{ "Yellow Sofa", "yellow"},
|
||||
{ "Green Sofa", "green"},
|
||||
{ "Blue Sofa", "blue"},
|
||||
{ "Violet Sofa", "violet"},
|
||||
{ "Black Sofa", "black"},
|
||||
{ "Grey Sofa", "grey"},
|
||||
{ "White Sofa", "white"},
|
||||
}
|
||||
|
||||
for i in ipairs(sofas_list) do
|
||||
local sofadesc = sofas_list[i][1]
|
||||
local colour = sofas_list[i][2]
|
||||
|
||||
minetest.register_node("lrfurn:sofa_right_"..colour, {
|
||||
description = sofadesc,
|
||||
drawtype = "nodebox",
|
||||
tiles = {"lrfurn_sofa_right_top_"..colour..".png", "lrfurn_coffeetable_back.png", "lrfurn_sofa_right_front_"..colour..".png", "lrfurn_sofa_back_"..colour..".png", "lrfurn_sofa_left_side_"..colour..".png", "lrfurn_sofa_right_side_"..colour..".png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
stack_max = 1,
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
--legs
|
||||
{-0.4375, -0.5, -0.4375, -0.375, -0.375, -0.375},
|
||||
{0.375, -0.5, -0.4375, 0.4375, -0.375, -0.375},
|
||||
|
||||
--base/cushion
|
||||
{-0.5, -0.375, -0.5, 0.5, 0, 0.5},
|
||||
|
||||
--back
|
||||
{-0.5, 0, -0.5, -0.3125, 0.5, 0.5},
|
||||
|
||||
--arm
|
||||
{-0.3125, 0, -0.5, 0.5, 0.25, -0.3125},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, 0.5, 1.5},
|
||||
}
|
||||
},
|
||||
|
||||
on_construct = function(pos)
|
||||
local node = minetest.env:get_node(pos)
|
||||
local param2 = node.param2
|
||||
node.name = "lrfurn:sofa_left_"..colour
|
||||
if param2 == 0 then
|
||||
pos.z = pos.z+1
|
||||
elseif param2 == 1 then
|
||||
pos.x = pos.x+1
|
||||
elseif param2 == 2 then
|
||||
pos.z = pos.z-1
|
||||
elseif param2 == 3 then
|
||||
pos.x = pos.x-1
|
||||
end
|
||||
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "air" ) then
|
||||
minetest.env:set_node(pos, node)
|
||||
end
|
||||
end,
|
||||
|
||||
on_destruct = function(pos)
|
||||
local node = minetest.env:get_node(pos)
|
||||
local param2 = node.param2
|
||||
if param2 == 0 then
|
||||
pos.z = pos.z+1
|
||||
elseif param2 == 1 then
|
||||
pos.x = pos.x+1
|
||||
elseif param2 == 2 then
|
||||
pos.z = pos.z-1
|
||||
elseif param2 == 3 then
|
||||
pos.x = pos.x-1
|
||||
end
|
||||
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).name == "lrfurn:sofa_left_"..colour ) then
|
||||
if( minetest.env:get_node({x=pos.x, y=pos.y, z=pos.z}).param2 == param2 ) then
|
||||
minetest.env:remove_node(pos)
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
on_rightclick = function(pos, node, clicker)
|
||||
if not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
pos.y = pos.y-0.5
|
||||
clicker:setpos(pos)
|
||||
clicker:set_hp(20)
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("lrfurn:sofa_left_"..colour, {
|
||||
drawtype = "nodebox",
|
||||
tiles = {"lrfurn_sofa_left_top_"..colour..".png", "lrfurn_coffeetable_back.png", "lrfurn_sofa_left_front_"..colour..".png", "lrfurn_sofa_back_"..colour..".png", "lrfurn_sofa_left_side_"..colour..".png", "lrfurn_sofa_right_side_"..colour..".png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=3},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
--legs
|
||||
{-0.4375, -0.5, 0.375, -0.375, -0.375, 0.4375},
|
||||
{0.375, -0.5, 0.375, 0.4375, -0.375, 0.4375},
|
||||
|
||||
--base/cushion
|
||||
{-0.5, -0.375, -0.5, 0.5, 0, 0.5},
|
||||
|
||||
--back
|
||||
{-0.5, 0, -0.5, -0.3125, 0.5, 0.5},
|
||||
|
||||
--arm
|
||||
{-0.3125, 0, 0.3125, 0.5, 0.25, 0.5},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{0, 0, 0, 0, 0, 0},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_alias("lrfurn:sofa_"..colour, "lrfurn:sofa_right_"..colour)
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lrfurn:sofa_"..colour,
|
||||
recipe = {
|
||||
{"wool:"..colour, "wool:"..colour, "", },
|
||||
{"stairs:slab_wood", "stairs:slab_wood", "", },
|
||||
{"default:stick", "default:stick", "", }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lrfurn:sofa_"..colour,
|
||||
recipe = {
|
||||
{"wool:"..colour, "wool:"..colour, "", },
|
||||
{"moreblocks:slab_wood", "moreblocks:slab_wood", "", },
|
||||
{"default:stick", "default:stick", "", }
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "lrfurn:sofa_"..colour,
|
||||
recipe = {
|
||||
{"wool:"..colour, "wool:"..colour, "", },
|
||||
{"group:wood_slab", "group:wood_slab", "", },
|
||||
{"default:stick", "default:stick", "", }
|
||||
}
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "sofas loaded")
|
||||
end
|
BIN
lrfurn/textures/lrfurn_armchair_front_black.png
Normal file
After Width: | Height: | Size: 579 B |
BIN
lrfurn/textures/lrfurn_armchair_front_blue.png
Normal file
After Width: | Height: | Size: 609 B |
BIN
lrfurn/textures/lrfurn_armchair_front_green.png
Normal file
After Width: | Height: | Size: 603 B |
BIN
lrfurn/textures/lrfurn_armchair_front_grey.png
Normal file
After Width: | Height: | Size: 571 B |
BIN
lrfurn/textures/lrfurn_armchair_front_orange.png
Normal file
After Width: | Height: | Size: 619 B |
BIN
lrfurn/textures/lrfurn_armchair_front_red.png
Normal file
After Width: | Height: | Size: 610 B |
BIN
lrfurn/textures/lrfurn_armchair_front_violet.png
Normal file
After Width: | Height: | Size: 631 B |
BIN
lrfurn/textures/lrfurn_armchair_front_white.png
Normal file
After Width: | Height: | Size: 583 B |
BIN
lrfurn/textures/lrfurn_armchair_front_yellow.png
Normal file
After Width: | Height: | Size: 542 B |
BIN
lrfurn/textures/lrfurn_armchair_top_black.png
Normal file
After Width: | Height: | Size: 423 B |
BIN
lrfurn/textures/lrfurn_armchair_top_blue.png
Normal file
After Width: | Height: | Size: 536 B |
BIN
lrfurn/textures/lrfurn_armchair_top_green.png
Normal file
After Width: | Height: | Size: 526 B |
BIN
lrfurn/textures/lrfurn_armchair_top_grey.png
Normal file
After Width: | Height: | Size: 480 B |
BIN
lrfurn/textures/lrfurn_armchair_top_orange.png
Normal file
After Width: | Height: | Size: 570 B |
BIN
lrfurn/textures/lrfurn_armchair_top_red.png
Normal file
After Width: | Height: | Size: 532 B |
BIN
lrfurn/textures/lrfurn_armchair_top_violet.png
Normal file
After Width: | Height: | Size: 571 B |
BIN
lrfurn/textures/lrfurn_armchair_top_white.png
Normal file
After Width: | Height: | Size: 463 B |
BIN
lrfurn/textures/lrfurn_armchair_top_yellow.png
Normal file
After Width: | Height: | Size: 422 B |
BIN
lrfurn/textures/lrfurn_coffeetable_back.png
Normal file
After Width: | Height: | Size: 709 B |
BIN
lrfurn/textures/lrfurn_coffeetable_front.png
Normal file
After Width: | Height: | Size: 699 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_front_black.png
Normal file
After Width: | Height: | Size: 527 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_front_blue.png
Normal file
After Width: | Height: | Size: 563 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_front_green.png
Normal file
After Width: | Height: | Size: 550 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_front_grey.png
Normal file
After Width: | Height: | Size: 524 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_front_orange.png
Normal file
After Width: | Height: | Size: 573 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_front_red.png
Normal file
After Width: | Height: | Size: 562 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_front_violet.png
Normal file
After Width: | Height: | Size: 587 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_front_white.png
Normal file
After Width: | Height: | Size: 530 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_front_yellow.png
Normal file
After Width: | Height: | Size: 505 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_top_black.png
Normal file
After Width: | Height: | Size: 387 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_top_blue.png
Normal file
After Width: | Height: | Size: 422 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_top_green.png
Normal file
After Width: | Height: | Size: 421 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_top_grey.png
Normal file
After Width: | Height: | Size: 378 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_top_orange.png
Normal file
After Width: | Height: | Size: 445 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_top_red.png
Normal file
After Width: | Height: | Size: 431 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_top_violet.png
Normal file
After Width: | Height: | Size: 465 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_top_white.png
Normal file
After Width: | Height: | Size: 382 B |
BIN
lrfurn/textures/lrfurn_longsofa_middle_top_yellow.png
Normal file
After Width: | Height: | Size: 361 B |
BIN
lrfurn/textures/lrfurn_sofa_back_black.png
Normal file
After Width: | Height: | Size: 403 B |
BIN
lrfurn/textures/lrfurn_sofa_back_blue.png
Normal file
After Width: | Height: | Size: 405 B |
BIN
lrfurn/textures/lrfurn_sofa_back_green.png
Normal file
After Width: | Height: | Size: 403 B |
BIN
lrfurn/textures/lrfurn_sofa_back_grey.png
Normal file
After Width: | Height: | Size: 403 B |
BIN
lrfurn/textures/lrfurn_sofa_back_orange.png
Normal file
After Width: | Height: | Size: 401 B |
BIN
lrfurn/textures/lrfurn_sofa_back_red.png
Normal file
After Width: | Height: | Size: 405 B |
BIN
lrfurn/textures/lrfurn_sofa_back_violet.png
Normal file
After Width: | Height: | Size: 406 B |
BIN
lrfurn/textures/lrfurn_sofa_back_white.png
Normal file
After Width: | Height: | Size: 404 B |
BIN
lrfurn/textures/lrfurn_sofa_back_yellow.png
Normal file
After Width: | Height: | Size: 393 B |
BIN
lrfurn/textures/lrfurn_sofa_left_front_black.png
Normal file
After Width: | Height: | Size: 549 B |
BIN
lrfurn/textures/lrfurn_sofa_left_front_blue.png
Normal file
After Width: | Height: | Size: 586 B |
BIN
lrfurn/textures/lrfurn_sofa_left_front_green.png
Normal file
After Width: | Height: | Size: 574 B |
BIN
lrfurn/textures/lrfurn_sofa_left_front_grey.png
Normal file
After Width: | Height: | Size: 546 B |
BIN
lrfurn/textures/lrfurn_sofa_left_front_orange.png
Normal file
After Width: | Height: | Size: 592 B |
BIN
lrfurn/textures/lrfurn_sofa_left_front_red.png
Normal file
After Width: | Height: | Size: 586 B |
BIN
lrfurn/textures/lrfurn_sofa_left_front_violet.png
Normal file
After Width: | Height: | Size: 614 B |
BIN
lrfurn/textures/lrfurn_sofa_left_front_white.png
Normal file
After Width: | Height: | Size: 552 B |
BIN
lrfurn/textures/lrfurn_sofa_left_front_yellow.png
Normal file
After Width: | Height: | Size: 523 B |
BIN
lrfurn/textures/lrfurn_sofa_left_side_black.png
Normal file
After Width: | Height: | Size: 534 B |
BIN
lrfurn/textures/lrfurn_sofa_left_side_blue.png
Normal file
After Width: | Height: | Size: 560 B |
BIN
lrfurn/textures/lrfurn_sofa_left_side_green.png
Normal file
After Width: | Height: | Size: 561 B |
BIN
lrfurn/textures/lrfurn_sofa_left_side_grey.png
Normal file
After Width: | Height: | Size: 534 B |
BIN
lrfurn/textures/lrfurn_sofa_left_side_orange.png
Normal file
After Width: | Height: | Size: 574 B |
BIN
lrfurn/textures/lrfurn_sofa_left_side_red.png
Normal file
After Width: | Height: | Size: 565 B |
BIN
lrfurn/textures/lrfurn_sofa_left_side_violet.png
Normal file
After Width: | Height: | Size: 575 B |
BIN
lrfurn/textures/lrfurn_sofa_left_side_white.png
Normal file
After Width: | Height: | Size: 533 B |
BIN
lrfurn/textures/lrfurn_sofa_left_side_yellow.png
Normal file
After Width: | Height: | Size: 504 B |
BIN
lrfurn/textures/lrfurn_sofa_left_top_black.png
Normal file
After Width: | Height: | Size: 437 B |
BIN
lrfurn/textures/lrfurn_sofa_left_top_blue.png
Normal file
After Width: | Height: | Size: 480 B |
BIN
lrfurn/textures/lrfurn_sofa_left_top_green.png
Normal file
After Width: | Height: | Size: 489 B |
BIN
lrfurn/textures/lrfurn_sofa_left_top_grey.png
Normal file
After Width: | Height: | Size: 424 B |
BIN
lrfurn/textures/lrfurn_sofa_left_top_orange.png
Normal file
After Width: | Height: | Size: 524 B |
BIN
lrfurn/textures/lrfurn_sofa_left_top_red.png
Normal file
After Width: | Height: | Size: 419 B |
BIN
lrfurn/textures/lrfurn_sofa_left_top_violet.png
Normal file
After Width: | Height: | Size: 520 B |
BIN
lrfurn/textures/lrfurn_sofa_left_top_white.png
Normal file
After Width: | Height: | Size: 428 B |
BIN
lrfurn/textures/lrfurn_sofa_left_top_yellow.png
Normal file
After Width: | Height: | Size: 405 B |
BIN
lrfurn/textures/lrfurn_sofa_right_front_black.png
Normal file
After Width: | Height: | Size: 562 B |
BIN
lrfurn/textures/lrfurn_sofa_right_front_blue.png
Normal file
After Width: | Height: | Size: 596 B |
BIN
lrfurn/textures/lrfurn_sofa_right_front_green.png
Normal file
After Width: | Height: | Size: 582 B |
BIN
lrfurn/textures/lrfurn_sofa_right_front_grey.png
Normal file
After Width: | Height: | Size: 556 B |
BIN
lrfurn/textures/lrfurn_sofa_right_front_orange.png
Normal file
After Width: | Height: | Size: 597 B |
BIN
lrfurn/textures/lrfurn_sofa_right_front_red.png
Normal file
After Width: | Height: | Size: 588 B |
BIN
lrfurn/textures/lrfurn_sofa_right_front_violet.png
Normal file
After Width: | Height: | Size: 622 B |
BIN
lrfurn/textures/lrfurn_sofa_right_front_white.png
Normal file
After Width: | Height: | Size: 565 B |
BIN
lrfurn/textures/lrfurn_sofa_right_front_yellow.png
Normal file
After Width: | Height: | Size: 528 B |
BIN
lrfurn/textures/lrfurn_sofa_right_side_black.png
Normal file
After Width: | Height: | Size: 558 B |
BIN
lrfurn/textures/lrfurn_sofa_right_side_blue.png
Normal file
After Width: | Height: | Size: 578 B |
BIN
lrfurn/textures/lrfurn_sofa_right_side_green.png
Normal file
After Width: | Height: | Size: 574 B |
BIN
lrfurn/textures/lrfurn_sofa_right_side_grey.png
Normal file
After Width: | Height: | Size: 556 B |
BIN
lrfurn/textures/lrfurn_sofa_right_side_orange.png
Normal file
After Width: | Height: | Size: 586 B |
BIN
lrfurn/textures/lrfurn_sofa_right_side_red.png
Normal file
After Width: | Height: | Size: 568 B |
BIN
lrfurn/textures/lrfurn_sofa_right_side_violet.png
Normal file
After Width: | Height: | Size: 590 B |
BIN
lrfurn/textures/lrfurn_sofa_right_side_white.png
Normal file
After Width: | Height: | Size: 561 B |
BIN
lrfurn/textures/lrfurn_sofa_right_side_yellow.png
Normal file
After Width: | Height: | Size: 519 B |