From f5de6db4aa7ac91b1c895f31add2046135278401 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 23 Nov 2017 00:32:51 +0100 Subject: [PATCH] Add grass path and farmland to creative inventory --- GROUPS.md | 3 ++- mods/ITEMS/mcl_core/functions.lua | 3 ++- mods/ITEMS/mcl_core/nodes_base.lua | 2 +- mods/ITEMS/mcl_farming/soil.lua | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/GROUPS.md b/GROUPS.md index a8aa9155b..93ae95183 100644 --- a/GROUPS.md +++ b/GROUPS.md @@ -36,7 +36,8 @@ Please read to learn how digging times * `cultivatable=1`: Block will be turned into Dirt by using a hoe on it * `flammable`: Block helps spreading fire and gets destroyed by nearby fire (rating doesn't matter) * `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 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 * `non_mycelium_plant=1`: A plant which can't grow on mycelium. Placing it on mycelium fails and if mycelium spreads below it, it uproots * `soil=1`: Saplings and other small plants can grow on it * `soil_sapling=2`: Soil for saplings. Intended to be natural soil. All saplings will grow on this diff --git a/mods/ITEMS/mcl_core/functions.lua b/mods/ITEMS/mcl_core/functions.lua index d90c672f3..5074a043c 100644 --- a/mods/ITEMS/mcl_core/functions.lua +++ b/mods/ITEMS/mcl_core/functions.lua @@ -713,7 +713,8 @@ minetest.register_abm({ -- Turn Grass Path and similar nodes to Dirt if a solid node is placed above it minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing) - if minetest.get_item_group(newnode.name, "solid") ~= 0 then + if minetest.get_item_group(newnode.name, "solid") ~= 0 or + minetest.get_item_group(newnode.name, "dirtifier") ~= 0 then local below = {x=pos.x, y=pos.y-1, z=pos.z} local belownode = minetest.get_node(below) if minetest.get_item_group(belownode.name, "dirtifies_below_solid") == 1 then diff --git a/mods/ITEMS/mcl_core/nodes_base.lua b/mods/ITEMS/mcl_core/nodes_base.lua index cbe09807d..997e3a069 100644 --- a/mods/ITEMS/mcl_core/nodes_base.lua +++ b/mods/ITEMS/mcl_core/nodes_base.lua @@ -382,7 +382,7 @@ minetest.register_node("mcl_core:grass_path", { {-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5}, } }, - groups = {handy=1,shovely=1, cultivatable=2, dirtifies_below_solid=1, not_in_creative_inventory=1, }, + groups = {handy=1,shovely=1, cultivatable=2, dirtifies_below_solid=1, dirtifier=1, deco_block=1 }, sounds = mcl_sounds.node_sound_dirt_defaults({ footstep = {name="default_grass_footstep", gain=0.4}, }), diff --git a/mods/ITEMS/mcl_farming/soil.lua b/mods/ITEMS/mcl_farming/soil.lua index 25ef7af71..b89ae4025 100644 --- a/mods/ITEMS/mcl_farming/soil.lua +++ b/mods/ITEMS/mcl_farming/soil.lua @@ -16,7 +16,7 @@ minetest.register_node("mcl_farming:soil", { local meta = minetest.get_meta(pos) meta:set_int("wet", 0) end, - groups = {handy=1,shovely=1, not_in_creative_inventory=1, dirtifies_below_solid=1, soil=2, soil_sapling=1 }, + groups = {handy=1,shovely=1, dirtifies_below_solid=1, dirtifier=1, soil=2, soil_sapling=1, deco_block=1 }, sounds = mcl_sounds.node_sound_dirt_defaults(), _mcl_blast_resistance = 3, _mcl_hardness = 0.6, @@ -39,7 +39,7 @@ minetest.register_node("mcl_farming:soil_wet", { local meta = minetest.get_meta(pos) meta:set_int("wet", 7) end, - groups = {handy=1,shovely=1, not_in_creative_inventory=1, dirtifies_below_solid=1, soil=3, soil_sapling=1 }, + groups = {handy=1,shovely=1, not_in_creative_inventory=1, dirtifies_below_solid=1, dirtifier=1, soil=3, soil_sapling=1 }, sounds = mcl_sounds.node_sound_dirt_defaults(), _mcl_blast_resistance = 3, _mcl_hardness = 0.6,