Using ":" notation to treat functions as methods is now deprecated

in favor of more normal "." notation.

In the process, I have renamed a few functions in favor of
more meaningful names (see API.txt), and provided
"compatibility shims" for old mods where needed, with warnings.
This commit is contained in:
Vanessa Dannenberg
2021-04-20 16:27:17 -04:00
parent c4151a0701
commit 5148cca1b7
5 changed files with 98 additions and 74 deletions

View File

@ -2,7 +2,7 @@
-- function to decide if a node has a wall that's in verticals_list{}
-- returns wall direction of valid node, or nil if invalid.
function biome_lib:find_adjacent_wall(pos, verticals, randomflag)
function biome_lib.find_adjacent_wall(pos, verticals, randomflag)
local verts = dump(verticals)
if randomflag then
local walltab = {}
@ -27,7 +27,7 @@ end
-- node that matches the ground table. Returns the new position, or nil if
-- height limit is exceeded before finding it.
function biome_lib:search_downward(pos, heightlimit, ground)
function biome_lib.search_downward(pos, heightlimit, ground)
for i = 0, heightlimit do
if string.find(dump(ground), minetest.get_node({x=pos.x, y=pos.y-i, z = pos.z}).name) then
return {x=pos.x, y=pos.y-i, z = pos.z}
@ -36,7 +36,7 @@ function biome_lib:search_downward(pos, heightlimit, ground)
return false
end
function biome_lib:find_open_side(pos)
function biome_lib.find_open_side(pos)
if minetest.get_node({ x=pos.x-1, y=pos.y, z=pos.z }).name == "air" then
return {newpos = { x=pos.x-1, y=pos.y, z=pos.z }, facedir = 2}
end