bonemeal on dirt/sand only works for that type at one time

This commit is contained in:
TenPlus1 2019-03-07 16:02:51 +00:00
parent 797bae9c46
commit a4c4716c36
1 changed files with 627 additions and 618 deletions

View File

@ -213,12 +213,21 @@ local function check_soil(pos, nodename, strength)
-- set radius according to strength
local side = strength - 1
local tall = math.max(strength - 2, 0)
local floor = {"group:soil", "group:sand"}
local groups = minetest.registered_items[nodename]
and minetest.registered_items[nodename].groups or {}
-- only place decoration on one type of surface
if groups.soil then
floor = {"group:soil"}
elseif groups.sand then
floor = {"group:sand"}
end
-- get area of land with free space above
local dirt = minetest.find_nodes_in_area_under_air(
{x = pos.x - side, y = pos.y - tall, z = pos.z - side},
{x = pos.x + side, y = pos.y + tall, z = pos.z + side},
{"group:soil", "group:sand"})
{x = pos.x + side, y = pos.y + tall, z = pos.z + side}, floor)
-- set default grass and decoration
local grass = green_grass