summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeija <norrepli@gmail.com>2016-04-26 19:42:34 +0200
committerJeija <norrepli@gmail.com>2016-04-26 19:44:05 +0200
commit4249ed4986fd614019c0350de1808041b15a32cc (patch)
tree0e54705f17879aea0148c46c070480dfda173a91
parentc4f0c5c1694a5c5c47ff4f6ca9d3259851b33dfa (diff)
downloadmesecons-4249ed4986fd614019c0350de1808041b15a32cc.tar
mesecons-4249ed4986fd614019c0350de1808041b15a32cc.tar.gz
mesecons-4249ed4986fd614019c0350de1808041b15a32cc.tar.bz2
mesecons-4249ed4986fd614019c0350de1808041b15a32cc.tar.xz
mesecons-4249ed4986fd614019c0350de1808041b15a32cc.zip
Mese as conductor: Fix light source, make code more flexible
Closes #265
-rw-r--r--mesecons_extrawires/mesewire.lua18
1 files changed, 12 insertions, 6 deletions
diff --git a/mesecons_extrawires/mesewire.lua b/mesecons_extrawires/mesewire.lua
index 150178c..3640de8 100644
--- a/mesecons_extrawires/mesewire.lua
+++ b/mesecons_extrawires/mesewire.lua
@@ -16,15 +16,21 @@ minetest.override_item("default:mese", {
}}
})
-minetest.register_node("mesecons_extrawires:mese_powered", {
- tiles = {minetest.registered_nodes["default:mese"].tiles[1].."^[brighten"},
- is_ground_content = true,
- groups = {cracky=1, not_in_creative_inventory = 1},
- sounds = default.node_sound_stone_defaults(),
+-- Copy node definition of powered mese from normal mese
+-- and brighten texture tiles to indicate mese is powered
+local powered_def = mesecon.mergetable(minetest.registered_nodes["default:mese"], {
+ drop = "default:mese",
+ light_source = 5,
mesecons = {conductor = {
state = mesecon.state.on,
offstate = "default:mese",
rules = mesewire_rules
}},
- drop = "default:mese"
+ groups = {cracky = 1, not_in_creative_inventory = 1}
})
+
+for i, v in pairs(powered_def.tiles) do
+ powered_def.tiles[i] = v .. "^[brighten"
+end
+
+minetest.register_node("mesecons_extrawires:mese_powered", powered_def)