forked from mtcontrib/bonemeal
rename creative check function
This commit is contained in:
parent
ebbec592bf
commit
a5a4798aed
8
init.lua
8
init.lua
@ -12,7 +12,7 @@ local S = minetest.get_translator and minetest.get_translator("bonemeal") or
|
|||||||
|
|
||||||
-- creative check
|
-- creative check
|
||||||
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
|
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
|
||||||
function is_creative(name)
|
function bonemeal.is_creative(name)
|
||||||
return creative_mode_cache or minetest.check_player_privs(name, {creative = true})
|
return creative_mode_cache or minetest.check_player_privs(name, {creative = true})
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -495,7 +495,7 @@ minetest.register_craftitem("bonemeal:mulch", {
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- take item if not in creative
|
-- take item if not in creative
|
||||||
if not is_creative(user:get_player_name()) then
|
if not bonemeal.is_creative(user:get_player_name()) then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -525,7 +525,7 @@ minetest.register_craftitem("bonemeal:bonemeal", {
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- take item if not in creative
|
-- take item if not in creative
|
||||||
if not is_creative(user:get_player_name()) then
|
if not bonemeal.is_creative(user:get_player_name()) then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -555,7 +555,7 @@ minetest.register_craftitem("bonemeal:fertiliser", {
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- take item if not in creative
|
-- take item if not in creative
|
||||||
if not is_creative(user:get_player_name()) then
|
if not bonemeal.is_creative(user:get_player_name()) then
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user