Mese as conductor: Fix light source, make code more flexible

Closes #265
This commit is contained in:
Jeija 2016-04-26 19:42:34 +02:00
parent c4f0c5c169
commit 4249ed4986

View File

@ -16,15 +16,21 @@ minetest.override_item("default:mese", {
}} }}
}) })
minetest.register_node("mesecons_extrawires:mese_powered", { -- Copy node definition of powered mese from normal mese
tiles = {minetest.registered_nodes["default:mese"].tiles[1].."^[brighten"}, -- and brighten texture tiles to indicate mese is powered
is_ground_content = true, local powered_def = mesecon.mergetable(minetest.registered_nodes["default:mese"], {
groups = {cracky=1, not_in_creative_inventory = 1}, drop = "default:mese",
sounds = default.node_sound_stone_defaults(), light_source = 5,
mesecons = {conductor = { mesecons = {conductor = {
state = mesecon.state.on, state = mesecon.state.on,
offstate = "default:mese", offstate = "default:mese",
rules = mesewire_rules 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)