mirror of
https://codeberg.org/tenplus1/bonemeal.git
synced 2025-01-08 01:00:25 +01:00
bonemeal on dirt/sand only works for that type at one time
This commit is contained in:
parent
797bae9c46
commit
a4c4716c36
13
init.lua
13
init.lua
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user