summaryrefslogtreecommitdiff
path: root/simple_streetlights
diff options
context:
space:
mode:
authorVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2019-05-31 15:06:42 -0400
committerVanessa Dannenberg <vanessa.e.dannenberg@gmail.com>2019-05-31 15:06:42 -0400
commite622c96c2648ed0e9de359a23463dc528d0ef96b (patch)
tree9e06eb527452910e7e74faeeebd03b4cbfe7280f /simple_streetlights
parenteae97e458ce30e210c90290cf4c405d4282a03b7 (diff)
downloaddreambuilder_modpack-e622c96c2648ed0e9de359a23463dc528d0ef96b.tar
dreambuilder_modpack-e622c96c2648ed0e9de359a23463dc528d0ef96b.tar.gz
dreambuilder_modpack-e622c96c2648ed0e9de359a23463dc528d0ef96b.tar.bz2
dreambuilder_modpack-e622c96c2648ed0e9de359a23463dc528d0ef96b.tar.xz
dreambuilder_modpack-e622c96c2648ed0e9de359a23463dc528d0ef96b.zip
update coloredwood, homedecor, signs_lib, and simple_streetlights
Diffstat (limited to 'simple_streetlights')
-rw-r--r--simple_streetlights/depends.txt2
-rw-r--r--simple_streetlights/minedot.lua4
-rw-r--r--simple_streetlights/simple.lua72
-rw-r--r--simple_streetlights/textures/simple_streetlights_inv_pole_distributor_overlay.pngbin0 -> 845 bytes
4 files changed, 72 insertions, 6 deletions
diff --git a/simple_streetlights/depends.txt b/simple_streetlights/depends.txt
index 8ef9489..0cd9259 100644
--- a/simple_streetlights/depends.txt
+++ b/simple_streetlights/depends.txt
@@ -6,4 +6,6 @@ gloopblocks?
homedecor_fences?
homedecor_lighting?
streetspoles?
+streets_trafficlight?
+trafficlight?
digilines?
diff --git a/simple_streetlights/minedot.lua b/simple_streetlights/minedot.lua
index e8f8141..d9f6c9d 100644
--- a/simple_streetlights/minedot.lua
+++ b/simple_streetlights/minedot.lua
@@ -75,11 +75,11 @@ local function place(itemstack,player,pointed)
elseif facedir.z == 1 then schemDir = 90
elseif facedir.z == -1 then schemDir = 270 end
local offset = offsets[isDouble and "double" or "single"][schemDir]
- local pos = vector.add(pos,offset)
- minetest.place_schematic(pos,isDouble and schems.double or schems.single,schemDir,nil,false)
if sneak and streetlights.basic_materials then
minetest.set_node({x=pos.x, y=pos.y-1, z=pos.z}, {name = streetlights.concrete})
end
+ local pos = vector.add(pos,offset)
+ minetest.place_schematic(pos,isDouble and schems.double or schems.single,schemDir,nil,false)
end
minetest.register_tool(":minedot_streetlights:spawner_single",{
diff --git a/simple_streetlights/simple.lua b/simple_streetlights/simple.lua
index 3d7bcdb..95eff25 100644
--- a/simple_streetlights/simple.lua
+++ b/simple_streetlights/simple.lua
@@ -65,7 +65,7 @@ minetest.register_privilege("streetlight", {
give_to_singleplayer = true
})
-local function check_and_place(itemstack, placer, pointed_thing, pole, light, param2, needs_digiline_wire)
+local function check_and_place(itemstack, placer, pointed_thing, pole, light, param2, needs_digiline_wire, needs_distributor)
local controls = placer:get_player_control()
if not placer then return end
local playername = placer:get_player_name()
@@ -117,7 +117,7 @@ local function check_and_place(itemstack, placer, pointed_thing, pole, light, pa
if minetest.is_protected(pos4, player_name) or not (def3 and def4.buildable_to) then return end
if controls.sneak and minetest.is_protected(pos1, player_name) then return end
- if controls.aux1 and minetest.is_protected(pos0, player_name) then return end
+ if needs_distributor and minetest.is_protected(pos0, player_name) then return end
if not creative.is_enabled_for(player_name) then
local inv = placer:get_inventory()
@@ -145,7 +145,7 @@ local function check_and_place(itemstack, placer, pointed_thing, pole, light, pa
end
end
- if controls.aux1 and needs_digiline_wire then
+ if needs_distributor and needs_digiline_wire then
if not inv:contains_item("main", streetlights.distributor) then
minetest.chat_send_player(playername, "*** You don't have any Digiline distributors in your inventory!")
return
@@ -163,7 +163,7 @@ local function check_and_place(itemstack, placer, pointed_thing, pole, light, pa
end
- if controls.aux1 and needs_digiline_wire then
+ if needs_distributor and needs_digiline_wire then
minetest.set_node(pos0, { name = streetlights.distributor })
end
@@ -250,6 +250,9 @@ for _, pole in ipairs(poles_tab) do
{items = { matnode.."_digilines" } },
}
}
+ def.palette = nil -- if the coloredwood mod exists and loads first, it'll create these
+ def.groups.ud_param2_colorable = nil -- settings, which we don't want in the cloned node.
+
minetest.register_node(":"..matnode.."_digilines", def)
minetest.register_craft({
@@ -290,6 +293,7 @@ for _, pole in ipairs(poles_tab) do
})
if enable_digilines and minetest.registered_nodes[lightnode].digiline then
+
minetest.register_tool("simple_streetlights:spawner_"..matname.."_"..lightname.."_digilines", {
description = "Streetlight spawner ("..matname.." pole, with "..lightname..", digilines conducting pole)",
inventory_image = "simple_streetlights_inv_pole_"..matname..".png"..
@@ -317,6 +321,66 @@ for _, pole in ipairs(poles_tab) do
digiline_wire_node,
}
})
+
+ minetest.register_craft({
+ output = "simple_streetlights:spawner_"..matname.."_"..lightname.."_digilines",
+ type = "shapeless",
+ recipe = {
+ "simple_streetlights:spawner_"..matname.."_"..lightname,
+ digiline_wire_node
+ }
+ })
+
+ if minetest.registered_items[streetlights.distributor] then
+ minetest.register_tool("simple_streetlights:spawner_"..matname.."_"..lightname.."_digilines_distributor", {
+ description = "Streetlight spawner ("..matname.." pole, with "..lightname..", digilines conducting pole, with distributor 2m below)",
+ inventory_image = "simple_streetlights_inv_pole_"..matname..".png"..
+ "^simple_streetlights_inv_pole_digiline_overlay.png"..
+ "^simple_streetlights_inv_pole_distributor_overlay.png"..
+ "^simple_streetlights_inv_light_source_"..lightname..".png",
+ use_texture_alpha = true,
+ tool_capabilities = { full_punch_interval=0.1 },
+ on_place = function(itemstack, placer, pointed_thing)
+ check_and_place(itemstack, placer, pointed_thing, matnode, lightnode, lightparam2, true, true)
+ end,
+ on_use = ilights.digiline_on_use
+ })
+
+ minetest.register_craft({
+ output = "simple_streetlights:spawner_"..matname.."_"..lightname.."_digilines_distributor",
+ type = "shapeless",
+ recipe = {
+ matnode,
+ matnode,
+ matnode,
+ matnode,
+ matnode,
+ matnode,
+ lightnode,
+ digiline_wire_node,
+ streetlights.distributor
+ }
+ })
+
+ minetest.register_craft({
+ output = "simple_streetlights:spawner_"..matname.."_"..lightname.."_digilines_distributor",
+ type = "shapeless",
+ recipe = {
+ "simple_streetlights:spawner_"..matname.."_"..lightname,
+ digiline_wire_node,
+ streetlights.distributor
+ }
+ })
+
+ minetest.register_craft({
+ output = "simple_streetlights:spawner_"..matname.."_"..lightname.."_digilines_distributor",
+ type = "shapeless",
+ recipe = {
+ "simple_streetlights:spawner_"..matname.."_"..lightname.."_digilines",
+ streetlights.distributor
+ }
+ })
+ end
end
end
end
diff --git a/simple_streetlights/textures/simple_streetlights_inv_pole_distributor_overlay.png b/simple_streetlights/textures/simple_streetlights_inv_pole_distributor_overlay.png
new file mode 100644
index 0000000..7e59c57
--- /dev/null
+++ b/simple_streetlights/textures/simple_streetlights_inv_pole_distributor_overlay.png
Binary files differ