[_mcl_autogroup] fix warnings

This commit is contained in:
AFCMS 2021-05-25 01:26:26 +02:00
parent f5a91f7c24
commit f61102279f
1 changed files with 8 additions and 8 deletions

View File

@ -121,7 +121,7 @@ local hardness_values = get_hardness_values_for_groups()
-- hardness_value. Used for quick lookup. -- hardness_value. Used for quick lookup.
local hardness_lookup = get_hardness_lookup_for_groups(hardness_values) local hardness_lookup = get_hardness_lookup_for_groups(hardness_values)
local function compute_creativetimes(group) --[[local function compute_creativetimes(group)
local creativetimes = {} local creativetimes = {}
for index, hardness in pairs(hardness_values[group]) do for index, hardness in pairs(hardness_values[group]) do
@ -129,7 +129,7 @@ local function compute_creativetimes(group)
end end
return creativetimes return creativetimes
end end]]
-- Get the list of digging times for using a specific tool on a specific -- Get the list of digging times for using a specific tool on a specific
-- diggroup. -- diggroup.
@ -239,13 +239,13 @@ function mcl_autogroup.can_harvest(nodename, toolname)
end end
-- Get one groupcap field for using a specific tool on a specific group. -- Get one groupcap field for using a specific tool on a specific group.
local function get_groupcap(group, can_harvest, multiplier, efficiency, uses) --[[local function get_groupcap(group, can_harvest, multiplier, efficiency, uses)
return { return {
times = get_digtimes(group, can_harvest, multiplier, efficiency), times = get_digtimes(group, can_harvest, multiplier, efficiency),
uses = uses, uses = uses,
maxlevel = 0, maxlevel = 0,
} }
end end]]
-- Returns the tool_capabilities from a tool definition or a default set of -- Returns the tool_capabilities from a tool definition or a default set of
-- tool_capabilities -- tool_capabilities
@ -271,7 +271,7 @@ end
-- toolname - Name of the tool being enchanted (like "mcl_tools:diamond_pickaxe") -- toolname - Name of the tool being enchanted (like "mcl_tools:diamond_pickaxe")
-- efficiency - The efficiency level the tool is enchanted with (default 0) -- efficiency - The efficiency level the tool is enchanted with (default 0)
-- --
-- NOTE: -- NOTE:
-- This function can only be called after mod initialization. Otherwise a mod -- This function can only be called after mod initialization. Otherwise a mod
-- would have to add _mcl_autogroup as a dependency which would break the mod -- would have to add _mcl_autogroup as a dependency which would break the mod
-- loading order. -- loading order.
@ -288,7 +288,7 @@ end
-- toolname - Name of the tool used -- toolname - Name of the tool used
-- diggroup - The name of the diggroup the tool is used on -- diggroup - The name of the diggroup the tool is used on
-- --
-- NOTE: -- NOTE:
-- This function can only be called after mod initialization. Otherwise a mod -- This function can only be called after mod initialization. Otherwise a mod
-- would have to add _mcl_autogroup as a dependency which would break the mod -- would have to add _mcl_autogroup as a dependency which would break the mod
-- loading order. -- loading order.
@ -315,12 +315,12 @@ local overwrite = function()
newgroups.opaque = 1 newgroups.opaque = 1
end end
local creative_breakable = false --local creative_breakable = false
-- Assign groups used for digging this node depending on -- Assign groups used for digging this node depending on
-- the registered digging groups -- the registered digging groups
for g, gdef in pairs(mcl_autogroup.registered_diggroups) do for g, gdef in pairs(mcl_autogroup.registered_diggroups) do
creative_breakable = true --creative_breakable = true
local index = hardness_lookup[g][ndef._mcl_hardness or 0] local index = hardness_lookup[g][ndef._mcl_hardness or 0]
if ndef.groups[g] then if ndef.groups[g] then
if gdef.levels then if gdef.levels then