parent
3a922065a0
commit
0844f44e57
|
@ -12,6 +12,38 @@ else
|
|||
})
|
||||
end
|
||||
|
||||
-- bonemeal item
|
||||
minetest.register_craftitem("ethereal:bonemeal", {
|
||||
description = S("Bone Meal"),
|
||||
inventory_image = "bonemeal.png",
|
||||
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
|
||||
if pointed_thing.type == "node" then
|
||||
|
||||
-- Check if node protected
|
||||
if minetest.is_protected(pointed_thing.under, user:get_player_name()) then
|
||||
return
|
||||
end
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
|
||||
local item = user:get_wielded_item()
|
||||
|
||||
item:take_item()
|
||||
user:set_wielded_item(item)
|
||||
end
|
||||
|
||||
growth(pointed_thing)
|
||||
|
||||
itemstack:take_item()
|
||||
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- bonemeal recipes
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
|
@ -269,34 +301,3 @@ local function growth(pointed_thing)
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- bonemeal item
|
||||
minetest.register_craftitem("ethereal:bonemeal", {
|
||||
description = S("Bone Meal"),
|
||||
inventory_image = "bonemeal.png",
|
||||
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
|
||||
if pointed_thing.type == "node" then
|
||||
|
||||
-- Check if node protected
|
||||
if minetest.is_protected(pointed_thing.under, user:get_player_name()) then
|
||||
return
|
||||
end
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
|
||||
local item = user:get_wielded_item()
|
||||
|
||||
item:take_item()
|
||||
user:set_wielded_item(item)
|
||||
end
|
||||
|
||||
growth(pointed_thing)
|
||||
|
||||
itemstack:take_item()
|
||||
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue