File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -141,8 +141,18 @@ local function may_replace(pos, player)
141141 return false
142142 end
143143
144- -- allow replacing air and liquids
145- if node_name == " air" or node_definition .liquidtype ~= " none" then
144+ -- allow replacing air
145+ if node_name == " air" then
146+ return true
147+ end
148+
149+ -- don't replace nodes inside protections
150+ if minetest .is_protected (pos , player :get_player_name ()) then
151+ return false
152+ end
153+
154+ -- allow replacing liquids
155+ if node_definition .liquidtype ~= " none" then
146156 return true
147157 end
148158
@@ -154,8 +164,7 @@ local function may_replace(pos, player)
154164
155165 -- default to each nodes buildable_to; if a placed block would replace it, why shouldn't bones?
156166 -- flowers being squished by bones are more realistical than a squished stone, too
157- -- exception are of course any protected buildable_to
158- return node_definition .buildable_to and not minetest .is_protected (pos , player :get_player_name ())
167+ return node_definition .buildable_to
159168end
160169
161170local drop = function (pos , itemstack )
You can’t perform that action at this time.
0 commit comments