forked from VoxeLibre/VoxeLibre
sweet berries plantable not only on farming soil
This commit is contained in:
parent
8fd39a5d0b
commit
30f0b349bf
|
@ -1,5 +1,7 @@
|
||||||
local S = minetest.get_translator(minetest.get_current_modname())
|
local S = minetest.get_translator(minetest.get_current_modname())
|
||||||
|
|
||||||
|
local planton = {"mcl_core:dirt_with_grass","mcl_core:dirt","mcl_core:podzol","mcl_core:coarse_dirt","mcl_farming:soil","mcl_moss:moss"}
|
||||||
|
|
||||||
for i=0, 3 do
|
for i=0, 3 do
|
||||||
local texture = "mcl_farming_sweet_berry_bush_" .. i .. ".png"
|
local texture = "mcl_farming_sweet_berry_bush_" .. i .. ".png"
|
||||||
local node_name = "mcl_farming:sweet_berry_bush_" .. i
|
local node_name = "mcl_farming:sweet_berry_bush_" .. i
|
||||||
|
@ -40,12 +42,14 @@ minetest.register_craftitem("mcl_farming:sweet_berry", {
|
||||||
groups = { food = 2, eatable = 1, compostability=30 },
|
groups = { food = 2, eatable = 1, compostability=30 },
|
||||||
on_secondary_use = minetest.item_eat(1),
|
on_secondary_use = minetest.item_eat(1),
|
||||||
on_place = function(itemstack, placer, pointed_thing)
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
local new = mcl_farming:place_seed(itemstack, placer, pointed_thing, "mcl_sweet_berry:sweet_berry_bush_0")
|
if pointed_thing.type == "node" and table.indexof(planton,minetest.get_node(pointed_thing.under).name) ~= -1 and minetest.get_node(pointed_thing.above).name == "air" then
|
||||||
if new then
|
minetest.set_node(pointed_thing.above,{name="mcl_farming:sweet_berry_bush_0"})
|
||||||
return new
|
if not minetest.is_creative_enabled(placer:get_player_name()) then
|
||||||
else
|
itemstack:take_item()
|
||||||
return minetest.do_item_eat(1, nil, itemstack, placer, pointed_thing)
|
end
|
||||||
|
return itemstack
|
||||||
end
|
end
|
||||||
|
return minetest.do_item_eat(1, nil, itemstack, placer, pointed_thing)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
minetest.register_alias("mcl_sweet_berry:sweet_berry", "mcl_farming:sweet_berry")
|
minetest.register_alias("mcl_sweet_berry:sweet_berry", "mcl_farming:sweet_berry")
|
||||||
|
|
Loading…
Reference in New Issue