Node on_rightclick handlers as called from minetest.place_item() have
unusual and undocumented return semantics: returning nil is equivalent to
returning the passed in itemstack where in most places returning nil
instead of an itemstack means to retain the original unchanged itemstack.
That is usually not a problem, fortunately, because there are few cases
where temporarily modifying the passed in itemstack is useful (see
mcl_itemframes for an example where take_item() is used even in creative
mode).
But it seems useful to establish a standard convention for node
on_rightclick handlers as follows:
- don't add itemstack to the function signature if the handler doesn't
access it; such a handler is free to return nil
- if itemstack is part of the signature then no return statement should
return nil
This also makes explicit whether the node interaction is dependent on the
wielded item.
All occurences of node on_rightclick have been inspected whether they already
follow this convention and adapted if necessary:
mcl_armor_stand - (always returns itemstack already)
mcl_barrel - (itemstack not in signature)
mcl_beds/api - remove itemstack from signature
mcl_beds/respawn_anchor - return itemstack
mcl_beehives - return itemstack
mcl_bells - (itemstack not in signature)
mcl_books - (itemstack not in signature)
mcl_cake - clean signature
mcl_campfires - return itemstack
mcl_cauldrons - return itemstack when mcl_armor.wash_leather_armor doesn't
mcl_chests - (itemstack not in signature)
mcl_compass - return itemstack
mcl_composters - (always returns itemstack already)
mcl_crafting_table - (itemstack not in signature)
mcl_doors - (itemstack not in signature)
mcl_enchanting - remove itemstack from signature
mcl_farming/sweetberry - always return itemstack, also use itemstack to check for bonemeal
mcl_fences - (itemstack not in signature)
mcl_flowerpots - always return itemstack
mcl_grindstone - (itemstack not in signature)
mcl_itemframes - (always returns itemstack already)
mcl_jukebox - always return itemstack
mcl_loom - (itemstack not in signature)
mcl_lush_caves - (itemstack not in signature)
mcl_mobspawners - always return itemstack
mcl_signs - (always returns itemstack already)
mcl_stone_cutter - clean signature
mcl_comparator - (itemstack not in signature)
mesecons_button - (itemstack not in signature)
mesecons_commandblock - clean signature
mesecons_delayer - (itemstack not in signature)
mesecons_noteblock - (itemstack not in signature)
mesecons_solarpanel - (itemstack not in signature)
mesecons_walllever - (itemstack not in signature)