Compare commits

...

1 Commits

Author SHA1 Message Date
Nils Dagsson Moskopp 519e05dc96
Replace grass path with dirt path
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.
2021-09-09 15:08:57 +02:00
4 changed files with 15 additions and 6 deletions

View File

@ -41,6 +41,7 @@ Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times
* `flammable=-1` Does not get destroyed by fire * `flammable=-1` Does not get destroyed by fire
* `fire_encouragement`: How quickly this block catches fire * `fire_encouragement`: How quickly this block catches fire
* `fire_flammability`: How fast the block will burn away * `fire_flammability`: How fast the block will burn away
* `path_creation_possible=1`: Node can be turned into grass path by using a shovel on it
* `spreading_dirt_type=1`: A dirt-type block with a cover (e.g. grass) which may spread to neighbor dirt blocks * `spreading_dirt_type=1`: A dirt-type block with a cover (e.g. grass) which may spread to neighbor dirt blocks
* `dirtifies_below_solid=1`: This node turns into dirt immediately when a solid or dirtifier node is placed on top * `dirtifies_below_solid=1`: This node turns into dirt immediately when a solid or dirtifier node is placed on top
* `dirtifier=1`: This node turns nodes the above group into dirt when placed above * `dirtifier=1`: This node turns nodes the above group into dirt when placed above

View File

@ -31,6 +31,14 @@ doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
return "" return ""
end) end)
-- usable by shovels
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
if def.groups.path_creation_possible then
return S("This block can be turned into grass path with a shovel.")
end
return ""
end)
-- soil -- soil
doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def) doc.sub.items.register_factoid("nodes", "groups", function(itemstring, def)
local datastring = "" local datastring = ""

View File

@ -363,7 +363,7 @@ minetest.register_node("mcl_core:dirt_with_grass", {
color = "#55aa60", color = "#55aa60",
is_ground_content = true, is_ground_content = true,
stack_max = 64, stack_max = 64,
groups = {handy=1,shovely=1,dirt=2,grass_block=1, grass_block_no_snow=1, soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2, spreading_dirt_type=1, enderman_takable=1, building_block=1}, groups = {handy=1,shovely=1,dirt=2,grass_block=1, grass_block_no_snow=1, soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2, spreading_dirt_type=1, enderman_takable=1, building_block=1, path_creation_possible=1},
drop = 'mcl_core:dirt', drop = 'mcl_core:dirt',
sounds = mcl_sounds.node_sound_dirt_defaults({ sounds = mcl_sounds.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.1}, footstep = {name="default_grass_footstep", gain=0.1},
@ -416,7 +416,7 @@ minetest.register_node("mcl_core:mycelium", {
tiles = {"mcl_core_mycelium_top.png", "default_dirt.png", {name="mcl_core_mycelium_side.png", tileable_vertical=false}}, tiles = {"mcl_core_mycelium_top.png", "default_dirt.png", {name="mcl_core_mycelium_side.png", tileable_vertical=false}},
is_ground_content = true, is_ground_content = true,
stack_max = 64, stack_max = 64,
groups = {handy=1,shovely=1, dirt=2,spreading_dirt_type=1, enderman_takable=1, building_block=1}, groups = {handy=1,shovely=1, dirt=2,spreading_dirt_type=1, enderman_takable=1, building_block=1, path_creation_possible=1},
drop = 'mcl_core:dirt', drop = 'mcl_core:dirt',
sounds = mcl_sounds.node_sound_dirt_defaults({ sounds = mcl_sounds.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.1}, footstep = {name="default_grass_footstep", gain=0.1},
@ -436,7 +436,7 @@ minetest.register_node("mcl_core:podzol", {
tiles = {"mcl_core_dirt_podzol_top.png", "default_dirt.png", {name="mcl_core_dirt_podzol_side.png", tileable_vertical=false}}, tiles = {"mcl_core_dirt_podzol_top.png", "default_dirt.png", {name="mcl_core_dirt_podzol_side.png", tileable_vertical=false}},
is_ground_content = true, is_ground_content = true,
stack_max = 64, stack_max = 64,
groups = {handy=1,shovely=3, dirt=2,soil=1, soil_sapling=2, soil_sugarcane=1, enderman_takable=1, building_block=1}, groups = {handy=1,shovely=3, dirt=2,soil=1, soil_sapling=2, soil_sugarcane=1, enderman_takable=1, building_block=1, path_creation_possible=1},
drop = 'mcl_core:dirt', drop = 'mcl_core:dirt',
sounds = mcl_sounds.node_sound_dirt_defaults(), sounds = mcl_sounds.node_sound_dirt_defaults(),
on_construct = mcl_core.on_snowable_construct, on_construct = mcl_core.on_snowable_construct,
@ -454,7 +454,7 @@ minetest.register_node("mcl_core:dirt", {
tiles = {"default_dirt.png"}, tiles = {"default_dirt.png"},
is_ground_content = true, is_ground_content = true,
stack_max = 64, stack_max = 64,
groups = {handy=1,shovely=1, dirt=1,soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2, enderman_takable=1, building_block=1}, groups = {handy=1,shovely=1, dirt=1,soil=1, soil_sapling=2, soil_sugarcane=1, cultivatable=2, enderman_takable=1, building_block=1, path_creation_possible=1},
sounds = mcl_sounds.node_sound_dirt_defaults(), sounds = mcl_sounds.node_sound_dirt_defaults(),
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 0.5, _mcl_hardness = 0.5,
@ -466,7 +466,7 @@ minetest.register_node("mcl_core:coarse_dirt", {
tiles = {"mcl_core_coarse_dirt.png"}, tiles = {"mcl_core_coarse_dirt.png"},
is_ground_content = true, is_ground_content = true,
stack_max = 64, stack_max = 64,
groups = {handy=1,shovely=1, dirt=3,soil=1, soil_sugarcane=1, cultivatable=1, enderman_takable=1, building_block=1}, groups = {handy=1,shovely=1, dirt=3,soil=1, soil_sugarcane=1, cultivatable=1, enderman_takable=1, building_block=1, path_creation_possible=1},
sounds = mcl_sounds.node_sound_dirt_defaults(), sounds = mcl_sounds.node_sound_dirt_defaults(),
_mcl_blast_resistance = 0.5, _mcl_blast_resistance = 0.5,
_mcl_hardness = 0.5, _mcl_hardness = 0.5,

View File

@ -188,7 +188,7 @@ local make_grass_path = function(itemstack, placer, pointed_thing)
return itemstack return itemstack
end end
if (minetest.get_item_group(node.name, "grass_block") == 1) then if (minetest.get_item_group(node.name, "path_creation_possible") == 1) then
local above = table.copy(pointed_thing.under) local above = table.copy(pointed_thing.under)
above.y = above.y + 1 above.y = above.y + 1
if minetest.get_node(above).name == "air" then if minetest.get_node(above).name == "air" then