VoxeLibre/mods/CORE/mcl_autogroup/init.lua
Elias Åström fb6f5eae7a Rewrite mcl_autogroup
These changes are primarly made to make mcl_autogroup more efficient.
Previously enchanted tools required storing around 21 kB of metadata due
to the way the previous version of the mod was implemented.  This caused
a lot of lag and a huge amount of network traffic.  With the changes
enchanted tools won't require more than 1 kB of metadata.

The mod is also rewritten to use an API to register digging groups and
compute the groupcaps for tools.  This will make it easier for modders
to register custom digging groups.

The mod is now split up into two parts.  One part called "mcl_autogroup"
to implement the API for registering custom digging groups, and the
other part called "_mcl_autogroup" which contains most of the code which
has to be loaded after most mods.
2021-03-18 11:32:18 +01:00

16 lines
621 B
Lua

--[[
This mod implements the API to register digging groups for mcl_autogroups. The
rest of the mod is implemented and documented in the mod "_mcl_autogroup".
The mcl_autogroups mod is split up into two mods, mcl_autogroups and
_mcl_autogroups. mcl_autogroups contains the API functions used to register
custom digging groups. _mcl_autogroups contains parts of the mod which need to
be executed after loading all other mods.
--]]
mcl_autogroup = {}
mcl_autogroup.registered_digtime_groups = {}
function mcl_autogroup.register_digtime_group(group, def)
mcl_autogroup.registered_digtime_groups[group] = def or {}
end