2021-03-09 22:43:25 +02:00
|
|
|
--[[
|
2021-03-18 12:34:20 +02:00
|
|
|
This mod implements the API to register digging groups for mcl_autogroup. The
|
|
|
|
rest of the mod is implemented and documented in the mod _mcl_autogroup.
|
2021-03-09 22:43:25 +02:00
|
|
|
|
2021-03-18 12:34:20 +02:00
|
|
|
The mod is split up into two parts, mcl_autogroup and _mcl_autogroup.
|
|
|
|
mcl_autogroup contains the API functions used to register custom digging groups.
|
|
|
|
_mcl_autogroup contains most of the code. The leading underscore in the name
|
|
|
|
"_mcl_autogroup" is used to force Minetest to load that part of the mod as late
|
|
|
|
as possible. Minetest loads mods in reverse alphabetical order.
|
2021-03-09 22:43:25 +02:00
|
|
|
--]]
|
|
|
|
mcl_autogroup = {}
|
2021-03-11 16:06:30 +02:00
|
|
|
mcl_autogroup.registered_diggroups = {}
|
2021-03-09 22:43:25 +02:00
|
|
|
|
2021-03-11 22:52:00 +02:00
|
|
|
-- Register a group as a digging group.
|
|
|
|
--
|
|
|
|
-- Parameters:
|
|
|
|
-- group - Name of the group to register as a digging group
|
|
|
|
-- def - Table with information about the diggroup (defaults to {} if unspecified)
|
|
|
|
--
|
|
|
|
-- Values in def:
|
|
|
|
-- level - If this value is 0 or unspecified, then the group does not have
|
|
|
|
-- levels, otherwise it is an integer greater than 0 which indicates how
|
|
|
|
-- many digging levels the group supports.
|
2021-03-11 16:06:30 +02:00
|
|
|
function mcl_autogroup.register_diggroup(group, def)
|
|
|
|
mcl_autogroup.registered_diggroups[group] = def or {}
|
2021-03-09 22:43:25 +02:00
|
|
|
end
|