Address review comments

This commit is contained in:
teknomunk 2024-09-16 06:10:59 -05:00
parent 44923b3e59
commit 1feb78a926
2 changed files with 5 additions and 6 deletions

View File

@ -317,13 +317,12 @@ local GROUP_MAP = {
["snappy"] = "shearsy", ["snappy"] = "shearsy",
} }
function mcl_autogroup.group_compatibility(groups, node_def) function mcl_autogroup.group_compatibility(groups)
local grouped = false local grouped = false
for name,_ in pairs(groups) do for name,old_group_value in pairs(groups) do
local new_group = GROUP_MAP[name] local new_group = GROUP_MAP[name]
if new_group then if new_group then
groups[new_group] = 1 groups[new_group] = old_group_value
node_def.groups[new_group] = 1
end end
if mcl_autogroup.registered_diggroups[name] then if mcl_autogroup.registered_diggroups[name] then
grouped = true grouped = true
@ -350,7 +349,7 @@ local function overwrite()
if not newgroups.unbreakable and not newgroups.indestructible then if not newgroups.unbreakable and not newgroups.indestructible then
ndef.diggable = true ndef.diggable = true
mcl_autogroup.group_compatibility(newgroups, ndef) mcl_autogroup.group_compatibility(newgroups)
if not ndef._mcl_hardness then if not ndef._mcl_hardness then
ndef._mcl_hardness = 0 ndef._mcl_hardness = 0
end end

View File

@ -2,7 +2,7 @@
This mod emulates digging times from MC. This mod emulates digging times from MC.
## `mcl_autogroup.can_harvest(nodename, toolname, player)` ## `mcl_autogroup.can_harvest(nodename, toolname, player)`
Return true if `nodename` can be dig with `toolname` by `player`. Return true if `nodename` can be dug with `toolname` by `player`.
* `nodename`: string, valid nodename * `nodename`: string, valid nodename
* `toolname`: (optional) string, valid toolname * `toolname`: (optional) string, valid toolname