started development of a streetlamp
This commit is contained in:
parent
812c480227
commit
3d2362b30b
3
streetlamps/depends.txt
Normal file
3
streetlamps/depends.txt
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
default
|
||||||
|
streetsmod
|
||||||
|
mesecons?
|
72
streetlamps/init.lua
Normal file
72
streetlamps/init.lua
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
--[[
|
||||||
|
StreetsMod: Streetlamps
|
||||||
|
]]
|
||||||
|
minetest.register_node(":streets:streetlamp_basic_bottom",{
|
||||||
|
description = "Street lamp",
|
||||||
|
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}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
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"})
|
||||||
|
minetest.set_node({x = pos.x, y = pos.y + 2, z = pos.z},{name = "streets:streetlamp_basic_top_off"})
|
||||||
|
end,
|
||||||
|
mesecons = {
|
||||||
|
effector = {
|
||||||
|
action_on = function(pos,node)
|
||||||
|
minetest.set_node({x = pos.x, y = pos.y + 2, z = pos.z},{name = "streets:streetlamp_basic_top_on"})
|
||||||
|
end,
|
||||||
|
action_off = function(pos,node)
|
||||||
|
minetest.set_node({x = pos.x, y = pos.y + 2, z = pos.z},{name = "streets:streetlamp_basic_top_off"})
|
||||||
|
end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
minetest.register_node(":streets:streetlamp_basic_middle",{
|
||||||
|
description = "U cheater U",
|
||||||
|
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.5,0.1}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
minetest.register_node(":streets:streetlamp_basic_top_off",{
|
||||||
|
description = "U cheater U",
|
||||||
|
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}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
minetest.register_node(":streets:streetlamp_basic_top_on",{
|
||||||
|
description = "U cheater U",
|
||||||
|
groups = {cracky = 1, not_in_creative_inventory = 1},
|
||||||
|
paramtype = "light",
|
||||||
|
drawtype = "nodebox",
|
||||||
|
pointable = false,
|
||||||
|
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}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
@ -43,10 +43,10 @@
|
|||||||
streets.extendedBy.bucket = false
|
streets.extendedBy.bucket = false
|
||||||
end
|
end
|
||||||
if minetest.get_modpath("mesecons") then
|
if minetest.get_modpath("mesecons") then
|
||||||
print("'Mesecons' is installed \n\t => Trafficlights might be available. Checking for digilines.")
|
print("'Mesecons' is installed \n\t => Trafficlights might be available. Checking for digilines. Streetlamps available")
|
||||||
streets.extendedBy.mesecons = true
|
streets.extendedBy.mesecons = true
|
||||||
else
|
else
|
||||||
print("'Mesecons' not installed \n\t => No trafficlight, sorry.")
|
print("'Mesecons' not installed \n\t => No trafficlight and streetlamps, sorry.")
|
||||||
streets.extendedBy.mesecons = false
|
streets.extendedBy.mesecons = false
|
||||||
end
|
end
|
||||||
if minetest.get_modpath("digilines") then
|
if minetest.get_modpath("digilines") then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user