If a player wants to make a path when there is no dirt with grass on the
ground it means they need to either have silk touch to collect dirt with
grass or place dirt beside dirt with grass and wait for the grass cover
to spread before they can create the new paths …
Since the former is not possible early in the game and the latter is not
easy, this patch imitates Minecraft 1.17 behaviour; the following nodes
can now be turned into path nodes by right-clicking them with a shovel:
• Dirt (mcl_core:dirt)
• Coarse Dirt (mcl_core:coarse_dirt)
• Dirt with Grass (mcl_core:dirt_with_grass)
• Mycelium (mcl_core:mycelium)
• Podzol (mcl_core:podzol)
A group “path_creation_possible” has been added to mark nodes that can
be turned into a dirt path with a shovel. One obvious objection to that
addition might be that the “dirt” group already exists. Even though all
existing nodes that can be turned into a dirt path do indeed belong to
the “dirt” group, it is not a good idea: Changing what “dirt” means to
“any node that can be turned into a dirt path” would make it harder to
maintain the code.
The code for shearing a pumpkin used minetest.swap_node() to replace a
faceless pumpkin with a carved pumpkin. This did not trigger the node
callbacks of the carved pumpkin, which meant that shearing a pumpkin
would not check for the snow golem or iron golem spawn conditions.
This patch replaces minetest.swap_node() in the code for shearing a
pumpkin with minetest.set_node(), which does trigger the callbacks;
therefore snow and iron golems can now spawn as a pumpkin is carved.
Group levels are now specified as a list of names when registering a
digging group. Digging groups which do not have specified levels will
support tools having two levels, 0 and 1 where 0 means the tool can dig
but not harvest the node and 1 means it can also harvest the node. If
more levels are required one has to specifiy them when registering the
digging group.
Added the API function mcl_autogroup.get_wear which is used to get the
tool wear for digging a node of a group. This is used by mcl_tools to
compute the wear of shovels and shears when rightclicking to create
grass paths and carve pumpkins.
Requiring tool definitions to call a function in _mcl_autogroup means
that they need to be loaded after _mcl_autogroup. This can cause
problems because _mcl_autogroup needs to be loaded after all tool and
node definitions are completed.
Because of this the API is changed so tool definitions instead put the
data used to generate groupcaps in the custom field
_mcl_autogroup_groupcaps. _mcl_autogroup will then go through all
registered tools and update the groupcaps for every tool where this
field is present. This means that no mod ever has to depend on
_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.