2024-08-20 01:03:36 +02:00
|
|
|
# `mcl_autogroup`
|
2024-09-12 18:13:52 +02:00
|
|
|
This mod emulates digging times from MC.
|
2021-03-28 00:02:35 +01:00
|
|
|
|
2024-08-20 01:03:36 +02:00
|
|
|
## `mcl_autogroup.can_harvest(nodename, toolname, player)`
|
2024-08-20 01:44:33 +02:00
|
|
|
Return true if `nodename` can be dig with `toolname` by `player`.
|
2024-08-20 01:03:36 +02:00
|
|
|
|
2024-08-20 01:44:33 +02:00
|
|
|
* `nodename`: string, valid nodename
|
|
|
|
* `toolname`: (optional) string, valid toolname
|
|
|
|
* `player`: (optinal) ObjectRef, valid player
|
2021-03-28 00:02:35 +01:00
|
|
|
|
2024-08-20 01:03:36 +02:00
|
|
|
## `mcl_autogroup.get_groupcaps(toolname, efficiency)`
|
2021-03-28 00:02:35 +01:00
|
|
|
This function is used to calculate diggroups for tools.
|
|
|
|
WARNING: This function can only be called after mod initialization.
|
2024-08-20 01:44:33 +02:00
|
|
|
* `toolname`: string, name of the tool being enchanted (like `"mcl_tools:diamond_pickaxe"`)
|
|
|
|
* `efficiency`: (optional) integer, the efficiency level the tool is enchanted with (default 0)
|
2021-03-28 00:02:35 +01:00
|
|
|
|
2024-08-20 01:03:36 +02:00
|
|
|
## `mcl_autogroup.get_wear(toolname, diggroup)`
|
2024-09-12 18:13:52 +02:00
|
|
|
Return the max wear of `toolname` with `diggroup`
|
2021-03-28 00:02:35 +01:00
|
|
|
WARNING: This function can only be called after mod initialization.
|
2024-08-20 01:44:33 +02:00
|
|
|
* `toolname`: string, name of the tool used
|
|
|
|
* `diggroup`: string, the name of the diggroup the tool is used on
|
2021-03-28 00:02:35 +01:00
|
|
|
|
2024-08-20 01:03:36 +02:00
|
|
|
## `mcl_autogroup.register_diggroup(group, def)`
|
2024-08-20 01:44:33 +02:00
|
|
|
* `group`: string, name of the group to register as a digging group
|
|
|
|
* `def`: (optional) table, table with information about the diggroup (defaults to `{}` if unspecified)
|
|
|
|
* `level`: (optional) string, if specified it is an array containing the names of the different digging levels the digging group supports
|
2021-03-28 00:02:35 +01:00
|
|
|
|
2024-08-20 01:03:36 +02:00
|
|
|
## `mcl_autogroup.registered_diggroups`
|
2024-09-12 18:13:52 +02:00
|
|
|
List of registered diggroups, indexed by name.
|
2024-08-20 01:03:36 +02:00
|
|
|
|
|
|
|
## `mcl_autogroup.group_compatibility(groups, node_def)`
|
|
|
|
Adds VoxeLibre-equivalent groups to `node_def.groups`.
|
|
|
|
* `groups` - A list of groups to add compatiblity groups for. Normally this is a copy of `node_def.groups`.
|
|
|
|
* `node_def` - The node defintion to update groups for.
|