Fix bone meal usage on rubber tree saplings in mcl2
This commit is contained in:
parent
2c63498d78
commit
462e731bb7
30
nodes.lua
30
nodes.lua
@ -354,6 +354,19 @@ if not industrialtest.mods.mclRubber then
|
|||||||
name=="mcl_core:podzol" or name=="mcl_core:podzol_snow" or
|
name=="mcl_core:podzol" or name=="mcl_core:podzol_snow" or
|
||||||
name=="mcl_core:dirt" or name=="mcl_core:mycelium" or name=="mcl_core:coarse_dirt"
|
name=="mcl_core:dirt" or name=="mcl_core:mycelium" or name=="mcl_core:coarse_dirt"
|
||||||
end)
|
end)
|
||||||
|
definition._on_bone_meal=function(itemstack,user,pointed)
|
||||||
|
if industrialtest.random:next(1,100)>45 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local meta=minetest.get_meta(pointed.under)
|
||||||
|
local stage=meta:get_int("stage") or 0
|
||||||
|
stage=stage+1
|
||||||
|
if stage>=3 then
|
||||||
|
industrialtest.internal.makeRubberTree(pointed.under)
|
||||||
|
else
|
||||||
|
meta:set_int("stage",stage)
|
||||||
|
end
|
||||||
|
end
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
label="Rubber sapling growing",
|
label="Rubber sapling growing",
|
||||||
nodenames={"industrialtest:rubber_sapling"},
|
nodenames={"industrialtest:rubber_sapling"},
|
||||||
@ -379,23 +392,6 @@ if not industrialtest.mods.mclRubber then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
mcl_dye.register_on_bone_meal_apply(function(pointed)
|
|
||||||
local node=minetest.get_node(pointed.under)
|
|
||||||
if node.name~="industrialtest:rubber_sapling" then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
if industrialtest.random:next(1,100)>45 then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
local meta=minetest.get_meta(pointed.under)
|
|
||||||
local stage=meta:get_int("stage") or 0
|
|
||||||
stage=stage+1
|
|
||||||
if stage>=3 then
|
|
||||||
industrialtest.internal.makeRubberTree(pointed.under)
|
|
||||||
else
|
|
||||||
meta:set_int("stage",stage)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
end
|
||||||
definition.groups.attached_node=1
|
definition.groups.attached_node=1
|
||||||
definition.groups.dig_immediate=3
|
definition.groups.dig_immediate=3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user