Don't subtract items when placing in gm-creative

This commit is contained in:
cora 2022-09-13 19:53:49 +02:00 committed by Gitea
parent b45336e852
commit 8fbe770cee

View File

@ -218,6 +218,11 @@ minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
end end
end) end)
--Don't subtract from inv when placing in gamemode-creative
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
if minetest.is_creative_enabled(placer:get_player_name()) then return true end
end)
local function in_table(n,h) local function in_table(n,h)
for k,v in pairs(h) do for k,v in pairs(h) do
if v == n then return true end if v == n then return true end