bonemeal: typofix, and add missing craftitem 🐈

This commit is contained in:
tchncs 2016-11-08 23:29:54 +01:00
parent c869765feb
commit 3b573679c6

View file

@ -112,7 +112,7 @@ local function growth(pointed_thing)
end
-- grow default tree
elseif node.name == "default:sapling"
if node.name == "default:sapling"
and enough_height(pos, 7) then
default.grow_new_apple_tree(pos)
@ -193,3 +193,34 @@ 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,
})