mirror of
https://github.com/minetest/minetest_game.git
synced 2024-12-22 23:10:17 +01:00
Don't replace protected liquids with bones (#2790)
This commit is contained in:
parent
29866dbcb3
commit
7ae983b669
@ -141,8 +141,18 @@ local function may_replace(pos, player)
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
-- allow replacing air and liquids
|
-- allow replacing air
|
||||||
if node_name == "air" or node_definition.liquidtype ~= "none" then
|
if node_name == "air" then
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
|
||||||
|
-- don't replace nodes inside protections
|
||||||
|
if minetest.is_protected(pos, player:get_player_name()) then
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- allow replacing liquids
|
||||||
|
if node_definition.liquidtype ~= "none" then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -154,8 +164,7 @@ local function may_replace(pos, player)
|
|||||||
|
|
||||||
-- default to each nodes buildable_to; if a placed block would replace it, why shouldn't bones?
|
-- default to each nodes buildable_to; if a placed block would replace it, why shouldn't bones?
|
||||||
-- flowers being squished by bones are more realistical than a squished stone, too
|
-- flowers being squished by bones are more realistical than a squished stone, too
|
||||||
-- exception are of course any protected buildable_to
|
return node_definition.buildable_to
|
||||||
return node_definition.buildable_to and not minetest.is_protected(pos, player:get_player_name())
|
|
||||||
end
|
end
|
||||||
|
|
||||||
local drop = function(pos, itemstack)
|
local drop = function(pos, itemstack)
|
||||||
|
Loading…
Reference in New Issue
Block a user