forked from Mineclonia/Mineclonia
Merge pull request 'ITEMS/mcl_farming: Convert correct floor node to dirt as gourd grows' (#231) from fix-gourd-farmland-dirtification into master
Reviewed-on: Mineclonia/Mineclonia#231 Reviewed-by: Li0n_2 <li0n_2@noreply.git.minetest.land>
This commit is contained in:
commit
23f1c51912
|
@ -388,12 +388,11 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
|
|||
{ x=0, y=0, z=-1 },
|
||||
{ x=0, y=0, z=1 },
|
||||
}
|
||||
local floorpos, floor
|
||||
for n=#neighbors, 1, -1 do
|
||||
local offset = neighbors[n]
|
||||
local blockpos = vector.add(stempos, offset)
|
||||
floorpos = { x=blockpos.x, y=blockpos.y-1, z=blockpos.z }
|
||||
floor = minetest.get_node(floorpos)
|
||||
local floorpos = { x=blockpos.x, y=blockpos.y-1, z=blockpos.z }
|
||||
local floor = minetest.get_node(floorpos)
|
||||
local block = minetest.get_node(blockpos)
|
||||
local soilgroup = minetest.get_item_group(floor.name, "soil")
|
||||
if not ((minetest.get_item_group(floor.name, "grass_block") == 1 or floor.name=="mcl_core:dirt" or soilgroup == 2 or soilgroup == 3) and block.name == "air") then
|
||||
|
@ -407,6 +406,8 @@ function mcl_farming:add_gourd(full_unconnected_stem, connected_stem_basename, s
|
|||
local r = math.random(1, #neighbors)
|
||||
local offset = neighbors[r]
|
||||
local blockpos = vector.add(stempos, offset)
|
||||
local floorpos = { x=blockpos.x, y=blockpos.y-1, z=blockpos.z }
|
||||
local floor = minetest.get_node(floorpos)
|
||||
local p2
|
||||
if offset.x == 1 then
|
||||
minetest.set_node(stempos, {name=connected_stem_names[1]})
|
||||
|
|
Loading…
Reference in New Issue