mirror of
https://github.com/luanti-org/minetest_game.git
synced 2025-05-20 22:33:16 -04:00
add minetest.is_protected support to buckets
This commit is contained in:
parent
64fdb49a32
commit
0f5a611749
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Reference in a new issue