diff --git a/airblock.lua b/airblock.lua index 5a8109d..81a00a0 100644 --- a/airblock.lua +++ b/airblock.lua @@ -1,5 +1,12 @@ local S = minetest.get_translator("tech_additions") +local replace_allowed = {} +replace_allowed["air"] = true +replace_allowed["default:water_source"] = true +replace_allowed["default:water_flowing"] = true +replace_allowed["default:river_water_source"] = true +replace_allowed["default:river_water_flowing"] = true + local placeairblock = function () return function(itemstack, user, pointed_thing) local name = user:get_player_name() @@ -22,11 +29,7 @@ local placeairblock = function () end local getPos = minetest.get_node(new_pos) - if getPos.name == "air" or - getPos.name == "default:water_source" or - getPos.name == "default:water_flowing" or - getPos.name == "default:river_water_source" or - getPos.name == "default:river_water_flowing" then + if replace_allowed[getPos.name] then minetest.set_node(new_pos, {name="tech_additions:air_block"}) end end