123456789101112131415161718192021 |
- minetest.register_lbm({
- label = 'Sabotaged Node Reset',
- name = 'sabotage:node_fix',
- nodenames = {'group:sabotage'},
- run_at_every_load = true,
- action = function(pos, node)
- if minetest.get_item_group(node.name, 'sabotage') == 2 then
- local meta = minetest.get_meta(pos)
- local map_id = meta:get_string('map_id')
- local sabotaged = lobby.sabotage[map_id]
- if not sabotaged then
- local def = minetest.registered_nodes[node.name]
- local flip = def.sabotage_switch
- if flip then
- minetest.swap_node(pos, {name = flip, param2 = node.param2})
- end
- end
- end
- end
- })
|