2012-10-02 01:22:54 +02:00
|
|
|
|
|
|
|
-- This file supplies glowlights
|
|
|
|
|
2013-03-05 08:18:56 +01:00
|
|
|
-- Boilerplate to support localized strings if intllib mod is installed.
|
|
|
|
local S
|
|
|
|
if (minetest.get_modpath("intllib")) then
|
|
|
|
dofile(minetest.get_modpath("intllib").."/intllib.lua")
|
|
|
|
S = intllib.Getter(minetest.get_current_modname())
|
|
|
|
else
|
|
|
|
S = function ( s ) return s end
|
|
|
|
end
|
|
|
|
|
2012-10-02 01:22:54 +02:00
|
|
|
-- Yellow
|
|
|
|
|
|
|
|
minetest.register_node('homedecor:glowlight_thick_yellow', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("Yellow Glowlight (thick)"),
|
2012-10-02 01:22:54 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
|
|
|
'homedecor_glowlight_yellow_tb.png',
|
|
|
|
'homedecor_glowlight_yellow_tb.png',
|
|
|
|
'homedecor_glowlight_thick_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thick_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thick_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thick_yellow_sides.png'
|
|
|
|
},
|
|
|
|
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 }
|
|
|
|
},
|
|
|
|
|
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
|
|
|
walkable = true,
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
light_source = LIGHT_MAX,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 21:45:21 +02:00
|
|
|
|
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
|
|
|
|
local node = minetest.env:get_node(pointed_thing.under)
|
|
|
|
if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then
|
|
|
|
|
|
|
|
local above = pointed_thing.above
|
|
|
|
local under = pointed_thing.under
|
|
|
|
local pitch = placer:get_look_pitch()
|
|
|
|
local node = minetest.env:get_node(above)
|
|
|
|
|
|
|
|
if node.name ~= "air" then return end
|
|
|
|
|
|
|
|
if above.x ~= under.x or above.z ~= under.z then
|
|
|
|
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_yellow_wall', param2 = fdir})
|
|
|
|
else
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_yellow'})
|
|
|
|
end
|
2013-04-17 09:14:09 +02:00
|
|
|
if not homedecor_expect_infinite_stacks then
|
2013-04-14 21:45:21 +02:00
|
|
|
itemstack:take_item()
|
2013-04-17 08:47:49 +02:00
|
|
|
return itemstack
|
2013-04-14 21:45:21 +02:00
|
|
|
end
|
|
|
|
else
|
|
|
|
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer)
|
|
|
|
end
|
|
|
|
end
|
2012-10-02 01:22:54 +02:00
|
|
|
})
|
|
|
|
|
2012-10-04 00:53:17 +02:00
|
|
|
minetest.register_node('homedecor:glowlight_thick_yellow_wall', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("Yellow Glowlight (thick, on wall)"),
|
2012-10-04 00:53:17 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
|
|
|
'homedecor_glowlight_thick_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thick_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thick_yellow_wall_sides.png',
|
|
|
|
'homedecor_glowlight_thick_yellow_wall_sides.png',
|
|
|
|
'homedecor_glowlight_yellow_tb.png',
|
|
|
|
'homedecor_glowlight_yellow_tb.png'
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }
|
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }
|
|
|
|
},
|
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
walkable = true,
|
2013-04-14 21:45:21 +02:00
|
|
|
groups = { snappy = 3, not_in_creative_inventory=1 },
|
2012-10-04 00:53:17 +02:00
|
|
|
light_source = LIGHT_MAX,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 22:22:08 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
|
|
|
|
local node = minetest.env:get_node(pointed_thing.under)
|
|
|
|
if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then
|
|
|
|
|
|
|
|
local above = pointed_thing.above
|
|
|
|
local under = pointed_thing.under
|
|
|
|
local pitch = placer:get_look_pitch()
|
|
|
|
local node = minetest.env:get_node(above)
|
|
|
|
|
|
|
|
if node.name ~= "air" then return end
|
|
|
|
|
|
|
|
if above.x ~= under.x or above.z ~= under.z then
|
|
|
|
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_yellow_wall', param2 = fdir})
|
|
|
|
else
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_yellow'})
|
|
|
|
end
|
2013-04-17 09:14:09 +02:00
|
|
|
if not homedecor_expect_infinite_stacks then
|
2013-04-14 22:22:08 +02:00
|
|
|
itemstack:take_item()
|
2013-04-17 08:47:49 +02:00
|
|
|
return itemstack
|
2013-04-14 22:22:08 +02:00
|
|
|
end
|
|
|
|
else
|
|
|
|
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer)
|
|
|
|
end
|
|
|
|
end,
|
2013-04-14 21:45:21 +02:00
|
|
|
drop = 'homedecor:glowlight_thick_yellow'
|
2012-10-04 00:53:17 +02:00
|
|
|
})
|
|
|
|
|
2012-10-02 01:22:54 +02:00
|
|
|
minetest.register_node('homedecor:glowlight_thin_yellow', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("Yellow Glowlight (thin)"),
|
2012-10-02 01:22:54 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
|
|
|
'homedecor_glowlight_yellow_tb.png',
|
|
|
|
'homedecor_glowlight_yellow_tb.png',
|
|
|
|
'homedecor_glowlight_thin_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thin_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thin_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thin_yellow_sides.png'
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, 0.25, -0.5, 0.5, 0.5, 0.5 }
|
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, 0.25, -0.5, 0.5, 0.5, 0.5 }
|
|
|
|
},
|
|
|
|
|
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
|
|
|
walkable = true,
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
light_source = LIGHT_MAX-1,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 21:45:21 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
|
|
|
|
local node = minetest.env:get_node(pointed_thing.under)
|
|
|
|
if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then
|
|
|
|
|
|
|
|
local above = pointed_thing.above
|
|
|
|
local under = pointed_thing.under
|
|
|
|
local pitch = placer:get_look_pitch()
|
|
|
|
local node = minetest.env:get_node(above)
|
|
|
|
|
|
|
|
if node.name ~= "air" then return end
|
|
|
|
|
|
|
|
if above.x ~= under.x or above.z ~= under.z then
|
|
|
|
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_yellow_wall', param2 = fdir})
|
|
|
|
else
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_yellow'})
|
|
|
|
end
|
2013-04-17 09:14:09 +02:00
|
|
|
if not homedecor_expect_infinite_stacks then
|
2013-04-14 21:45:21 +02:00
|
|
|
itemstack:take_item()
|
2013-04-17 08:47:49 +02:00
|
|
|
return itemstack
|
2013-04-14 21:45:21 +02:00
|
|
|
end
|
|
|
|
else
|
|
|
|
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer)
|
|
|
|
end
|
|
|
|
end
|
2012-10-02 01:22:54 +02:00
|
|
|
})
|
|
|
|
|
2012-10-04 00:53:17 +02:00
|
|
|
minetest.register_node('homedecor:glowlight_thin_yellow_wall', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("Yellow Glowlight (thin, on wall)"),
|
2012-10-04 00:53:17 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
|
|
|
'homedecor_glowlight_thin_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thin_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_thin_yellow_wall_sides.png',
|
|
|
|
'homedecor_glowlight_thin_yellow_wall_sides.png',
|
|
|
|
'homedecor_glowlight_yellow_tb.png',
|
|
|
|
'homedecor_glowlight_yellow_tb.png'
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, -0.5, 0.25, 0.5, 0.5, 0.5 }
|
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, -0.5, 0.25, 0.5, 0.5, 0.5 }
|
|
|
|
},
|
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
walkable = true,
|
2013-04-14 21:45:21 +02:00
|
|
|
groups = { snappy = 3, not_in_creative_inventory=1 },
|
2012-10-04 00:53:17 +02:00
|
|
|
light_source = LIGHT_MAX-1,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 22:22:08 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
|
|
|
|
local node = minetest.env:get_node(pointed_thing.under)
|
|
|
|
if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then
|
|
|
|
|
|
|
|
local above = pointed_thing.above
|
|
|
|
local under = pointed_thing.under
|
|
|
|
local pitch = placer:get_look_pitch()
|
|
|
|
local node = minetest.env:get_node(above)
|
|
|
|
|
|
|
|
if node.name ~= "air" then return end
|
|
|
|
|
|
|
|
if above.x ~= under.x or above.z ~= under.z then
|
|
|
|
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_yellow_wall', param2 = fdir})
|
|
|
|
else
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_yellow'})
|
|
|
|
end
|
2013-04-17 09:14:09 +02:00
|
|
|
if not homedecor_expect_infinite_stacks then
|
2013-04-14 22:22:08 +02:00
|
|
|
itemstack:take_item()
|
2013-04-17 08:47:49 +02:00
|
|
|
return itemstack
|
2013-04-14 22:22:08 +02:00
|
|
|
end
|
|
|
|
else
|
|
|
|
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer)
|
|
|
|
end
|
|
|
|
end,
|
2013-04-14 21:45:21 +02:00
|
|
|
drop = 'homedecor:glowlight_thin_yellow'
|
2012-10-04 00:53:17 +02:00
|
|
|
})
|
|
|
|
|
2012-10-02 01:22:54 +02:00
|
|
|
minetest.register_node('homedecor:glowlight_small_cube_yellow', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("Yellow Glowlight (small cube)"),
|
2012-10-02 01:22:54 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
|
|
|
'homedecor_glowlight_cube_yellow_tb.png',
|
|
|
|
'homedecor_glowlight_cube_yellow_tb.png',
|
|
|
|
'homedecor_glowlight_cube_yellow_sides.png',
|
|
|
|
'homedecor_glowlight_cube_yellow_sides.png',
|
|
|
|
'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",
|
|
|
|
walkable = true,
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
light_source = LIGHT_MAX-1,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 21:45:21 +02:00
|
|
|
|
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
|
|
|
|
local node = minetest.env:get_node(pointed_thing.under)
|
|
|
|
if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then
|
|
|
|
|
|
|
|
local above = pointed_thing.above
|
|
|
|
local under = pointed_thing.under
|
|
|
|
local pitch = placer:get_look_pitch()
|
|
|
|
local node = minetest.env:get_node(above)
|
|
|
|
|
|
|
|
if node.name ~= "air" then return end
|
|
|
|
|
|
|
|
if above.x == under.x and above.z == under.z and pitch > 0 then
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_yellow_ceiling'})
|
|
|
|
else
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_yellow'})
|
|
|
|
end
|
2013-04-17 09:14:09 +02:00
|
|
|
if not homedecor_expect_infinite_stacks then
|
2013-04-14 21:45:21 +02:00
|
|
|
itemstack:take_item()
|
2013-04-17 08:47:49 +02:00
|
|
|
return itemstack
|
2013-04-14 21:45:21 +02:00
|
|
|
end
|
|
|
|
else
|
|
|
|
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer)
|
|
|
|
end
|
|
|
|
end
|
2012-10-02 01:22:54 +02:00
|
|
|
})
|
|
|
|
|
2012-10-02 03:06:10 +02:00
|
|
|
minetest.register_node('homedecor:glowlight_small_cube_yellow_ceiling', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("Yellow Glowlight (small cube, on ceiling)"),
|
2012-10-02 03:06:10 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
|
|
|
'homedecor_glowlight_cube_yellow_tb.png',
|
|
|
|
'homedecor_glowlight_cube_yellow_tb.png',
|
|
|
|
'homedecor_glowlight_cube_yellow_sides_ceiling.png',
|
|
|
|
'homedecor_glowlight_cube_yellow_sides_ceiling.png',
|
|
|
|
'homedecor_glowlight_cube_yellow_sides_ceiling.png',
|
|
|
|
'homedecor_glowlight_cube_yellow_sides_ceiling.png'
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.25, 0, -0.25, 0.25, 0.5, 0.25 }
|
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.25, 0, -0.25, 0.25, 0.5, 0.25 }
|
|
|
|
},
|
|
|
|
|
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
|
|
|
walkable = true,
|
2013-04-14 21:45:21 +02:00
|
|
|
groups = { snappy = 3, not_in_creative_inventory=1 },
|
2012-10-02 03:06:10 +02:00
|
|
|
light_source = LIGHT_MAX-1,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 22:22:08 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
|
|
|
|
local node = minetest.env:get_node(pointed_thing.under)
|
|
|
|
if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then
|
|
|
|
|
|
|
|
local above = pointed_thing.above
|
|
|
|
local under = pointed_thing.under
|
|
|
|
local pitch = placer:get_look_pitch()
|
|
|
|
local node = minetest.env:get_node(above)
|
|
|
|
|
|
|
|
if node.name ~= "air" then return end
|
|
|
|
|
|
|
|
if above.x == under.x and above.z == under.z and pitch > 0 then
|
2013-04-17 09:14:09 +02:00
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_yellow_ceiling'})
|
2013-04-14 22:22:08 +02:00
|
|
|
else
|
2013-04-17 09:14:09 +02:00
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_yellow'})
|
2013-04-14 22:22:08 +02:00
|
|
|
end
|
2013-04-17 09:14:09 +02:00
|
|
|
if not homedecor_expect_infinite_stacks then
|
2013-04-14 22:22:08 +02:00
|
|
|
itemstack:take_item()
|
2013-04-17 08:47:49 +02:00
|
|
|
return itemstack
|
2013-04-14 22:22:08 +02:00
|
|
|
end
|
|
|
|
else
|
|
|
|
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer)
|
|
|
|
end
|
|
|
|
end,
|
2013-04-14 21:45:21 +02:00
|
|
|
drop = "homedecor:glowlight_small_cube_yellow",
|
2012-10-02 03:06:10 +02:00
|
|
|
})
|
|
|
|
|
2012-10-02 01:22:54 +02:00
|
|
|
-- White
|
|
|
|
|
|
|
|
minetest.register_node('homedecor:glowlight_thick_white', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("White Glowlight (thick)"),
|
2012-10-02 01:22:54 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
|
|
|
'homedecor_glowlight_white_tb.png',
|
|
|
|
'homedecor_glowlight_white_tb.png',
|
|
|
|
'homedecor_glowlight_thick_white_sides.png',
|
|
|
|
'homedecor_glowlight_thick_white_sides.png',
|
|
|
|
'homedecor_glowlight_thick_white_sides.png',
|
|
|
|
'homedecor_glowlight_thick_white_sides.png'
|
|
|
|
},
|
|
|
|
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 }
|
|
|
|
},
|
|
|
|
|
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
|
|
|
walkable = true,
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
light_source = LIGHT_MAX,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 21:45:21 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
|
|
|
|
local node = minetest.env:get_node(pointed_thing.under)
|
|
|
|
if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then
|
|
|
|
|
|
|
|
local above = pointed_thing.above
|
|
|
|
local under = pointed_thing.under
|
|
|
|
local pitch = placer:get_look_pitch()
|
|
|
|
local node = minetest.env:get_node(above)
|
|
|
|
|
|
|
|
if node.name ~= "air" then return end
|
|
|
|
|
|
|
|
if above.x ~= under.x or above.z ~= under.z then
|
|
|
|
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_white_wall', param2 = fdir})
|
|
|
|
else
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_white'})
|
|
|
|
end
|
2013-04-17 09:14:09 +02:00
|
|
|
if not homedecor_expect_infinite_stacks then
|
2013-04-14 21:45:21 +02:00
|
|
|
itemstack:take_item()
|
2013-04-17 08:47:49 +02:00
|
|
|
return itemstack
|
2013-04-14 21:45:21 +02:00
|
|
|
end
|
|
|
|
else
|
|
|
|
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer)
|
|
|
|
end
|
|
|
|
end
|
2012-10-02 01:22:54 +02:00
|
|
|
})
|
|
|
|
|
2012-10-04 00:53:17 +02:00
|
|
|
minetest.register_node('homedecor:glowlight_thick_white_wall', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("White Glowlight (thick, on wall)"),
|
2012-10-04 00:53:17 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
|
|
|
'homedecor_glowlight_thick_white_sides.png',
|
|
|
|
'homedecor_glowlight_thick_white_sides.png',
|
|
|
|
'homedecor_glowlight_thick_white_wall_sides.png',
|
|
|
|
'homedecor_glowlight_thick_white_wall_sides.png',
|
|
|
|
'homedecor_glowlight_white_tb.png',
|
|
|
|
'homedecor_glowlight_white_tb.png'
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }
|
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, -0.5, 0, 0.5, 0.5, 0.5 }
|
|
|
|
},
|
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
walkable = true,
|
2013-04-14 21:45:21 +02:00
|
|
|
groups = { snappy = 3, not_in_creative_inventory=1 },
|
2012-10-04 00:53:17 +02:00
|
|
|
light_source = LIGHT_MAX,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 22:22:08 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
|
|
|
|
local node = minetest.env:get_node(pointed_thing.under)
|
|
|
|
if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then
|
|
|
|
|
|
|
|
local above = pointed_thing.above
|
|
|
|
local under = pointed_thing.under
|
|
|
|
local pitch = placer:get_look_pitch()
|
|
|
|
local node = minetest.env:get_node(above)
|
|
|
|
|
|
|
|
if node.name ~= "air" then return end
|
|
|
|
|
|
|
|
if above.x ~= under.x or above.z ~= under.z then
|
|
|
|
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_white_wall', param2 = fdir})
|
|
|
|
else
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thick_white'})
|
|
|
|
end
|
2013-04-17 09:14:09 +02:00
|
|
|
if not homedecor_expect_infinite_stacks then
|
2013-04-14 22:22:08 +02:00
|
|
|
itemstack:take_item()
|
2013-04-17 08:47:49 +02:00
|
|
|
return itemstack
|
2013-04-14 22:22:08 +02:00
|
|
|
end
|
|
|
|
else
|
|
|
|
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer)
|
|
|
|
end
|
|
|
|
end,
|
2013-04-14 21:45:21 +02:00
|
|
|
drop = 'homedecor:glowlight_thick_white'
|
2012-10-04 00:53:17 +02:00
|
|
|
})
|
|
|
|
|
2012-10-02 01:22:54 +02:00
|
|
|
minetest.register_node('homedecor:glowlight_thin_white', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("White Glowlight (thin)"),
|
2012-10-02 01:22:54 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
|
|
|
'homedecor_glowlight_white_tb.png',
|
|
|
|
'homedecor_glowlight_white_tb.png',
|
|
|
|
'homedecor_glowlight_thin_white_sides.png',
|
|
|
|
'homedecor_glowlight_thin_white_sides.png',
|
|
|
|
'homedecor_glowlight_thin_white_sides.png',
|
|
|
|
'homedecor_glowlight_thin_white_sides.png'
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, 0.25, -0.5, 0.5, 0.5, 0.5 }
|
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, 0.25, -0.5, 0.5, 0.5, 0.5 }
|
|
|
|
},
|
|
|
|
|
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
|
|
|
walkable = true,
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
light_source = LIGHT_MAX-1,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 21:45:21 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
|
|
|
|
local node = minetest.env:get_node(pointed_thing.under)
|
|
|
|
if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then
|
|
|
|
|
|
|
|
local above = pointed_thing.above
|
|
|
|
local under = pointed_thing.under
|
|
|
|
local pitch = placer:get_look_pitch()
|
|
|
|
local node = minetest.env:get_node(above)
|
|
|
|
|
|
|
|
if node.name ~= "air" then return end
|
|
|
|
|
|
|
|
if above.x ~= under.x or above.z ~= under.z then
|
|
|
|
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_white_wall', param2 = fdir})
|
|
|
|
else
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_white'})
|
|
|
|
end
|
2013-04-17 09:14:09 +02:00
|
|
|
if not homedecor_expect_infinite_stacks then
|
2013-04-14 21:45:21 +02:00
|
|
|
itemstack:take_item()
|
2013-04-17 08:47:49 +02:00
|
|
|
return itemstack
|
2013-04-14 21:45:21 +02:00
|
|
|
end
|
|
|
|
else
|
|
|
|
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer)
|
|
|
|
end
|
|
|
|
end
|
2012-10-02 01:22:54 +02:00
|
|
|
})
|
|
|
|
|
2012-10-04 00:53:17 +02:00
|
|
|
minetest.register_node('homedecor:glowlight_thin_white_wall', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("White Glowlight (thin, on wall)"),
|
2012-10-04 00:53:17 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
|
|
|
'homedecor_glowlight_thin_white_sides.png',
|
|
|
|
'homedecor_glowlight_thin_white_sides.png',
|
|
|
|
'homedecor_glowlight_thin_white_wall_sides.png',
|
|
|
|
'homedecor_glowlight_thin_white_wall_sides.png',
|
|
|
|
'homedecor_glowlight_white_tb.png',
|
|
|
|
'homedecor_glowlight_white_tb.png'
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, -0.5, 0.25, 0.5, 0.5, 0.5 }
|
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.5, -0.5, 0.25, 0.5, 0.5, 0.5 }
|
|
|
|
},
|
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
|
|
|
paramtype2 = "facedir",
|
|
|
|
walkable = true,
|
2013-04-14 21:45:21 +02:00
|
|
|
groups = { snappy = 3, not_in_creative_inventory=1 },
|
2012-10-04 00:53:17 +02:00
|
|
|
light_source = LIGHT_MAX-1,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 22:22:08 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
|
|
|
|
local node = minetest.env:get_node(pointed_thing.under)
|
|
|
|
if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then
|
|
|
|
|
|
|
|
local above = pointed_thing.above
|
|
|
|
local under = pointed_thing.under
|
|
|
|
local pitch = placer:get_look_pitch()
|
|
|
|
local node = minetest.env:get_node(above)
|
|
|
|
|
|
|
|
if node.name ~= "air" then return end
|
|
|
|
|
|
|
|
if above.x ~= under.x or above.z ~= under.z then
|
|
|
|
local fdir = minetest.dir_to_facedir(placer:get_look_dir())
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_white_wall', param2 = fdir})
|
|
|
|
else
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_thin_white'})
|
|
|
|
end
|
2013-04-17 09:14:09 +02:00
|
|
|
if not homedecor_expect_infinite_stacks then
|
2013-04-14 22:22:08 +02:00
|
|
|
itemstack:take_item()
|
2013-04-17 08:47:49 +02:00
|
|
|
return itemstack
|
2013-04-14 22:22:08 +02:00
|
|
|
end
|
|
|
|
else
|
|
|
|
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer)
|
|
|
|
end
|
|
|
|
end,
|
2013-04-14 21:45:21 +02:00
|
|
|
drop = 'homedecor:glowlight_thin_white'
|
2012-10-04 00:53:17 +02:00
|
|
|
})
|
|
|
|
|
2012-10-02 01:22:54 +02:00
|
|
|
minetest.register_node('homedecor:glowlight_small_cube_white', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("White Glowlight (small cube)"),
|
2012-10-02 01:22:54 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
|
|
|
'homedecor_glowlight_cube_white_tb.png',
|
|
|
|
'homedecor_glowlight_cube_white_tb.png',
|
|
|
|
'homedecor_glowlight_cube_white_sides.png',
|
|
|
|
'homedecor_glowlight_cube_white_sides.png',
|
|
|
|
'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",
|
|
|
|
walkable = true,
|
|
|
|
groups = { snappy = 3 },
|
|
|
|
light_source = LIGHT_MAX-1,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 21:45:21 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
|
|
|
|
local node = minetest.env:get_node(pointed_thing.under)
|
|
|
|
if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then
|
|
|
|
|
|
|
|
local above = pointed_thing.above
|
|
|
|
local under = pointed_thing.under
|
|
|
|
local pitch = placer:get_look_pitch()
|
|
|
|
local node = minetest.env:get_node(above)
|
|
|
|
|
|
|
|
if node.name ~= "air" then return end
|
|
|
|
|
|
|
|
if above.x == under.x and above.z == under.z and pitch > 0 then
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_white_ceiling'})
|
|
|
|
else
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_white'})
|
|
|
|
end
|
2013-04-17 09:14:09 +02:00
|
|
|
if not homedecor_expect_infinite_stacks then
|
2013-04-14 21:45:21 +02:00
|
|
|
itemstack:take_item()
|
2013-04-17 08:47:49 +02:00
|
|
|
return itemstack
|
2013-04-14 21:45:21 +02:00
|
|
|
end
|
|
|
|
else
|
|
|
|
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer)
|
|
|
|
end
|
|
|
|
end
|
2012-10-02 01:22:54 +02:00
|
|
|
})
|
2012-10-02 03:06:10 +02:00
|
|
|
|
|
|
|
minetest.register_node('homedecor:glowlight_small_cube_white_ceiling', {
|
2013-03-05 08:18:56 +01:00
|
|
|
description = S("White Glowlight (small cube, on ceiling)"),
|
2012-10-02 03:06:10 +02:00
|
|
|
drawtype = "nodebox",
|
|
|
|
tiles = {
|
|
|
|
'homedecor_glowlight_cube_white_tb.png',
|
|
|
|
'homedecor_glowlight_cube_white_tb.png',
|
|
|
|
'homedecor_glowlight_cube_white_sides_ceiling.png',
|
|
|
|
'homedecor_glowlight_cube_white_sides_ceiling.png',
|
|
|
|
'homedecor_glowlight_cube_white_sides_ceiling.png',
|
|
|
|
'homedecor_glowlight_cube_white_sides_ceiling.png'
|
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.25, 0, -0.25, 0.25, 0.5, 0.25 }
|
|
|
|
},
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = { -0.25, 0, -0.25, 0.25, 0.5, 0.25 }
|
|
|
|
},
|
|
|
|
|
|
|
|
sunlight_propagates = false,
|
|
|
|
paramtype = "light",
|
|
|
|
walkable = true,
|
2013-04-14 21:45:21 +02:00
|
|
|
groups = { snappy = 3, not_in_creative_inventory=1 },
|
2012-10-02 03:06:10 +02:00
|
|
|
light_source = LIGHT_MAX-1,
|
2013-03-17 00:46:30 +01:00
|
|
|
sounds = default.node_sound_wood_defaults(),
|
2013-04-14 22:22:08 +02:00
|
|
|
on_place = function(itemstack, placer, pointed_thing)
|
|
|
|
|
|
|
|
local node = minetest.env:get_node(pointed_thing.under)
|
|
|
|
if not minetest.registered_nodes[node.name] or not minetest.registered_nodes[node.name].on_rightclick then
|
|
|
|
|
|
|
|
local above = pointed_thing.above
|
|
|
|
local under = pointed_thing.under
|
|
|
|
local pitch = placer:get_look_pitch()
|
|
|
|
local node = minetest.env:get_node(above)
|
|
|
|
|
|
|
|
if node.name ~= "air" then return end
|
|
|
|
|
|
|
|
if above.x == under.x and above.z == under.z and pitch > 0 then
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_white_ceiling'})
|
|
|
|
else
|
|
|
|
minetest.env:add_node(above, {name = 'homedecor:glowlight_small_cube_white'})
|
|
|
|
end
|
2013-04-17 09:14:09 +02:00
|
|
|
if not homedecor_expect_infinite_stacks then
|
2013-04-14 22:22:08 +02:00
|
|
|
itemstack:take_item()
|
2013-04-17 08:47:49 +02:00
|
|
|
return itemstack
|
2013-04-14 22:22:08 +02:00
|
|
|
end
|
|
|
|
else
|
|
|
|
minetest.registered_nodes[node.name].on_rightclick(pointed_thing.under, node, placer)
|
|
|
|
end
|
|
|
|
end,
|
2013-04-14 21:45:21 +02:00
|
|
|
drop = "homedecor:glowlight_small_cube_white",
|
2012-10-02 03:06:10 +02:00
|
|
|
})
|