aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
Commit message (Expand)AuthorAge
* Add open user data button to main menu (#10579)rubenwardy2020-12-19
* ObjectRef: Re-add legacy code for set_physics_override (#10585)SmallJoker2020-11-10
* Fix ObjectRef errors due to lua_isnil() (#10564)Zughy2020-11-04
* Fix incorrect deprecation hintsSmallJoker2020-11-01
* Fix segfault in deprecation logging due to tail call, log by default (#10174)rubenwardy2020-10-31
* Clean up l_object.cpp (#10512)Zughy2020-10-22
* Fix float argument check in minetest.set_timeofday() (#10483)Zughy2020-10-13
* Add ObjectRef:get_children() (#10480)Zughy2020-10-13
* Pass ContentFeatures as reference to read_content_features (#10464)JosiahWI2020-10-13
* Add missing type check to InvRef:set_lists() (#10476)Zughy2020-10-11
* Add a short_description to be used by mods (#8980)DS2020-10-09
* Add minetest.get_artificial_light and minetest.get_natural_light (#5680)HybridDog2020-10-06
* Remove unused functions reported by cppcheck (#10463)SmallJoker2020-10-05
* Minimap as HUD element with API controlPierre-Yves Rollo2020-10-04
* Add First Person Attachments (#10360)Jordan Snelling2020-10-04
* Deprecate get_player_velocity and add_player_velocity (#10173)rubenwardy2020-10-04
* Clean up server-side translations, remove global variable (#10075)rubenwardy2020-09-16
* Lua API: Register missing get_texture_mod function (#10338)karamel592020-08-27
* Allow binding dig, place actions to keys; remove LMB/RMB hardcodingANAND2020-08-15
* Add PUT and DELETE request + specific method value to HTTP API (#9909)Lejo2020-07-29
* Sanitize world directory names on create. Keep original name separate (#9432)Hugues Ross2020-07-28
* Revert "Auto delete MetaData when = 0 (#8770)" (#10183)Lars Müller2020-07-16
* Implement grouped mode for find_nodes_in_area (#9888)sfan52020-07-14
* Fix HTTP API not being available in async mainmenu (#10086)rubenwardy2020-06-22
* Exposing the zoom key to Lua API (#9903)Lars Müller2020-06-13
* Server pushing media at runtime (#9961)sfan52020-06-13
* LuaItemStack: Add __tostring metamethod (#8785)Paul Ouellette2020-06-09
* Add HTTP API to main menu (#9998)rubenwardy2020-06-06
* Implement spawning particles with node texture appearancesfan52020-05-23
* Modernize include guards and add missing ones (#9898)Awkor2020-05-23
* Check for valid base64 before decoding (#9904)Lejo12020-05-22
* Cleanup of particle & particlespawner structures and code (#9893)sfan52020-05-22
* Allow more than 255 biomes, document new maximum (#9855)Paramat2020-05-20
* Rework functionality of leveled nodes (#9852)Wuzzy2020-05-19
* Add core.open_url() to main menu API (#8592)rubenwardy2020-05-17
* CSM: Bugfixes to camera:get_pos() and camera:get_fov()sfan52020-05-14
* Server class code cleanups (#9769)Loïc Blot2020-05-07
* Fix remaining issues with mapgen scriptapisfan52020-05-05
* Give the Mapgen on each EmergeThread its own Biome/Ore/Deco/SchemManager copysfan52020-05-05
* Sky API: Rename *_tint to fog_*_tint for consistencySmallJoker2020-05-05
* Auto delete MetaData when = 0 (#8770)Lejo2020-05-02
* set_fov: Add support for time-based transitions (#9705)ANAND2020-05-02
* Allow connection info to be missing from minetest.get_player_information() (#...sfan52020-05-01
* Give the online lua mainmenu also the client_list and mods (#8691)Lejo2020-05-01
* Forbid object:attach(obj, ...) (#9762)Loïc Blot2020-04-27
* Script: Enforce type checks if not nil (#9748)SmallJoker2020-04-27
* script: Put getGuiEngine() inside a client-only #ifdefsfan52020-04-27
* script: Fix add_entity returning unusable ref if object deleted in on_activatesfan52020-04-27
* Add server side translations capability (#9733)EvidenceB Kidscode2020-04-25
* Fix configuration caching in log_deprecated (#9697)HybridDog2020-04-22
l kwb">int table = lua_gettop(L); lua_pushnil(L); while (lua_next(L, table) != 0) { const char *key = lua_tostring(L, -2); if(strcmp(key,"pos")==0){ pos=check_v3f(L, -1); }else if(strcmp(key,"vel")==0){ vel=check_v3f(L, -1); }else if(strcmp(key,"acc")==0){ acc=check_v3f(L, -1); }else if(strcmp(key,"expirationtime")==0){ expirationtime=luaL_checknumber(L, -1); }else if(strcmp(key,"size")==0){ size=luaL_checknumber(L, -1); }else if(strcmp(key,"collisiondetection")==0){ collisiondetection=lua_toboolean(L, -1); }else if(strcmp(key,"vertical")==0){ vertical=lua_toboolean(L, -1); }else if(strcmp(key,"texture")==0){ texture=luaL_checkstring(L, -1); }else if(strcmp(key,"playername")==0){ playername=luaL_checkstring(L, -1); } lua_pop(L, 1); } } if (strcmp(playername, "")==0) // spawn for all players { getServer(L)->spawnParticleAll(pos, vel, acc, expirationtime, size, collisiondetection, vertical, texture); } else { getServer(L)->spawnParticle(playername, pos, vel, acc, expirationtime, size, collisiondetection, vertical, texture); } return 1; } // add_particlespawner({amount=, time=, // minpos=, maxpos=, // minvel=, maxvel=, // minacc=, maxacc=, // minexptime=, maxexptime=, // minsize=, maxsize=, // collisiondetection=, // vertical=, // texture=, // player=}) // minpos/maxpos/minvel/maxvel/minacc/maxacc = {x=num, y=num, z=num} // minexptime/maxexptime = num (seconds) // minsize/maxsize = num // collisiondetection = bool // vertical = bool // texture = e.g."default_wood.png" int ModApiParticles::l_add_particlespawner(lua_State *L) { // Get parameters u16 amount = 1; v3f minpos, maxpos, minvel, maxvel, minacc, maxacc; minpos= maxpos= minvel= maxvel= minacc= maxacc= v3f(0, 0, 0); float time, minexptime, maxexptime, minsize, maxsize; time= minexptime= maxexptime= minsize= maxsize= 1; bool collisiondetection, vertical; collisiondetection= vertical= false; std::string texture = ""; const char *playername = ""; if (lua_gettop(L) > 1) //deprecated { log_deprecated(L,"Deprecated add_particlespawner call with individual parameters instead of definition"); amount = luaL_checknumber(L, 1); time = luaL_checknumber(L, 2); minpos = check_v3f(L, 3); maxpos = check_v3f(L, 4); minvel = check_v3f(L, 5); maxvel = check_v3f(L, 6); minacc = check_v3f(L, 7); maxacc = check_v3f(L, 8); minexptime = luaL_checknumber(L, 9); maxexptime = luaL_checknumber(L, 10); minsize = luaL_checknumber(L, 11); maxsize = luaL_checknumber(L, 12); collisiondetection = lua_toboolean(L, 13); texture = luaL_checkstring(L, 14); if (lua_gettop(L) == 15) // only spawn for a single player playername = luaL_checkstring(L, 15); } else if (lua_istable(L, 1)) { int table = lua_gettop(L); lua_pushnil(L); while (lua_next(L, table) != 0) { const char *key = lua_tostring(L, -2); if(strcmp(key,"amount")==0){ amount=luaL_checknumber(L, -1); }else if(strcmp(key,"time")==0){ time=luaL_checknumber(L, -1); }else if(strcmp(key,"minpos")==0){ minpos=check_v3f(L, -1); }else if(strcmp(key,"maxpos")==0){ maxpos=check_v3f(L, -1); }else if(strcmp(key,"minvel")==0){ minvel=check_v3f(L, -1); }else if(strcmp(key,"maxvel")==0){ maxvel=check_v3f(L, -1); }else if(strcmp(key,"minacc")==0){ minacc=check_v3f(L, -1); }else if(strcmp(key,"maxacc")==0){ maxacc=check_v3f(L, -1); }else if(strcmp(key,"minexptime")==0){ minexptime=luaL_checknumber(L, -1); }else if(strcmp(key,"maxexptime")==0){ maxexptime=luaL_checknumber(L, -1); }else if(strcmp(key,"minsize")==0){ minsize=luaL_checknumber(L, -1); }else if(strcmp(key,"maxsize")==0){ maxsize=luaL_checknumber(L, -1); }else if(strcmp(key,"collisiondetection")==0){ collisiondetection=lua_toboolean(L, -1); }else if(strcmp(key,"vertical")==0){ vertical=lua_toboolean(L, -1); }else if(strcmp(key,"texture")==0){ texture=luaL_checkstring(L, -1); }else if(strcmp(key,"playername")==0){ playername=luaL_checkstring(L, -1); } lua_pop(L, 1); } } if (strcmp(playername, "")==0) //spawn for all players { u32 id = getServer(L)->addParticleSpawnerAll( amount, time, minpos, maxpos, minvel, maxvel, minacc, maxacc, minexptime, maxexptime, minsize, maxsize, collisiondetection, vertical, texture); lua_pushnumber(L, id); } else { u32 id = getServer(L)->addParticleSpawner(playername, amount, time, minpos, maxpos, minvel, maxvel, minacc, maxacc, minexptime, maxexptime, minsize, maxsize, collisiondetection, vertical, texture); lua_pushnumber(L, id); } return 1; } // delete_particlespawner(id, player) // player (string) is optional int ModApiParticles::l_delete_particlespawner(lua_State *L) { // Get parameters u32 id = luaL_checknumber(L, 1); if (lua_gettop(L) == 2) // only delete for one player { const char *playername = luaL_checkstring(L, 2); getServer(L)->deleteParticleSpawner(playername, id); } else // delete for all players { getServer(L)->deleteParticleSpawnerAll(id); } return 1; } void ModApiParticles::Initialize(lua_State *L, int top) { API_FCT(add_particle); API_FCT(add_particlespawner); API_FCT(delete_particlespawner); }