add minetest.is_protected support to buckets

This commit is contained in:
Brandon 2013-12-13 22:51:13 -06:00
parent 64fdb49a32
commit 0f5a611749

View file

@ -40,8 +40,8 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
liquids_pointable = true, liquids_pointable = true,
groups = {not_in_creative_inventory=1}, groups = {not_in_creative_inventory=1},
on_place = function(itemstack, user, pointed_thing) on_place = function(itemstack, user, pointed_thing)
-- Must be pointing to node -- Must be pointing to node and must pass protection
if pointed_thing.type ~= "node" then if pointed_thing.type ~= "node" or minetest.is_protected(pointed_thing.under,user:get_player_name()) then
return return
end end
@ -102,8 +102,8 @@ minetest.register_craftitem("bucket:bucket_empty", {
stack_max = 1, stack_max = 1,
liquids_pointable = true, liquids_pointable = true,
on_use = function(itemstack, user, pointed_thing) on_use = function(itemstack, user, pointed_thing)
-- Must be pointing to node -- Must be pointing to node and must pass protection
if pointed_thing.type ~= "node" then if pointed_thing.type ~= "node" or minetest.is_protected(pointed_thing.under,user:get_player_name())then
return return
end end
-- Check if pointing to a liquid source -- Check if pointing to a liquid source