Merge pull request #10 from melzua/master

bucket: add a check for is_protected
This commit is contained in:
kaadmy 2015-11-14 11:52:07 -08:00
commit f8d27ae795
1 changed files with 10 additions and 2 deletions

View File

@ -1,4 +1,3 @@
--
-- Crafting items
--
@ -102,6 +101,9 @@ minetest.register_craftitem(
on_place = function(itemstack, user, pointed_thing)
if pointed_thing.type ~= "node" then return end
local pos_protected = minetest.get_pointed_thing_position(pointed_thing, true)
if minetest.is_protected(pos_protected, user) then return end
itemstack:take_item()
local inv=user:get_inventory()
@ -135,6 +137,9 @@ minetest.register_craftitem(
on_place = function(itemstack, user, pointed_thing)
if pointed_thing.type ~= "node" then return end
local pos_protected = minetest.get_pointed_thing_position(pointed_thing, true)
if minetest.is_protected(pos_protected, user) then return end
itemstack:take_item()
local inv=user:get_inventory()
@ -168,6 +173,9 @@ minetest.register_craftitem(
on_place = function(itemstack, user, pointed_thing)
if pointed_thing.type ~= "node" then return end
local pos_protected = minetest.get_pointed_thing_position(pointed_thing, true)
if minetest.is_protected(pos_protected, user) then return end
itemstack:take_item()
local inv=user:get_inventory()
@ -280,4 +288,4 @@ minetest.register_craftitem(
end,
})
default.log("craftitems", "loaded")
default.log("craftitems", "loaded")