minetest.get_objects_inside_radius(pos, radius)
minetest.set_timeofday(val): val: 0...1; 0 = midnight, 0.5 = midday
minetest.get_timeofday()
+minetest.get_gametime(): returns the time, in seconds, since the world was created
minetest.find_node_near(pos, radius, nodenames) -> pos or nil
^ nodenames: eg. {"ignore", "group:tree"} or "default:dirt"
minetest.find_nodes_in_area(minp, maxp, nodenames) -> list of positions
return 1;
}
+// minetest.get_gametime()
+int ModApiEnvMod::l_get_gametime(lua_State *L)
+{
+ GET_ENV_PTR;
+
+ int game_time = env->getGameTime();
+ lua_pushnumber(L, game_time);
+ return 1;
+}
+
// minetest.find_node_near(pos, radius, nodenames) -> pos or nil
// nodenames: eg. {"ignore", "group:tree"} or "default:dirt"
API_FCT(get_objects_inside_radius);
API_FCT(set_timeofday);
API_FCT(get_timeofday);
+ API_FCT(get_gametime);
API_FCT(find_node_near);
API_FCT(find_nodes_in_area);
API_FCT(get_perlin);
// minetest.get_timeofday() -> 0...1
static int l_get_timeofday(lua_State *L);
+ // minetest.get_gametime()
+ static int l_get_gametime(lua_State *L);
+
// minetest.find_node_near(pos, radius, nodenames) -> pos or nil
// nodenames: eg. {"ignore", "group:tree"} or "default:dirt"
static int l_find_node_near(lua_State *L);