2022-04-20 17:12:51 +02:00
|
|
|
local mese_nodename = minetest.registered_aliases["mesecons_compat:mese"]
|
|
|
|
if not mese_nodename then
|
|
|
|
return
|
|
|
|
end
|
|
|
|
|
2013-02-11 11:01:13 +01:00
|
|
|
local mesewire_rules =
|
|
|
|
{
|
|
|
|
{x = 1, y = 0, z = 0},
|
|
|
|
{x =-1, y = 0, z = 0},
|
|
|
|
{x = 0, y = 1, z = 0},
|
|
|
|
{x = 0, y =-1, z = 0},
|
|
|
|
{x = 0, y = 0, z = 1},
|
|
|
|
{x = 0, y = 0, z =-1},
|
|
|
|
}
|
|
|
|
|
2022-04-20 17:12:51 +02:00
|
|
|
minetest.override_item(mese_nodename, {
|
2013-02-11 11:01:13 +01:00
|
|
|
mesecons = {conductor = {
|
|
|
|
state = mesecon.state.off,
|
|
|
|
onstate = "mesecons_extrawires:mese_powered",
|
|
|
|
rules = mesewire_rules
|
|
|
|
}}
|
|
|
|
})
|
|
|
|
|
2016-04-26 19:42:34 +02:00
|
|
|
-- Copy node definition of powered mese from normal mese
|
|
|
|
-- and brighten texture tiles to indicate mese is powered
|
2022-04-20 17:12:51 +02:00
|
|
|
local powered_def = mesecon.merge_tables(minetest.registered_nodes[mese_nodename], {
|
|
|
|
drop = mese_nodename,
|
2016-04-26 19:42:34 +02:00
|
|
|
light_source = 5,
|
2013-02-11 11:01:13 +01:00
|
|
|
mesecons = {conductor = {
|
|
|
|
state = mesecon.state.on,
|
2022-04-20 17:12:51 +02:00
|
|
|
offstate = mese_nodename,
|
2013-02-11 11:01:13 +01:00
|
|
|
rules = mesewire_rules
|
|
|
|
}},
|
2017-10-07 00:44:49 +02:00
|
|
|
groups = {cracky = 1, not_in_creative_inventory = 1},
|
|
|
|
on_blast = mesecon.on_blastnode,
|
2013-02-11 11:01:13 +01:00
|
|
|
})
|
2016-04-26 19:42:34 +02:00
|
|
|
|
|
|
|
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)
|