mirror of
https://github.com/minefaco/stripped_tree.git
synced 2024-12-11 08:23:23 +01:00
Update init.lua
This commit is contained in:
parent
a6b1b9488d
commit
a86ac9a1b3
7
init.lua
7
init.lua
@ -1,3 +1,5 @@
|
|||||||
|
--check if creative for tree bark
|
||||||
|
local creative_mode = minetest.settings:get_bool("creative_mode")
|
||||||
--Register nodes
|
--Register nodes
|
||||||
local trunk_names = {
|
local trunk_names = {
|
||||||
"tree", "jungletree", "aspen_tree", "acacia_tree", "pine_tree",
|
"tree", "jungletree", "aspen_tree", "acacia_tree", "pine_tree",
|
||||||
@ -64,11 +66,10 @@ for _, axe_name in ipairs(axe_types) do
|
|||||||
minetest.swap_node(pos, {name = "default:stripped_"..n, param2 = old_node.param2})
|
minetest.swap_node(pos, {name = "default:stripped_"..n, param2 = old_node.param2})
|
||||||
itemstack:add_wear(65535 / 299) -- 300 uses
|
itemstack:add_wear(65535 / 299) -- 300 uses
|
||||||
|
|
||||||
--(It works, but i think that this is not the better way for some reason)
|
if not creative_mode then
|
||||||
--if not minetest.check_player_privs(user, {creative=true}) then
|
|
||||||
local inv = user:get_inventory()
|
local inv = user:get_inventory()
|
||||||
inv:add_item("main", {name="default:tree_bark"})
|
inv:add_item("main", {name="default:tree_bark"})
|
||||||
--end
|
end
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user