forked from VoxeLibre/VoxeLibre
_mcl_autogroup: Use register_on_mods_loaded
minetest.register_on_mods_loaded calls its callback after all mods have loaded, removing the need for the naming hack used to ensure _mcl_autogroup loads last.
This commit is contained in:
parent
a8b974266c
commit
2c23ab6174
|
@ -115,11 +115,16 @@ local function get_hardness_lookup_for_groups(hardness_values)
|
|||
end
|
||||
|
||||
-- Array of unique hardness values for each group which affects dig time.
|
||||
local hardness_values = get_hardness_values_for_groups()
|
||||
local hardness_values
|
||||
|
||||
-- Map indexed by hardness values which return the index of that value in
|
||||
-- hardness_value. Used for quick lookup.
|
||||
local hardness_lookup = get_hardness_lookup_for_groups(hardness_values)
|
||||
local hardness_lookup
|
||||
|
||||
minetest.register_on_mods_loaded(function()
|
||||
hardness_values = get_hardness_values_for_groups()
|
||||
hardness_lookup = get_hardness_lookup_for_groups(hardness_values)
|
||||
end)
|
||||
|
||||
--[[local function compute_creativetimes(group)
|
||||
local creativetimes = {}
|
||||
|
@ -364,4 +369,4 @@ local function overwrite()
|
|||
end
|
||||
end
|
||||
|
||||
overwrite()
|
||||
minetest.register_on_mods_loaded(overwrite)
|
||||
|
|
Loading…
Reference in New Issue