Add minetest.get_nearby_objects

This commit is contained in:
Elias Fleckenstein 2021-01-07 16:04:06 +01:00
parent 47d0882cce
commit 19e0528e33
2 changed files with 6 additions and 0 deletions

View File

@ -54,3 +54,7 @@ end
function core.close_formspec(formname)
return core.show_formspec(formname, "")
end
function core.get_nearby_objects(radius)
return core.get_objects_inside_radius(core.localplayer:get_pos(), radius)
end

View File

@ -934,6 +934,8 @@ Call these functions only at load time!
* `minetest.get_objects_inside_radius(pos, radius)`: returns a list of
ClientObjectRefs.
* `radius`: using an euclidean metric
* `minetest.get_nearby_objects(radius)`
* alias for minetest.get_objects_inside_radius(minetest.localplayer:get_pos(), radius)
* `minetest.disconnect()`
* Disconnect from the server and exit to main menu.
* Returns `false` if the client is already disconnecting otherwise returns `true`.