summaryrefslogtreecommitdiff
path: root/simple_streetlights/init.lua
blob: 63ae0caf1eb03120d996c1c35db20a87fecd1d7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- simple streetlight spawner mod

local modpath = minetest.get_modpath("simple_streetlights")

streetlights = {}
streetlights.basic_materials = minetest.get_modpath("basic_materials")
streetlights.concrete =      "basic_materials:concrete_block"
streetlights.distributor =   "streets:digiline_distributor"
streetlights.vert_digiline = "digistuff:vertical_bottom"

function streetlights.rightclick_pointed_thing(pos, placer, itemstack, pointed_thing)
	local node = minetest.get_node_or_nil(pos)
	if not node then return false end
	local def = minetest.registered_nodes[node.name]
	if not def or not def.on_rightclick then return false end
	return def.on_rightclick(pos, node, placer, itemstack, pointed_thing) or itemstack
end

dofile(modpath.."/simple.lua")
if minetest.get_modpath("homedecor_lighting") and minetest.get_modpath("streetspoles") then
	dofile(modpath.."/minedot.lua")
end