This commit makes enchanted tools which have no use for
tool_capabilities to not include it in their metadata. It does this by
not including tool_capabilities in the metadata of an enchanted tool if
at least one of two cases is true:
(1) The tool is not enchanted with unbreaking or efficiency
(2) The tool does not have tool_capabilities defined in its definition
The first case covers situations like having a pickaxe only being
enchanted with silk_touch. The second case covers situations like a
piece of armor being enchanted with unbreaking.
This commit fixes an issue were tools enchanted with both efficiency and
unbreaking would loose the effect of one of the enchantments in some
conditions.
This adds the metadata field "groupcaps_hash" to tools enchanted with
efficiency. This value contains a hash of the groupcaps field in
tool_capabilities. This value gets compared to the expected hash value
to determine if the tools tool_capabilities should be updated according
to commit af31f8189e8e5c2b.
This commit makes efficiency more efficient.
The function mcl_autogroups.get_groupcaps is used by mods to get the
groupcaps for tools with efficiency enchantments. This function is used
by mcl_enchanting when enchanting tools with efficiency.