Allow flowers, bamboo and sugarcane to be placed on moss blocks

Add Moss to groups: soil_bamboo, soil_sugarcane
Add moss to allowed flower placement blocks
This commit is contained in:
laireia 2023-12-01 11:23:04 +10:00 committed by the-real-herowl
parent 8c21b81dcf
commit 984b394865
4 changed files with 9 additions and 9 deletions

View File

@ -437,7 +437,7 @@ mcl_mobs.register_mob("mobs_mc:wither", {
})
local wither_rose_soil = { "group:grass_block", "mcl_core:dirt", "mcl_core:coarse_dirt", "mcl_nether:netherrack", "group:soul_block", "mcl_mud:mud", "mcl_moss:moss" }
local wither_rose_soil = { "group:grass_block", "mcl_core:dirt", "mcl_core:coarse_dirt", "mcl_nether:netherrack", "group:soul_block", "mcl_mud:mud", "mcl_lush_caves:moss" }
local function spawn_wither_rose(obj)
local n = minetest.find_node_near(obj:get_pos(),2,wither_rose_soil)
if n then

View File

@ -1,6 +1,6 @@
local S = minetest.get_translator(minetest.get_current_modname())
local planton = {"mcl_core:dirt_with_grass", "mcl_core:dirt", "mcl_core:podzol", "mcl_core:coarse_dirt", "mcl_farming:soil", "mcl_farming:soil_wet", "mcl_moss:moss"}
local planton = {"mcl_core:dirt_with_grass", "mcl_core:dirt", "mcl_core:podzol", "mcl_core:coarse_dirt", "mcl_farming:soil", "mcl_farming:soil_wet", "mcl_lush_caves:moss"}
for i=0, 3 do
local texture = "mcl_farming_sweet_berry_bush_" .. i .. ".png"

View File

@ -41,7 +41,7 @@ local on_place_flower = mcl_util.generate_on_place_plant_function(function(pos,
end
--[[ Placement requirements:
* Dirt or grass block
* Dirt, grass or moss block
* If not flower, also allowed on podzol and coarse dirt
* Light level >= 8 at any time or exposed to sunlight at day
]]
@ -51,11 +51,11 @@ local on_place_flower = mcl_util.generate_on_place_plant_function(function(pos,
if (light_night and light_night >= 8) or (light_day and light_day >= minetest.LIGHT_MAX) then
light_ok = true
end
if itemstack:get_name() == "mcl_flowers:wither_rose" and ( minetest.get_item_group(soil_node.name, "grass_block") > 0 or soil_node.name == "mcl_core:dirt" or soil_node.name == "mcl_core:coarse_dirt" or soil_node.name == "mcl_mud:mud" or soil_node.name == "mcl_moss:moss" or soil_node.name == "mcl_nether:netherrack" or minetest.get_item_group(soil_node.name, "soul_block") > 0 ) then
if itemstack:get_name() == "mcl_flowers:wither_rose" and ( minetest.get_item_group(soil_node.name, "grass_block") > 0 or soil_node.name == "mcl_core:dirt" or soil_node.name == "mcl_core:coarse_dirt" or soil_node.name == "mcl_mud:mud" or soil_node.name == "mcl_lush_caves:moss" or soil_node.name == "mcl_nether:netherrack" or minetest.get_item_group(soil_node.name, "soul_block") > 0 ) then
return true,colorize
end
local is_flower = minetest.get_item_group(itemstack:get_name(), "flower") == 1
local ok = (soil_node.name == "mcl_core:dirt" or minetest.get_item_group(soil_node.name, "grass_block") == 1 or (not is_flower and (soil_node.name == "mcl_core:coarse_dirt" or soil_node.name == "mcl_core:podzol" or soil_node.name == "mcl_core:podzol_snow"))) and light_ok
local ok = (soil_node.name == "mcl_core:dirt" or minetest.get_item_group(soil_node.name, "grass_block") == 1 or soil_node.name == "mcl_lush_caves:moss" or (not is_flower and (soil_node.name == "mcl_core:coarse_dirt" or soil_node.name == "mcl_core:podzol" or soil_node.name == "mcl_core:podzol_snow"))) and light_ok
return ok, colorize
end)
@ -318,11 +318,11 @@ local function add_large_plant(name, desc, longdesc, bottom_img, top_img, inv_im
end
-- Placement rules:
-- * Allowed on dirt or grass block
-- * Allowed on dirt, grass or moss block
-- * If not a flower, also allowed on podzol and coarse dirt
-- * Only with light level >= 8
-- * Only if two enough space
if (floor.name == "mcl_core:dirt" or minetest.get_item_group(floor.name, "grass_block") == 1 or (not is_flower and (floor.name == "mcl_core:coarse_dirt" or floor.name == "mcl_core:podzol" or floor.name == "mcl_core:podzol_snow"))) and bottom_buildable and top_buildable and light_ok then
if (floor.name == "mcl_core:dirt" or minetest.get_item_group(floor.name, "grass_block") == 1 or floor.name == "mcl_lush_caves:moss" or (not is_flower and (floor.name == "mcl_core:coarse_dirt" or floor.name == "mcl_core:podzol" or floor.name == "mcl_core:podzol_snow"))) and bottom_buildable and top_buildable and light_ok then
local param2
if grass_color then
param2 = get_palette_color_from_pos(bottom)
@ -419,7 +419,7 @@ minetest.register_abm({
return
end
-- Pop out flower if not on dirt, grass block or too low brightness
if (below.name ~= "mcl_core:dirt" and minetest.get_item_group(below.name, "grass_block") ~= 1) or (minetest.get_node_light(pos, 0.5) < 8) then
if (below.name ~= "mcl_core:dirt" and minetest.get_item_group(below.name, "grass_block") ~= 1 and below.name ~= "mcl_lush_caves:moss") or (minetest.get_node_light(pos, 0.5) < 8) then
minetest.dig_node(pos)
return
end

View File

@ -80,7 +80,7 @@ minetest.register_node("mcl_lush_caves:moss", {
_doc_items_entry_name = "moss",
_doc_items_hidden = false,
tiles = {"mcl_lush_caves_moss_block.png"},
groups = {handy=1, hoey=2, dirt=1, soil=1, soil_sapling=2, enderman_takable=1, building_block=1,flammable=1,fire_encouragement=60, fire_flammability=20, grass_block_no_snow = 1 },
groups = { handy=1, hoey=2, dirt=1, soil=1, soil_bamboo=1, soil_sapling=2, soil_sugarcane=1, enderman_takable=1, building_block=1, flammable=1, fire_encouragement=60, fire_flammability=20, grass_block_no_snow = 1 },
sounds = mcl_sounds.node_sound_dirt_defaults(),
_mcl_blast_resistance = 0.1,
_mcl_hardness = 0.1,