mesecons icon indicating copy to clipboard operation
mesecons copied to clipboard

Can’t give myself mesecons items

Open adrian-amaglio opened this issue 5 years ago • 3 comments

There is a problem with mesecons items: /giveme mesecons_walllever:wall_lever print cannot give an unknown item and I don’t get my item :'( but /giveme default:dirt or /giveme default:mese are working fine…

It may be related to the fact that if I place a lever and a mese block next to each other and then I trigger this script:

    local pos1       = { x = -10, y = -10, z = -10 }
    local pos2       = { x = 10, y = 10, z = 10 }
    local pos_list = minetest.find_nodes_in_area(pos1, pos2, {"default:mese"})
    print(dump(pos_list)) -- got one item in list
    local pos_list = minetest.find_nodes_in_area(pos1, pos2, {"mesecons_walllever:wall_lever"})
    print(dump(pos_list)) -- got empty list

The mesecons blocks are not found…

I have no idea on how to fix this… If you can name the problem I may open a PR.

adrian-amaglio avatar Nov 30 '19 09:11 adrian-amaglio

The name mesecons_walllever:wall_lever is correct. https://github.com/minetest-mods/mesecons/blob/9b58f8db29c545d5fead166ae519045d20a1ca0b/mesecons_walllever/init.lua#L4

Please ensure that the mods "mesecons", "mesecons_receiver" and finally "mesecons_wallever" are enabled in your world. Check the configuration menu or world.mt inside the world's directory if you're in doubt. If the mods are enabled but the command still does not work, please check the last few lines of your debug.txt file. There might be some errors indicating what's going wrong. See also: https://wiki.minetest.net/Troubleshooting

SmallJoker avatar Nov 30 '19 16:11 SmallJoker

Most mesecons nodes can exist in two states, on and off. Therefor mesecons has its helper function mesecon.register_node. This function registers two nodes. The lever that is off is called mesecons_walllever:wall_lever_off. Here's the implementation of mesecon.register_node: https://github.com/minetest-mods/mesecons/blob/9b58f8db29c545d5fead166ae519045d20a1ca0b/mesecons/util.lua#L221-L233

Desour avatar Nov 30 '19 23:11 Desour

This is indeed a bug as many other nodes have aliases registered in mesecons_alias. That should also be well-documented as such aliases are only for giveme and likewise, not for searching (because only one state would be found).

numberZero avatar May 20 '20 14:05 numberZero