2013-08-16 19:39:31 +02:00
|
|
|
--[[
|
|
|
|
StreetsMod: Streetlamps
|
|
|
|
]]
|
2013-11-24 13:34:27 +01:00
|
|
|
--[[minetest.register_node(":streets:streetlamp_basic_controller",{
|
2014-05-19 21:27:47 +02:00
|
|
|
description = streets.S("Trafficlight"),
|
2013-10-14 12:23:07 +02:00
|
|
|
tiles = {"streets_lampcontroller_top.png","streets_lampcontroller_bottom.png","streets_lampcontroller_sides.png"},
|
|
|
|
groups = {cracky = 1, not_in_creative_inventory = 1},
|
2013-08-16 19:39:31 +02:00
|
|
|
drawtype = "nodebox",
|
2013-10-14 12:23:07 +02:00
|
|
|
paramtype = "light",
|
2013-08-16 19:39:31 +02:00
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
2013-10-14 12:23:07 +02:00
|
|
|
{-0.5,-0.5,-0.5,0.5,0.5,0.5},
|
|
|
|
{-0.05,0.5,-0.05,0.05,1.6,0.05}
|
2013-08-16 19:39:31 +02:00
|
|
|
}
|
|
|
|
},
|
2013-10-14 12:23:07 +02:00
|
|
|
selection_box = {
|
2013-10-13 12:42:17 +02:00
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
2013-10-14 12:23:07 +02:00
|
|
|
{-0.5,-0.5,-0.5,0.5,0.5,0.5},
|
|
|
|
{-0.3,1.5,-0.3,0.3,4.5,0.3}
|
2013-10-13 12:42:17 +02:00
|
|
|
}
|
|
|
|
},
|
2013-08-16 19:39:31 +02:00
|
|
|
mesecons = {
|
|
|
|
effector = {
|
|
|
|
action_on = function(pos,node)
|
2013-10-14 12:23:07 +02:00
|
|
|
minetest.set_node({x = pos.x, y = pos.y + 4, z = pos.z},{name = "streets:streetlamp_basic_top_on"})
|
2013-08-16 19:39:31 +02:00
|
|
|
end,
|
|
|
|
action_off = function(pos,node)
|
2013-10-14 12:23:07 +02:00
|
|
|
minetest.set_node({x = pos.x, y = pos.y + 4, z = pos.z},{name = "streets:streetlamp_basic_top_off"})
|
2013-08-16 19:39:31 +02:00
|
|
|
end
|
|
|
|
}
|
2013-10-14 12:23:07 +02:00
|
|
|
},
|
|
|
|
after_dig_node = function(pos)
|
|
|
|
minetest.remove_node({x = pos.x, y = pos.y + 2, z = pos.z})
|
|
|
|
minetest.remove_node({x = pos.x, y = pos.y + 3, z = pos.z})
|
|
|
|
minetest.remove_node({x = pos.x, y = pos.y + 4, z = pos.z})
|
|
|
|
minetest.chat_send_all("!!!")
|
|
|
|
end
|
2013-11-24 13:34:27 +01:00
|
|
|
})]]
|
|
|
|
|
2013-10-14 12:23:07 +02:00
|
|
|
minetest.register_node(":streets:streetlamp_basic_bottom",{
|
2013-10-19 14:49:06 +02:00
|
|
|
drop = "",
|
2014-05-19 21:27:47 +02:00
|
|
|
description = streets.S("Street lamp"),
|
2013-10-14 12:23:07 +02:00
|
|
|
tiles = {"streets_lamps_basic_bottom.png"},
|
2013-11-24 19:52:14 +01:00
|
|
|
inventory_image = "streets_lamps_basi_inv.png",
|
2013-10-14 12:23:07 +02:00
|
|
|
groups = {cracky = 1},
|
|
|
|
paramtype = "light",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.15,-0.5,-0.15,0.15,0.4,0.15},
|
|
|
|
{-0.1,0.4,-0.1,0.1,0.5,0.1}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
pointable = false,
|
|
|
|
after_place_node = function(pos,placer,itemstack)
|
|
|
|
minetest.set_node({x = pos.x, y = pos.y + 1, z = pos.z},{name = "streets:streetlamp_basic_middle"})
|
2013-11-24 13:34:27 +01:00
|
|
|
minetest.set_node({x = pos.x, y = pos.y + 2, z = pos.z},{name = "streets:streetlamp_basic_top_on"})
|
|
|
|
-- minetest.set_node({x = pos.x, y = pos.y - 2, z = pos.z},{name = "streets:streetlamp_basic_controller"})
|
2013-10-14 12:23:07 +02:00
|
|
|
end
|
2013-08-16 19:39:31 +02:00
|
|
|
})
|
|
|
|
minetest.register_node(":streets:streetlamp_basic_middle",{
|
2013-10-19 14:49:06 +02:00
|
|
|
drop = "",
|
2014-05-19 21:27:47 +02:00
|
|
|
description = streets.S("U cheater U"),
|
2013-08-16 19:39:31 +02:00
|
|
|
groups = {cracky = 1, not_in_creative_inventory = 1},
|
2013-10-12 11:49:48 +02:00
|
|
|
tiles = {"streets_lamps_basic_middle.png"},
|
2013-08-16 19:39:31 +02:00
|
|
|
paramtype = "light",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
pointable = false,
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.1,-0.5,-0.1,0.1,0.5,0.1}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
2013-11-24 13:34:27 +01:00
|
|
|
--[[minetest.register_node(":streets:streetlamp_basic_top_off",{
|
2013-10-19 14:49:06 +02:00
|
|
|
drop = "",
|
2014-05-19 21:27:47 +02:00
|
|
|
description = streets.S("U cheater U"),
|
2013-08-16 19:39:31 +02:00
|
|
|
groups = {cracky = 1, not_in_creative_inventory = 1},
|
|
|
|
paramtype = "light",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
pointable = false,
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.1,-0.5,-0.1,0.1,-0.4,0.1},
|
|
|
|
{-0.3,-0.4,-0.3,0.3,0.5,0.3}
|
|
|
|
}
|
|
|
|
}
|
2013-11-24 13:34:27 +01:00
|
|
|
})]]
|
2013-08-16 19:39:31 +02:00
|
|
|
minetest.register_node(":streets:streetlamp_basic_top_on",{
|
2013-11-27 18:23:34 +01:00
|
|
|
drop = "streets:streetlamp_basic_bottom",
|
2014-05-19 21:27:47 +02:00
|
|
|
description = streets.S("U cheater U"),
|
2013-08-16 19:39:31 +02:00
|
|
|
groups = {cracky = 1, not_in_creative_inventory = 1},
|
2013-10-13 12:42:17 +02:00
|
|
|
tiles = {"streets_lamps_basic_top_top.png","streets_lamps_basic_top_top.png","streets_lamps_basic_top.png","streets_lamps_basic_top.png","streets_lamps_basic_top.png","streets_lamps_basic_top.png"},
|
2013-08-16 19:39:31 +02:00
|
|
|
paramtype = "light",
|
|
|
|
drawtype = "nodebox",
|
|
|
|
light_source = 10,
|
|
|
|
node_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.1,-0.5,-0.1,0.1,-0.4,0.1},
|
|
|
|
{-0.3,-0.4,-0.3,0.3,0.5,0.3}
|
|
|
|
}
|
2013-11-24 13:34:27 +01:00
|
|
|
},
|
|
|
|
selection_box = {
|
|
|
|
type = "fixed",
|
|
|
|
fixed = {
|
|
|
|
{-0.3,0.5,-0.3,0.3,-2.5,0.3},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
after_dig_node = function(pos)
|
|
|
|
minetest.remove_node({x = pos.x, y = pos.y - 1, z = pos.z})
|
|
|
|
minetest.remove_node({x = pos.x, y = pos.y - 2, z = pos.z})
|
|
|
|
end
|
2013-11-24 13:40:15 +01:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = "streets:streetlamp_basic_bottom",
|
|
|
|
recipe = {
|
2016-01-09 15:01:34 -06:00
|
|
|
{"default:glass","default:torch","default:glass"},
|
|
|
|
{"","streets:bigpole",""},
|
|
|
|
{"","streets:bigpole",""}
|
2013-11-24 13:40:15 +01:00
|
|
|
}
|
2016-01-09 15:01:34 -06:00
|
|
|
})
|