Groups are very important for gameplay so it makes sense to expose them in some way.
IMO it should have been a requirement to register groups beforehand right from the start, but I think it is way too late now for such a request.
The actual feature request here is to create a function to assign a “readable” group name to a certain group.
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_real_group_name(internal_name, real_name)
Registers the name “real_name” to the group “internal_name”. Using the function is completely optional, but highly recommended to use.
Examples:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_real_group_name("stone", "Stones")
minetest.register_real_group_name("leaves", "Leaves and Needles")
minetest.register_real_group_name("tree", "Tree Trunks")
minetest.register_real_group_name("leafdecay", "Decaying Leaves and Needles")
minetest.register_real_group_name("cracky", "Cracky")
minetest.register_real_group_name("oddly_breakable_by_hand", "Hand-Breakable")
minetest.register_real_group_name("not_in_creative_inventory", "Not in Creative Inventory")
Style guide for “exposable” group names: Treat them as proper names, so this means in English the first letter of nouns must be capitalized. Examples: “Leaves and Needles”, “Sand”, “Tree Trunks”, etc. Try to write them in such a way that they can be (hopefully) easily pasted into text. Prefer plural form over singular form (this is a soft requirement), especially for grouping nodes together, to make them more distinguishable from node descriptions. Example sentence: “Stone and Desert Stone belong to the Stones group.”
SECOND FUNCTION:
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.get_real_group_name(internal_name)
Returns the registered name of the group or nil if it does not exist.
Finally, Minetest should automatically register group names for all special groups such as disable_jump.
Minetest Game should register group names for all groups it introduces, such as cracky.
USE CASES:
- Unified Inventory has a crafting guide which supports group inputs for the crafting recipes. Currently, when you hover them, you get a tooltip with the raw group name in the form of “group:stone”
- doc_minetest_game makes use of group names as well. It currently tries to work around the problem of “raw” group names by manually assigning such “readable” names but this is of course doomed to be inconsistent; so this mod could benefit from the change as well