forked from mtcontrib/bonemeal
added new param2 checks
This commit is contained in:
parent
2b5decbc50
commit
e017406a10
11
init.lua
11
init.lua
@ -283,8 +283,17 @@ local function check_soil(pos, nodename, strength)
|
|||||||
pos2.y = pos2.y + 1
|
pos2.y = pos2.y + 1
|
||||||
|
|
||||||
if nod and nod ~= "" then
|
if nod and nod ~= "" then
|
||||||
|
|
||||||
|
-- get crop param2 value
|
||||||
def = minetest.registered_nodes[nod]
|
def = minetest.registered_nodes[nod]
|
||||||
def = def and def.place_param2 or 0
|
def = def and def.place_param2
|
||||||
|
|
||||||
|
-- if param2 not preset then get from existing node
|
||||||
|
if not def then
|
||||||
|
local node = minetest.get_node_or_nil(pos2)
|
||||||
|
def = node and node.param2 or 0
|
||||||
|
end
|
||||||
|
|
||||||
minetest.set_node(pos2, {name = nod, param2 = def})
|
minetest.set_node(pos2, {name = nod, param2 = def})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user