just deleting some obsolete files.
@ -1,427 +0,0 @@
|
||||
-- Fancy Exterior doors - part of home decor mod by VanessaE
|
||||
-- 2012-06-10
|
||||
--
|
||||
-- Copied and modified from Minetest's default doors mod.
|
||||
--
|
||||
-- Textures derived from...
|
||||
-- http://commons.wikimedia.org/wiki/File:Front_door_of_Morey_Mansion.jpg
|
||||
-- ...plus the standard Minetest logo.
|
||||
--
|
||||
-- License: GPL
|
||||
--
|
||||
|
||||
local DEBUG = 0
|
||||
|
||||
local WALLMX = 3
|
||||
local WALLMZ = 5
|
||||
local WALLPX = 2
|
||||
local WALLPZ = 4
|
||||
|
||||
local WALLMXr = 2
|
||||
local WALLMZr = 4
|
||||
local WALLPXr = 3
|
||||
local WALLPZr = 5
|
||||
|
||||
local dbg = function(s)
|
||||
if DEBUG == 1 then
|
||||
print('[ExteriorDoorFancy] ' .. s)
|
||||
end
|
||||
end
|
||||
|
||||
local round = function( n )
|
||||
if n >= 0 then
|
||||
return math.floor( n + 0.5 )
|
||||
else
|
||||
return math.ceil( n - 0.5 )
|
||||
end
|
||||
end
|
||||
|
||||
-- ==========================
|
||||
-- Regular left-opening doors
|
||||
|
||||
-- Actual nodes that you place
|
||||
|
||||
minetest.register_node('homedecor:exterior_door_fancy', {
|
||||
description = "Fancy Wood/Glass Exterior Door (Left Opening)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_exterior_door_fancy.png' },
|
||||
inventory_image = 'homedecor_exterior_door_fancy.png',
|
||||
wield_image = 'homedecor_exterior_door_fancy.png',
|
||||
paramtype2 = "wallmounted",
|
||||
selection_box = { type = "wallmounted" },
|
||||
groups = { choppy = 2, dig_immediate=2 },
|
||||
})
|
||||
|
||||
-- Fancy Exterior door functions
|
||||
|
||||
local on_exterior_door_fancy_placed = function( pos, node, placer )
|
||||
if node.name ~= 'homedecor:exterior_door_fancy' then return end
|
||||
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
und = minetest.env:get_node( upos )
|
||||
abv = minetest.env:get_node( apos )
|
||||
|
||||
dir = placer:get_look_dir()
|
||||
|
||||
if round( dir.x ) == 1 then
|
||||
newparam = WALLMX
|
||||
elseif round( dir.x ) == -1 then
|
||||
newparam = WALLPX
|
||||
elseif round( dir.z ) == 1 then
|
||||
newparam = WALLMZ
|
||||
elseif round( dir.z ) == -1 then
|
||||
newparam = WALLPZ
|
||||
end
|
||||
|
||||
if und.name == 'air' then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:exterior_door_fancy_a_c', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:exterior_door_fancy_b_c', param2 = newparam } )
|
||||
elseif abv.name == 'air' then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:exterior_door_fancy_b_c', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:exterior_door_fancy_a_c', param2 = newparam } )
|
||||
else
|
||||
minetest.env:remove_node( pos )
|
||||
placer:get_inventory():add_item( "main", 'homedecor:exterior_door_fancy' )
|
||||
minetest.chat_send_player( placer:get_player_name(), 'not enough space' )
|
||||
end
|
||||
end
|
||||
|
||||
local on_exterior_door_fancy_punched = function( pos, node, puncher )
|
||||
if string.find( node.name, 'homedecor:exterior_door_fancy' ) == nil then return end
|
||||
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
|
||||
if string.find( node.name, '_c', -2 ) ~= nil then
|
||||
if node.param2 == WALLPX then
|
||||
newparam = WALLMZ
|
||||
elseif node.param2 == WALLMZ then
|
||||
newparam = WALLMX
|
||||
elseif node.param2 == WALLMX then
|
||||
newparam = WALLPZ
|
||||
elseif node.param2 == WALLPZ then
|
||||
newparam = WALLPX
|
||||
end
|
||||
elseif string.find( node.name, '_o', -2 ) ~= nil then
|
||||
if node.param2 == WALLMZ then
|
||||
newparam = WALLPX
|
||||
elseif node.param2 == WALLMX then
|
||||
newparam = WALLMZ
|
||||
elseif node.param2 == WALLPZ then
|
||||
newparam = WALLMX
|
||||
elseif node.param2 == WALLPX then
|
||||
newparam = WALLPZ
|
||||
end
|
||||
end
|
||||
|
||||
if ( node.name == 'homedecor:exterior_door_fancy_a_c' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:exterior_door_fancy_a_o', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:exterior_door_fancy_b_o', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:exterior_door_fancy_b_c' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:exterior_door_fancy_b_o', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:exterior_door_fancy_a_o', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:exterior_door_fancy_a_o' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:exterior_door_fancy_a_c', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:exterior_door_fancy_b_c', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:exterior_door_fancy_b_o' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:exterior_door_fancy_b_c', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:exterior_door_fancy_a_c', param2 = newparam } )
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
local on_exterior_door_fancy_digged = function( pos, node, digger )
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
|
||||
if ( node.name == 'homedecor:exterior_door_fancy_a_c' ) or ( node.name == 'homedecor:exterior_door_fancy_a_o' ) then
|
||||
minetest.env:remove_node( upos )
|
||||
elseif ( node.name == 'homedecor:exterior_door_fancy_b_c' ) or ( node.name == 'homedecor:exterior_door_fancy_b_o' ) then
|
||||
minetest.env:remove_node( apos )
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_placenode( on_exterior_door_fancy_placed )
|
||||
minetest.register_on_punchnode( on_exterior_door_fancy_punched )
|
||||
minetest.register_on_dignode( on_exterior_door_fancy_digged )
|
||||
|
||||
|
||||
-- Nodes used to build up Fancy Exterior doors
|
||||
|
||||
minetest.register_node('homedecor:exterior_door_fancy_a_c', {
|
||||
description = "Fancy Wood/Glass Exterior Door (top, closed)",
|
||||
tiles = { 'homedecor_exterior_door_fancy_a.png' },
|
||||
inventory_image = 'homedecor_exterior_door_fancy_a.png',
|
||||
drawtype = 'signlike',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = true,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1},
|
||||
selection_box = { type = "wallmounted" },
|
||||
drop = 'homedecor:exterior_door_fancy',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:exterior_door_fancy_b_c', {
|
||||
description = "Fancy Wood/Glass Exterior Door (bottom, closed)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_exterior_door_fancy_b.png' },
|
||||
inventory_image = 'homedecor_exterior_door_fancy_b.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = true,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted" },
|
||||
drop = 'homedecor:exterior_door_fancy',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:exterior_door_fancy_a_o', {
|
||||
description = "Fancy Wood/Glass Exterior Door (top, open)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_exterior_door_fancy_a_r.png' },
|
||||
inventory_image = 'homedecor_exterior_door_fancy_a_r.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted", },
|
||||
drop = 'homedecor:exterior_door_fancy',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:exterior_door_fancy_b_o', {
|
||||
description = "Fancy Wood/Glass Exterior Door (bottom, open)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_exterior_door_fancy_b_r.png' },
|
||||
inventory_image = 'homedecor_exterior_door_fancy_b_r.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = 'wallmounted',
|
||||
walkable = false,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted", },
|
||||
drop = 'homedecor:exterior_door_fancy',
|
||||
})
|
||||
|
||||
|
||||
-- ========================================
|
||||
-- Mirrored version for right-opening doors
|
||||
-- ========================================
|
||||
|
||||
-- Actual nodes that you place
|
||||
|
||||
minetest.register_node('homedecor:exterior_door_fancy_right', {
|
||||
description = "Fancy Wood/Glass Exterior Door (Right Opening)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_exterior_door_fancy_right.png' },
|
||||
inventory_image = 'homedecor_exterior_door_fancy_right.png',
|
||||
wield_image = 'homedecor_exterior_door_fancy_right.png',
|
||||
paramtype2 = "wallmounted",
|
||||
selection_box = { type = "wallmounted" },
|
||||
groups = { choppy = 2, dig_immediate=2 },
|
||||
})
|
||||
|
||||
|
||||
-- Fancy Exterior door functions
|
||||
|
||||
local on_exterior_door_fancy_placed_right = function( pos, node, placer )
|
||||
if node.name ~= 'homedecor:exterior_door_fancy_right' then return end
|
||||
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
und = minetest.env:get_node( upos )
|
||||
abv = minetest.env:get_node( apos )
|
||||
|
||||
dir = placer:get_look_dir()
|
||||
|
||||
if round( dir.x ) == 1 then
|
||||
newparam = WALLMX
|
||||
elseif round( dir.x ) == -1 then
|
||||
newparam = WALLPX
|
||||
elseif round( dir.z ) == 1 then
|
||||
newparam = WALLMZ
|
||||
elseif round( dir.z ) == -1 then
|
||||
newparam = WALLPZ
|
||||
end
|
||||
|
||||
if und.name == 'air' then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:exterior_door_fancy_a_c_right', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:exterior_door_fancy_b_c_right', param2 = newparam } )
|
||||
elseif abv.name == 'air' then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:exterior_door_fancy_b_c_right', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:exterior_door_fancy_a_c_right', param2 = newparam } )
|
||||
else
|
||||
minetest.env:remove_node( pos )
|
||||
placer:get_inventory():add_item( "main", 'homedecor:exterior_door_fancy_right' )
|
||||
minetest.chat_send_player( placer:get_player_name(), 'not enough space' )
|
||||
end
|
||||
end
|
||||
|
||||
local on_exterior_door_fancy_punched_right = function( pos, node, puncher )
|
||||
|
||||
if string.find( node.name, 'homedecor:exterior_door_fancy' ) == nil then return end
|
||||
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
|
||||
if string.find( node.name, '_c_right', -8 ) ~= nil then
|
||||
if node.param2 == WALLPX then
|
||||
newparam = WALLMZr
|
||||
elseif node.param2 == WALLMZ then
|
||||
newparam = WALLMXr
|
||||
elseif node.param2 == WALLMX then
|
||||
newparam = WALLPZr
|
||||
elseif node.param2 == WALLPZ then
|
||||
newparam = WALLPXr
|
||||
end
|
||||
elseif string.find( node.name, '_o_right', -8 ) ~= nil then
|
||||
if node.param2 == WALLMZ then
|
||||
newparam = WALLPXr
|
||||
elseif node.param2 == WALLMX then
|
||||
newparam = WALLMZr
|
||||
elseif node.param2 == WALLPZ then
|
||||
newparam = WALLMXr
|
||||
elseif node.param2 == WALLPX then
|
||||
newparam = WALLPZr
|
||||
end
|
||||
end
|
||||
|
||||
if ( node.name == 'homedecor:exterior_door_fancy_a_c_right' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:exterior_door_fancy_a_o_right', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:exterior_door_fancy_b_o_right', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:exterior_door_fancy_b_c_right' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:exterior_door_fancy_b_o_right', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:exterior_door_fancy_a_o_right', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:exterior_door_fancy_a_o_right' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:exterior_door_fancy_a_c_right', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:exterior_door_fancy_b_c_right', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:exterior_door_fancy_b_o_right' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:exterior_door_fancy_b_c_right', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:exterior_door_fancy_a_c_right', param2 = newparam } )
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
local on_exterior_door_fancy_digged_right = function( pos, node, digger )
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
|
||||
if ( node.name == 'homedecor:exterior_door_fancy_a_c_right' ) or ( node.name == 'homedecor:exterior_door_fancy_a_o_right' ) then
|
||||
minetest.env:remove_node( upos )
|
||||
elseif ( node.name == 'homedecor:exterior_door_fancy_b_c_right' ) or ( node.name == 'homedecor:exterior_door_fancy_b_o_right' ) then
|
||||
minetest.env:remove_node( apos )
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_placenode( on_exterior_door_fancy_placed_right )
|
||||
minetest.register_on_punchnode( on_exterior_door_fancy_punched_right )
|
||||
minetest.register_on_dignode( on_exterior_door_fancy_digged_right )
|
||||
|
||||
|
||||
-- Nodes used to build up Fancy Exterior doors
|
||||
|
||||
minetest.register_node('homedecor:exterior_door_fancy_a_c_right', {
|
||||
description = "Fancy Wood/Glass Exterior Door (top, closed, right)",
|
||||
tiles = { 'homedecor_exterior_door_fancy_a_r.png' },
|
||||
inventory_image = 'homedecor_exterior_door_fancy_a_r.png',
|
||||
drawtype = 'signlike',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = true,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted" },
|
||||
drop = 'homedecor:exterior_door_fancy_right',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:exterior_door_fancy_b_c_right', {
|
||||
description = "Fancy Wood/Glass Exterior Door (bottom, closed, right)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_exterior_door_fancy_b_r.png' },
|
||||
inventory_image = 'homedecor_exterior_door_fancy_b_r.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = true,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted" },
|
||||
drop = 'homedecor:exterior_door_fancy_right',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:exterior_door_fancy_a_o_right', {
|
||||
description = "Fancy Wood/Glass Exterior Door (top, open, right)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_exterior_door_fancy_a.png' },
|
||||
inventory_image = 'homedecor_exterior_door_fancy_a.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted", },
|
||||
drop = 'homedecor:exterior_door_fancy_right',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:exterior_door_fancy_b_o_right', {
|
||||
description = "Fancy Wood/Glass Exterior Door (bottom, open, right)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_exterior_door_fancy_b.png' },
|
||||
inventory_image = 'homedecor_exterior_door_fancy_b.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = 'wallmounted',
|
||||
walkable = false,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted", },
|
||||
drop = 'homedecor:exterior_door_fancy_right',
|
||||
})
|
||||
|
||||
|
||||
-- ================
|
||||
-- crafting recipes
|
||||
|
||||
minetest.register_craft( {
|
||||
output = 'homedecor:exterior_door_fancy',
|
||||
recipe = {
|
||||
{ 'default:wood', 'default:glass' },
|
||||
{ 'default:wood', 'default:wood' },
|
||||
{ 'default:wood', 'default:wood' },
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft( {
|
||||
type = 'shapeless',
|
||||
output = 'homedecor:exterior_door_fancy_right',
|
||||
recipe = {
|
||||
'homedecor:exterior_door_fancy',
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'shapeless',
|
||||
output = 'homedecor:exterior_door_fancy',
|
||||
recipe = {
|
||||
'homedecor:exterior_door_fancy_right',
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'fuel',
|
||||
recipe = 'homedecor:exterior_door_fancy',
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'fuel',
|
||||
recipe = 'homedecor:exterior_door_fancy_right',
|
||||
burntime = 30,
|
||||
})
|
@ -1,458 +0,0 @@
|
||||
-- Mahogany "folding" doors - part of home decor mod by VanessaE
|
||||
-- 2012-06-10
|
||||
--
|
||||
-- Copied and modified from Minetest's default doors mod.
|
||||
--
|
||||
-- License: GPL
|
||||
--
|
||||
|
||||
local DEBUG = 0
|
||||
|
||||
local WALLMX = 3
|
||||
local WALLMZ = 5
|
||||
local WALLPX = 2
|
||||
local WALLPZ = 4
|
||||
|
||||
local WALLMXr = 2
|
||||
local WALLMZr = 4
|
||||
local WALLPXr = 3
|
||||
local WALLPZr = 5
|
||||
|
||||
local dbg = function(s)
|
||||
if DEBUG == 1 then
|
||||
print('[FOLDINGDOORS] ' .. s)
|
||||
end
|
||||
end
|
||||
|
||||
local round = function( n )
|
||||
if n >= 0 then
|
||||
return math.floor( n + 0.5 )
|
||||
else
|
||||
return math.ceil( n - 0.5 )
|
||||
end
|
||||
end
|
||||
|
||||
-- ==========================
|
||||
-- Regular left-opening doors
|
||||
|
||||
-- Actual nodes that you place
|
||||
|
||||
minetest.register_node('homedecor:folding_door_mahogany', {
|
||||
description = "Mahogany Folding Door (Left Opening)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_mahogany.png' },
|
||||
inventory_image = 'homedecor_folding_door_mahogany.png',
|
||||
wield_image = 'homedecor_folding_door_mahogany.png',
|
||||
paramtype2 = "wallmounted",
|
||||
selection_box = { type = "wallmounted" },
|
||||
groups = { choppy = 2, dig_immediate=2 },
|
||||
})
|
||||
|
||||
-- Mahogany door functions
|
||||
|
||||
local on_mahogany_folding_door_placed = function( pos, node, placer )
|
||||
if node.name ~= 'homedecor:folding_door_mahogany' then return end
|
||||
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
und = minetest.env:get_node( upos )
|
||||
abv = minetest.env:get_node( apos )
|
||||
|
||||
dir = placer:get_look_dir()
|
||||
|
||||
if round( dir.x ) == 1 then
|
||||
newparam = WALLMX
|
||||
elseif round( dir.x ) == -1 then
|
||||
newparam = WALLPX
|
||||
elseif round( dir.z ) == 1 then
|
||||
newparam = WALLMZ
|
||||
elseif round( dir.z ) == -1 then
|
||||
newparam = WALLPZ
|
||||
end
|
||||
|
||||
if und.name == 'air' then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_mahogany_a_c', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:folding_door_mahogany_b_c', param2 = newparam } )
|
||||
elseif abv.name == 'air' then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_mahogany_b_c', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:folding_door_mahogany_a_c', param2 = newparam } )
|
||||
else
|
||||
minetest.env:remove_node( pos )
|
||||
placer:get_inventory():add_item( "main", 'homedecor:folding_door_mahogany' )
|
||||
minetest.chat_send_player( placer:get_player_name(), 'not enough space' )
|
||||
end
|
||||
end
|
||||
|
||||
local on_mahogany_folding_door_punched = function( pos, node, puncher )
|
||||
if string.find( node.name, 'homedecor:folding_door_mahogany' ) == nil then return end
|
||||
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
|
||||
if string.find( node.name, '_c', -2 ) ~= nil then
|
||||
if node.param2 == WALLPX then
|
||||
newparam = WALLMZ
|
||||
elseif node.param2 == WALLMZ then
|
||||
newparam = WALLMX
|
||||
elseif node.param2 == WALLMX then
|
||||
newparam = WALLPZ
|
||||
elseif node.param2 == WALLPZ then
|
||||
newparam = WALLPX
|
||||
end
|
||||
elseif string.find( node.name, '_o', -2 ) ~= nil then
|
||||
if node.param2 == WALLMZ then
|
||||
newparam = WALLPX
|
||||
elseif node.param2 == WALLMX then
|
||||
newparam = WALLMZ
|
||||
elseif node.param2 == WALLPZ then
|
||||
newparam = WALLMX
|
||||
elseif node.param2 == WALLPX then
|
||||
newparam = WALLPZ
|
||||
end
|
||||
end
|
||||
|
||||
if ( node.name == 'homedecor:folding_door_mahogany_a_c' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_mahogany_a_o', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:folding_door_mahogany_b_o', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:folding_door_mahogany_b_c' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_mahogany_b_o', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:folding_door_mahogany_a_o', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:folding_door_mahogany_a_o' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_mahogany_a_c', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:folding_door_mahogany_b_c', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:folding_door_mahogany_b_o' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_mahogany_b_c', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:folding_door_mahogany_a_c', param2 = newparam } )
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
local on_mahogany_folding_door_digged = function( pos, node, digger )
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
|
||||
if ( node.name == 'homedecor:folding_door_mahogany_a_c' ) or ( node.name == 'homedecor:folding_door_mahogany_a_o' ) then
|
||||
minetest.env:remove_node( upos )
|
||||
elseif ( node.name == 'homedecor:folding_door_mahogany_b_c' ) or ( node.name == 'homedecor:folding_door_mahogany_b_o' ) then
|
||||
minetest.env:remove_node( apos )
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_placenode( on_mahogany_folding_door_placed )
|
||||
minetest.register_on_punchnode( on_mahogany_folding_door_punched )
|
||||
minetest.register_on_dignode( on_mahogany_folding_door_digged )
|
||||
|
||||
|
||||
-- Nodes used to build up mahogany doors
|
||||
|
||||
minetest.register_node('homedecor:folding_door_mahogany_a_c', {
|
||||
description = "Mahogany Folding Door (top, closed)",
|
||||
tiles = { 'homedecor_folding_door_mahogany_a.png' },
|
||||
inventory_image = 'homedecor_folding_door_mahogany_a.png',
|
||||
drawtype = 'signlike',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = true,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted" },
|
||||
drop = 'homedecor:folding_door_mahogany',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:folding_door_mahogany_b_c', {
|
||||
description = "Mahogany Folding Door (bottom, closed)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_mahogany_b.png' },
|
||||
inventory_image = 'homedecor_folding_door_mahogany_b.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = true,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted" },
|
||||
drop = 'homedecor:folding_door_mahogany',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:folding_door_mahogany_a_o', {
|
||||
description = "Mahogany Folding Door (top, open)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_mahogany_a_r.png' },
|
||||
inventory_image = 'homedecor_folding_door_mahogany_a_r.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted", },
|
||||
drop = 'homedecor:folding_door_mahogany',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:folding_door_mahogany_b_o', {
|
||||
description = "Mahogany Folding Door (bottom, open)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_mahogany_b_r.png' },
|
||||
inventory_image = 'homedecor_folding_door_mahogany_b_r.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = 'wallmounted',
|
||||
walkable = false,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted", },
|
||||
drop = 'homedecor:folding_door_mahogany',
|
||||
})
|
||||
|
||||
|
||||
-- ========================================
|
||||
-- Mirrored version for right-opening doors
|
||||
-- ========================================
|
||||
|
||||
-- Actual nodes that you place
|
||||
|
||||
minetest.register_node('homedecor:folding_door_mahogany_right', {
|
||||
description = "Mahogany Folding Door (Right Opening)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_mahogany_right.png' },
|
||||
inventory_image = 'homedecor_folding_door_mahogany_right.png',
|
||||
wield_image = 'homedecor_folding_door_mahogany_right.png',
|
||||
paramtype2 = "wallmounted",
|
||||
selection_box = { type = "wallmounted" },
|
||||
groups = { choppy = 2, dig_immediate=2 },
|
||||
})
|
||||
|
||||
|
||||
-- Mahogany door functions
|
||||
|
||||
local on_mahogany_folding_door_placed_right = function( pos, node, placer )
|
||||
if node.name ~= 'homedecor:folding_door_mahogany_right' then return end
|
||||
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
und = minetest.env:get_node( upos )
|
||||
abv = minetest.env:get_node( apos )
|
||||
|
||||
dir = placer:get_look_dir()
|
||||
|
||||
if round( dir.x ) == 1 then
|
||||
newparam = WALLMX
|
||||
elseif round( dir.x ) == -1 then
|
||||
newparam = WALLPX
|
||||
elseif round( dir.z ) == 1 then
|
||||
newparam = WALLMZ
|
||||
elseif round( dir.z ) == -1 then
|
||||
newparam = WALLPZ
|
||||
end
|
||||
|
||||
if und.name == 'air' then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_mahogany_a_c_right', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:folding_door_mahogany_b_c_right', param2 = newparam } )
|
||||
elseif abv.name == 'air' then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_mahogany_b_c_right', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:folding_door_mahogany_a_c_right', param2 = newparam } )
|
||||
else
|
||||
minetest.env:remove_node( pos )
|
||||
placer:get_inventory():add_item( "main", 'homedecor:folding_door_mahogany_right' )
|
||||
minetest.chat_send_player( placer:get_player_name(), 'not enough space' )
|
||||
end
|
||||
end
|
||||
|
||||
local on_mahogany_folding_door_punched_right = function( pos, node, puncher )
|
||||
|
||||
if string.find( node.name, 'homedecor:folding_door_mahogany' ) == nil then return end
|
||||
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
|
||||
if string.find( node.name, '_c_right', -8 ) ~= nil then
|
||||
if node.param2 == WALLPX then
|
||||
newparam = WALLMZr
|
||||
elseif node.param2 == WALLMZ then
|
||||
newparam = WALLMXr
|
||||
elseif node.param2 == WALLMX then
|
||||
newparam = WALLPZr
|
||||
elseif node.param2 == WALLPZ then
|
||||
newparam = WALLPXr
|
||||
end
|
||||
elseif string.find( node.name, '_o_right', -8 ) ~= nil then
|
||||
if node.param2 == WALLMZ then
|
||||
newparam = WALLPXr
|
||||
elseif node.param2 == WALLMX then
|
||||
newparam = WALLMZr
|
||||
elseif node.param2 == WALLPZ then
|
||||
newparam = WALLMXr
|
||||
elseif node.param2 == WALLPX then
|
||||
newparam = WALLPZr
|
||||
end
|
||||
end
|
||||
|
||||
if ( node.name == 'homedecor:folding_door_mahogany_a_c_right' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_mahogany_a_o_right', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:folding_door_mahogany_b_o_right', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:folding_door_mahogany_b_c_right' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_mahogany_b_o_right', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:folding_door_mahogany_a_o_right', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:folding_door_mahogany_a_o_right' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_mahogany_a_c_right', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:folding_door_mahogany_b_c_right', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:folding_door_mahogany_b_o_right' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_mahogany_b_c_right', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:folding_door_mahogany_a_c_right', param2 = newparam } )
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
local on_mahogany_folding_door_digged_right = function( pos, node, digger )
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
|
||||
if ( node.name == 'homedecor:folding_door_mahogany_a_c_right' ) or ( node.name == 'homedecor:folding_door_mahogany_a_o_right' ) then
|
||||
minetest.env:remove_node( upos )
|
||||
elseif ( node.name == 'homedecor:folding_door_mahogany_b_c_right' ) or ( node.name == 'homedecor:folding_door_mahogany_b_o_right' ) then
|
||||
minetest.env:remove_node( apos )
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_placenode( on_mahogany_folding_door_placed_right )
|
||||
minetest.register_on_punchnode( on_mahogany_folding_door_punched_right )
|
||||
minetest.register_on_dignode( on_mahogany_folding_door_digged_right )
|
||||
|
||||
|
||||
-- Nodes used to build up mahogany doors
|
||||
|
||||
minetest.register_node('homedecor:folding_door_mahogany_a_c_right', {
|
||||
description = "Mahogany Folding Door (top, closed, right)",
|
||||
tiles = { 'homedecor_folding_door_mahogany_a_r.png' },
|
||||
inventory_image = 'homedecor_folding_door_mahogany_a_r.png',
|
||||
drawtype = 'signlike',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = true,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted" },
|
||||
drop = 'homedecor:folding_door_mahogany_right',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:folding_door_mahogany_b_c_right', {
|
||||
description = "Mahogany Folding Door (bottom, closed, right)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_mahogany_b_r.png' },
|
||||
inventory_image = 'homedecor_folding_door_mahogany_b_r.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = true,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted" },
|
||||
drop = 'homedecor:folding_door_mahogany_right',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:folding_door_mahogany_a_o_right', {
|
||||
description = "Mahogany Folding Door (top, open, right)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_mahogany_a.png' },
|
||||
inventory_image = 'homedecor_folding_door_mahogany_a.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted", },
|
||||
drop = 'homedecor:folding_door_mahogany_right',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:folding_door_mahogany_b_o_right', {
|
||||
description = "Mahogany Folding Door (bottom, open, right)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_mahogany_b.png' },
|
||||
inventory_image = 'homedecor_folding_door_mahogany_b.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = 'wallmounted',
|
||||
walkable = false,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted", },
|
||||
drop = 'homedecor:folding_door_mahogany_right',
|
||||
})
|
||||
|
||||
|
||||
-- =======================================
|
||||
-- Crafting recipes for all types of doors
|
||||
-- =======================================
|
||||
|
||||
minetest.register_craft( {
|
||||
type = 'shapeless',
|
||||
output = 'homedecor:folding_door_mahogany_right',
|
||||
recipe = {
|
||||
'homedecor:folding_door_mahogany',
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'shapeless',
|
||||
output = 'homedecor:folding_door_mahogany',
|
||||
recipe = {
|
||||
'homedecor:folding_door_mahogany_right',
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'fuel',
|
||||
recipe = 'homedecor:folding_door_mahogany',
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'fuel',
|
||||
recipe = 'homedecor:folding_door_mahogany_right',
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = 'shapeless',
|
||||
output = 'homedecor:folding_door_mahogany 2',
|
||||
recipe = {
|
||||
'homedecor:folding_door_oak',
|
||||
'homedecor:folding_door_oak',
|
||||
'unifieddyes:dark_orange',
|
||||
},
|
||||
replacements = { {'unifieddyes:dark_orange', 'unifieddyes:empty_bottle'}, },
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = 'shapeless',
|
||||
output = 'homedecor:folding_door_mahogany 2',
|
||||
recipe = {
|
||||
'homedecor:folding_door_oak',
|
||||
'homedecor:folding_door_oak',
|
||||
'default:coal_lump',
|
||||
'default:dirt',
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = 'shapeless',
|
||||
output = 'homedecor:folding_door_mahogany_right 2',
|
||||
recipe = {
|
||||
'homedecor:folding_door_oak_right',
|
||||
'homedecor:folding_door_oak_right',
|
||||
'unifieddyes:dark_orange',
|
||||
},
|
||||
replacements = { {'unifieddyes:dark_orange', 'unifieddyes:empty_bottle'}, },
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = 'shapeless',
|
||||
output = 'homedecor:folding_door_mahogany_right 2',
|
||||
recipe = {
|
||||
'homedecor:folding_door_oak_right',
|
||||
'homedecor:folding_door_oak_right',
|
||||
'default:coal_lump',
|
||||
'default:dirt',
|
||||
},
|
||||
})
|
@ -1,420 +0,0 @@
|
||||
-- Oak "folding" doors - part of home decor mod by VanessaE
|
||||
-- 2012-06-10
|
||||
--
|
||||
-- Copied and modified from Minetest's default doors mod.
|
||||
--
|
||||
-- License: GPL
|
||||
--
|
||||
|
||||
local DEBUG = 0
|
||||
|
||||
local WALLMX = 3
|
||||
local WALLMZ = 5
|
||||
local WALLPX = 2
|
||||
local WALLPZ = 4
|
||||
|
||||
local WALLMXr = 2
|
||||
local WALLMZr = 4
|
||||
local WALLPXr = 3
|
||||
local WALLPZr = 5
|
||||
|
||||
local dbg = function(s)
|
||||
if DEBUG == 1 then
|
||||
print('[FOLDINGDOORS] ' .. s)
|
||||
end
|
||||
end
|
||||
|
||||
local round = function( n )
|
||||
if n >= 0 then
|
||||
return math.floor( n + 0.5 )
|
||||
else
|
||||
return math.ceil( n - 0.5 )
|
||||
end
|
||||
end
|
||||
|
||||
-- ==========================
|
||||
-- Regular left-opening doors
|
||||
|
||||
minetest.register_node('homedecor:folding_door_oak', {
|
||||
description = "Oak Folding Door (Left Opening)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_oak.png' },
|
||||
inventory_image = 'homedecor_folding_door_oak.png',
|
||||
wield_image = 'homedecor_folding_door_oak.png',
|
||||
paramtype2 = "wallmounted",
|
||||
selection_box = { type = "wallmounted" },
|
||||
groups = { choppy = 2, dig_immediate=2 },
|
||||
})
|
||||
|
||||
|
||||
local on_oak_folding_door_placed = function( pos, node, placer )
|
||||
if node.name ~= 'homedecor:folding_door_oak' then return end
|
||||
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
und = minetest.env:get_node( upos )
|
||||
abv = minetest.env:get_node( apos )
|
||||
|
||||
dir = placer:get_look_dir()
|
||||
|
||||
if round( dir.x ) == 1 then
|
||||
newparam = WALLMX
|
||||
elseif round( dir.x ) == -1 then
|
||||
newparam = WALLPX
|
||||
elseif round( dir.z ) == 1 then
|
||||
newparam = WALLMZ
|
||||
elseif round( dir.z ) == -1 then
|
||||
newparam = WALLPZ
|
||||
end
|
||||
|
||||
if und.name == 'air' then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_oak_a_c', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:folding_door_oak_b_c', param2 = newparam } )
|
||||
elseif abv.name == 'air' then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_oak_b_c', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:folding_door_oak_a_c', param2 = newparam } )
|
||||
else
|
||||
minetest.env:remove_node( pos )
|
||||
placer:get_inventory():add_item( "main", 'homedecor:folding_door_oak' )
|
||||
minetest.chat_send_player( placer:get_player_name(), 'not enough space' )
|
||||
end
|
||||
end
|
||||
|
||||
local on_oak_folding_door_punched = function( pos, node, puncher )
|
||||
if string.find( node.name, 'homedecor:folding_door_oak' ) == nil then return end
|
||||
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
|
||||
if string.find( node.name, '_c', -2 ) ~= nil then
|
||||
if node.param2 == WALLPX then
|
||||
newparam = WALLMZ
|
||||
elseif node.param2 == WALLMZ then
|
||||
newparam = WALLMX
|
||||
elseif node.param2 == WALLMX then
|
||||
newparam = WALLPZ
|
||||
elseif node.param2 == WALLPZ then
|
||||
newparam = WALLPX
|
||||
end
|
||||
elseif string.find( node.name, '_o', -2 ) ~= nil then
|
||||
if node.param2 == WALLMZ then
|
||||
newparam = WALLPX
|
||||
elseif node.param2 == WALLMX then
|
||||
newparam = WALLMZ
|
||||
elseif node.param2 == WALLPZ then
|
||||
newparam = WALLMX
|
||||
elseif node.param2 == WALLPX then
|
||||
newparam = WALLPZ
|
||||
end
|
||||
end
|
||||
|
||||
if ( node.name == 'homedecor:folding_door_oak_a_c' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_oak_a_o', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:folding_door_oak_b_o', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:folding_door_oak_b_c' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_oak_b_o', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:folding_door_oak_a_o', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:folding_door_oak_a_o' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_oak_a_c', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:folding_door_oak_b_c', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:folding_door_oak_b_o' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_oak_b_c', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:folding_door_oak_a_c', param2 = newparam } )
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
local on_oak_folding_door_digged = function( pos, node, digger )
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
|
||||
if ( node.name == 'homedecor:folding_door_oak_a_c' ) or ( node.name == 'homedecor:folding_door_oak_a_o' ) then
|
||||
minetest.env:remove_node( upos )
|
||||
elseif ( node.name == 'homedecor:folding_door_oak_b_c' ) or ( node.name == 'homedecor:folding_door_oak_b_o' ) then
|
||||
minetest.env:remove_node( apos )
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_placenode( on_oak_folding_door_placed )
|
||||
minetest.register_on_punchnode( on_oak_folding_door_punched )
|
||||
minetest.register_on_dignode( on_oak_folding_door_digged )
|
||||
|
||||
|
||||
-- Nodes to build up oak folding doors
|
||||
|
||||
minetest.register_node('homedecor:folding_door_oak_a_c', {
|
||||
description = "Oak Folding Door (top, closed)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_oak_a.png' },
|
||||
inventory_image = 'homedecor_folding_door_oak_a.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = true,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted" },
|
||||
drop = 'homedecor:folding_door_oak',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:folding_door_oak_b_c', {
|
||||
description = "Oak Folding Door (bottom, closed)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_oak_b.png' },
|
||||
inventory_image = 'homedecor_folding_door_oak_b.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = true,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted" },
|
||||
drop = 'homedecor:folding_door_oak',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:folding_door_oak_a_o', {
|
||||
description = "Oak Folding Door (top, open)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_oak_a_r.png' },
|
||||
inventory_image = 'homedecor_folding_door_oak_a_r.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted", },
|
||||
drop = 'homedecor:folding_door_oak',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:folding_door_oak_b_o', {
|
||||
description = "Oak Folding Door (bottom, open)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_oak_b_r.png' },
|
||||
inventory_image = 'homedecor_folding_door_oak_b_r.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted", },
|
||||
drop = 'homedecor:folding_door_oak',
|
||||
})
|
||||
|
||||
|
||||
-- ========================================
|
||||
-- Mirrored version for right-opening doors
|
||||
-- ========================================
|
||||
|
||||
-- Actual nodes that you place
|
||||
|
||||
minetest.register_node('homedecor:folding_door_oak_right', {
|
||||
description = "Oak Folding Door (Right Opening)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_oak_right.png' },
|
||||
inventory_image = 'homedecor_folding_door_oak_right.png',
|
||||
wield_image = 'homedecor_folding_door_oak_right.png',
|
||||
paramtype2 = "wallmounted",
|
||||
selection_box = { type = "wallmounted" },
|
||||
groups = { choppy = 2, dig_immediate=2 },
|
||||
})
|
||||
|
||||
local on_oak_folding_door_placed_right = function( pos, node, placer )
|
||||
if node.name ~= 'homedecor:folding_door_oak_right' then return end
|
||||
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
und = minetest.env:get_node( upos )
|
||||
abv = minetest.env:get_node( apos )
|
||||
|
||||
dir = placer:get_look_dir()
|
||||
|
||||
if round( dir.x ) == 1 then
|
||||
newparam = WALLMX
|
||||
elseif round( dir.x ) == -1 then
|
||||
newparam = WALLPX
|
||||
elseif round( dir.z ) == 1 then
|
||||
newparam = WALLMZ
|
||||
elseif round( dir.z ) == -1 then
|
||||
newparam = WALLPZ
|
||||
end
|
||||
|
||||
if und.name == 'air' then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_oak_a_c_right', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:folding_door_oak_b_c_right', param2 = newparam } )
|
||||
elseif abv.name == 'air' then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_oak_b_c_right', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:folding_door_oak_a_c_right', param2 = newparam } )
|
||||
else
|
||||
minetest.env:remove_node( pos )
|
||||
placer:get_inventory():add_item( "main", 'homedecor:folding_door_oak_right' )
|
||||
minetest.chat_send_player( placer:get_player_name(), 'not enough space' )
|
||||
end
|
||||
end
|
||||
|
||||
local on_oak_folding_door_punched_right = function( pos, node, puncher )
|
||||
|
||||
if string.find( node.name, 'homedecor:folding_door_oak' ) == nil then return end
|
||||
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
|
||||
if string.find( node.name, '_c_right', -8 ) ~= nil then
|
||||
if node.param2 == WALLPX then
|
||||
newparam = WALLMZr
|
||||
elseif node.param2 == WALLMZ then
|
||||
newparam = WALLMXr
|
||||
elseif node.param2 == WALLMX then
|
||||
newparam = WALLPZr
|
||||
elseif node.param2 == WALLPZ then
|
||||
newparam = WALLPXr
|
||||
end
|
||||
|
||||
elseif string.find( node.name, '_o_right', -8 ) ~= nil then
|
||||
if node.param2 == WALLMZ then
|
||||
newparam = WALLPXr
|
||||
elseif node.param2 == WALLMX then
|
||||
newparam = WALLMZr
|
||||
elseif node.param2 == WALLPZ then
|
||||
newparam = WALLMXr
|
||||
elseif node.param2 == WALLPX then
|
||||
newparam = WALLPZr
|
||||
end
|
||||
end
|
||||
|
||||
if ( node.name == 'homedecor:folding_door_oak_a_c_right' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_oak_a_o_right', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:folding_door_oak_b_o_right', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:folding_door_oak_b_c_right' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_oak_b_o_right', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:folding_door_oak_a_o_right', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:folding_door_oak_a_o_right' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_oak_a_c_right', param2 = newparam } )
|
||||
minetest.env:add_node( upos, { name = 'homedecor:folding_door_oak_b_c_right', param2 = newparam } )
|
||||
|
||||
elseif ( node.name == 'homedecor:folding_door_oak_b_o_right' ) then
|
||||
minetest.env:add_node( pos, { name = 'homedecor:folding_door_oak_b_c_right', param2 = newparam } )
|
||||
minetest.env:add_node( apos, { name = 'homedecor:folding_door_oak_a_c_right', param2 = newparam } )
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
local on_oak_folding_door_digged_right = function( pos, node, digger )
|
||||
upos = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
apos = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
|
||||
if ( node.name == 'homedecor:folding_door_oak_a_c_right' ) or ( node.name == 'homedecor:folding_door_oak_a_o_right' ) then
|
||||
minetest.env:remove_node( upos )
|
||||
elseif ( node.name == 'homedecor:folding_door_oak_b_c_right' ) or ( node.name == 'homedecor:folding_door_oak_b_o_right' ) then
|
||||
minetest.env:remove_node( apos )
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_placenode( on_oak_folding_door_placed_right )
|
||||
minetest.register_on_punchnode( on_oak_folding_door_punched_right )
|
||||
minetest.register_on_dignode( on_oak_folding_door_digged_right )
|
||||
|
||||
|
||||
-- Nodes to build up oak folding doors
|
||||
|
||||
minetest.register_node('homedecor:folding_door_oak_a_c_right', {
|
||||
description = "Oak Folding Door (top, closed, right)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_oak_a_r.png' },
|
||||
inventory_image = 'homedecor_folding_door_oak_a_r.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = true,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted" },
|
||||
drop = 'homedecor:folding_door_oak_right',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:folding_door_oak_b_c_right', {
|
||||
description = "Oak Folding Door (bottom, closed, right)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_oak_b_r.png' },
|
||||
inventory_image = 'homedecor_folding_door_oak_b_r.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = true,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted" },
|
||||
drop = 'homedecor:folding_door_oak_right',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:folding_door_oak_a_o_right', {
|
||||
description = "Oak Folding Door (top, open, right)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_oak_a.png' },
|
||||
inventory_image = 'homedecor_folding_door_oak_a.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted", },
|
||||
drop = 'homedecor:folding_door_oak_right',
|
||||
})
|
||||
|
||||
minetest.register_node('homedecor:folding_door_oak_b_o_right', {
|
||||
description = "Oak Folding Door (bottom, open, right)",
|
||||
drawtype = 'signlike',
|
||||
tiles = { 'homedecor_folding_door_oak_b.png' },
|
||||
inventory_image = 'homedecor_folding_door_oak_b.png',
|
||||
sunlight_propagates = false,
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
groups = { choppy = 2, dig_immediate=2, not_in_creative_inventory=1 },
|
||||
selection_box = { type = "wallmounted", },
|
||||
drop = 'homedecor:folding_door_oak_right',
|
||||
})
|
||||
|
||||
|
||||
|
||||
-- =======================================
|
||||
-- Crafting recipes for all types of doors
|
||||
-- =======================================
|
||||
|
||||
|
||||
minetest.register_craft( {
|
||||
output = 'homedecor:folding_door_oak',
|
||||
recipe = {
|
||||
{ 'default:stick', 'default:stick', '' },
|
||||
{ 'default:stick', 'default:stick', 'default:steel_ingot' },
|
||||
{ 'default:stick', 'default:stick', '' },
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = 'shapeless',
|
||||
output = 'homedecor:folding_door_oak_right',
|
||||
recipe = {
|
||||
'homedecor:folding_door_oak',
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
type = 'shapeless',
|
||||
output = 'homedecor:folding_door_oak',
|
||||
recipe = {
|
||||
'homedecor:folding_door_oak_right',
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'fuel',
|
||||
recipe = 'homedecor:folding_door_oak',
|
||||
burntime = 30,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = 'fuel',
|
||||
recipe = 'homedecor:folding_door_oak_right',
|
||||
burntime = 30,
|
||||
})
|
Before Width: | Height: | Size: 505 B |
Before Width: | Height: | Size: 753 B |
Before Width: | Height: | Size: 749 B |
Before Width: | Height: | Size: 719 B |
Before Width: | Height: | Size: 719 B |
Before Width: | Height: | Size: 515 B |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 676 B |
Before Width: | Height: | Size: 664 B |
Before Width: | Height: | Size: 679 B |
Before Width: | Height: | Size: 674 B |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 712 B |
Before Width: | Height: | Size: 711 B |
Before Width: | Height: | Size: 730 B |
Before Width: | Height: | Size: 724 B |
Before Width: | Height: | Size: 3.8 KiB |