[air_block] refactor old nodes check
This commit is contained in:
parent
f85ef21668
commit
0010d400e0
13
airblock.lua
13
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
|
||||
|
Loading…
Reference in New Issue
Block a user