1
0
mirror of https://github.com/minetest/minetest_game.git synced 2024-12-22 15:00:18 +01:00

Don't replace protected liquids with bones (#2790)

This commit is contained in:
auouymous 2020-12-08 14:20:16 -07:00 committed by GitHub
parent 29866dbcb3
commit 7ae983b669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)