summaryrefslogtreecommitdiff
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
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
-rw-r--r--coloredwood/init.lua16
-rw-r--r--homedecor_electrical/init.lua7
-rw-r--r--signs_lib/init.lua1
-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
7 files changed, 89 insertions, 13 deletions
diff --git a/coloredwood/init.lua b/coloredwood/init.lua
index d8ee327..a1d8a1a 100644
--- a/coloredwood/init.lua
+++ b/coloredwood/init.lua
@@ -51,6 +51,10 @@ end
-- the actual nodes!
+local groups = table.copy(minetest.registered_items["default:wood"].groups)
+groups.ud_param2_colorable = 1
+groups.not_in_creative_inventory=1
+
minetest.register_node("coloredwood:wood_block", {
description = "Colored wooden planks",
tiles = { "coloredwood_base.png" },
@@ -59,7 +63,7 @@ minetest.register_node("coloredwood:wood_block", {
palette = "unifieddyes_palette_extended.png",
walkable = true,
sunlight_propagates = false,
- groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2, not_in_creative_inventory=1, ud_param2_colorable = 1},
+ groups = groups,
sounds = default.node_sound_wood_defaults(),
})
@@ -147,10 +151,13 @@ for _, mname in ipairs(coloredwood_cuts) do
})
end
+groups = table.copy(minetest.registered_items["default:wood"].groups)
+groups.ud_param2_colorable = 1
+
minetest.override_item("default:wood", {
palette = "unifieddyes_palette_extended.png",
airbrush_replacement_node = "coloredwood:wood_block",
- groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, ud_param2_colorable = 1},
+ groups = groups,
})
default.register_fence("coloredwood:fence", {
@@ -163,10 +170,13 @@ default.register_fence("coloredwood:fence", {
material = "coloredwood:wood_block"
})
+groups = table.copy(minetest.registered_items["default:fence_wood"].groups)
+groups.ud_param2_colorable = 1
+
minetest.override_item("default:fence_wood", {
palette = "unifieddyes_palette_extended.png",
airbrush_replacement_node = "coloredwood:fence",
- groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, ud_param2_colorable = 1}
+ groups = groups
})
-- Crafts
diff --git a/homedecor_electrical/init.lua b/homedecor_electrical/init.lua
index 53c7fbb..a33451b 100644
--- a/homedecor_electrical/init.lua
+++ b/homedecor_electrical/init.lua
@@ -2,9 +2,10 @@
local S = homedecor.gettext
function homedecor.toggle_switch(pos, node, clicker, itemstack, pointed_thing)
- if minetest.is_protected(pos, clicker:get_player_name()) then
- minetest.record_protection_violation(pos,
- sender:get_player_name())
+ if not clicker then return false end
+ local playername = clicker:get_player_name()
+ if minetest.is_protected(pos, playername) then
+ minetest.record_protection_violation(pos, playername)
return false
end
local sep = string.find(node.name, "_o", -5)
diff --git a/signs_lib/init.lua b/signs_lib/init.lua
index d1070be..b399d07 100644
--- a/signs_lib/init.lua
+++ b/signs_lib/init.lua
@@ -1109,7 +1109,6 @@ function signs_lib.register_fence_with_sign(fencename, fencewithsignname)
def_sign.on_rotate = signs_lib.facedir_rotate_simple
def_sign.drop = default_sign
- minetest.register_node(":"..fencename, def)
minetest.register_node(":"..fencewithsignname, def_sign)
table.insert(signs_lib.sign_node_list, fencewithsignname)
minetest.log("verbose", S("Registered @1 and @2", fencename, fencewithsignname))
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