Merge pull request #10 from melzua/master
bucket: add a check for is_protected
This commit is contained in:
commit
f8d27ae795
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Crafting items
|
-- Crafting items
|
||||||
--
|
--
|
||||||
|
@ -102,6 +101,9 @@ minetest.register_craftitem(
|
||||||
on_place = function(itemstack, user, pointed_thing)
|
on_place = function(itemstack, user, pointed_thing)
|
||||||
if pointed_thing.type ~= "node" then return end
|
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()
|
itemstack:take_item()
|
||||||
|
|
||||||
local inv=user:get_inventory()
|
local inv=user:get_inventory()
|
||||||
|
@ -135,6 +137,9 @@ minetest.register_craftitem(
|
||||||
on_place = function(itemstack, user, pointed_thing)
|
on_place = function(itemstack, user, pointed_thing)
|
||||||
if pointed_thing.type ~= "node" then return end
|
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()
|
itemstack:take_item()
|
||||||
|
|
||||||
local inv=user:get_inventory()
|
local inv=user:get_inventory()
|
||||||
|
@ -168,6 +173,9 @@ minetest.register_craftitem(
|
||||||
on_place = function(itemstack, user, pointed_thing)
|
on_place = function(itemstack, user, pointed_thing)
|
||||||
if pointed_thing.type ~= "node" then return end
|
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()
|
itemstack:take_item()
|
||||||
|
|
||||||
local inv=user:get_inventory()
|
local inv=user:get_inventory()
|
||||||
|
|
Loading…
Reference in New Issue