aboutsummaryrefslogtreecommitdiff
path: root/doc
Commit message (Expand)AuthorAge
...
* fix missing parameters in some mentions of entity callbacksraymoo2016-09-12
* Return nil on empty get_area() (#4508)James Stevenson2016-09-10
* Add minetest.unregister_item and minetest.register_alias_forcepaly22016-09-08
* Allow fields to choose whether they close on enter pressrubenwardy2016-08-27
* Make plantlike drawtype more funAuke Kok2016-08-26
* Lua_api.txt: Change 'maxwear' to 'uses' in 'tool_capabilities'DonBatman2016-08-14
* Add an [opacity:<r> texture modifier. Makes the base image transparent accord...Thomas--S2016-08-12
* texture_packs.txt: Document special texturesSmallJoker2016-07-30
* Documentation: Create texture_packs.txtrubenwardy2016-07-30
* lua_api.txt: Document how to properly clear node metadatamtango6882016-07-30
* Main menu, lua_api.txt: Fix mod/texture pack screenshot size issuesWuzzy2016-07-27
* lua_api.txt: Remove tooltip checkbox[] elementJames Stevenson2016-07-21
* HTTP lua API docs: correct some function referencesest312016-07-12
* Builtin/profiler: Replace game profiler (#4245)Tim2016-07-12
* Lua_api.txt: Fix description of node drop behaviourDuane2016-07-12
* Adding minetest.clear_craftFoghrye42016-07-05
* Add MapSettingsManager and new mapgen setting script API functionskwolekr2016-07-03
* Remove old docs. We have VCS history anyways. (#4266)Pavel Puchkin2016-07-03
* Player: New get_look, set_look APIraymoo2016-06-24
* Builtin/game/item: Add `place_param2` nodedef fieldAuke Kok2016-06-17
* Server: Add reason for leave to `on_leaveplayer` callbacksDiego Martinez2016-06-11
* Lua_api.txt: Split long lines. Capitalise 'Biome API'. Minor editsparamat2016-06-07
* Biome API: Add per-biome riverbed material and depthparamat2016-06-05
* PcgRandom: Fix/improve documentationkwolekr2016-06-04
* Add colored text (not only colored chat).Ekdohibs2016-05-31
* Add minetest.check_password_entry callbackest312016-05-30
* Particles: Add option to remove particles on collisionAuke Kok2016-05-28
* Add base64 encoding and decoding to the lua api. (#3919)red-0012016-05-27
* Bump version to 0.4.14sfan52016-05-15
* Lua_api.txt: Fix documentation for facedir rotationparamat2016-05-10
* Add [resize texture modifier Resizes the texture to the given dimensions.SmallJoker2016-05-09
* Lua_api.txt: Add warnings of l-system lighting bugparamat2016-05-06
* Builtin: Add basic_privs settingrubenwardy2016-04-28
* tile.cpp: Automatically upscale lower resolution textureSmallJoker2016-04-25
* Hud: Fix offset being ignored by inventory barrubenwardy2016-04-10
* Document hpchange callback ordering thing (#3981)raymoo2016-04-10
* Clearer explanation of [colorize with alphaSamuel Sieb2016-04-07
* Add an option to colorize to respect the destination alphaSamuel Sieb2016-04-03
* lua_api.txt: improve vector documentationest312016-03-19
* Allow nodes to specify which sides to connect to.Auke Kok2016-03-12
* Nodebox: Allow nodeboxes to "connect"Auke Kok2016-03-12
* Add consistent monotonic day counter - get_day_count()Auke Kok2016-03-09
* Add AreaStore custom ID APIShadowNinja2016-03-07
* Implement AreaStore serializationShadowNinja2016-03-07
* Simplify AreaStore ID managementShadowNinja2016-03-07
* Add minetest.register_lbm() to run code on block load onlyest312016-03-07
* Decoration API: Allow force_placement of simple decorationsparamat2016-03-04
* Require minetest.request_http_api to be called from the mod's main scopeJeija2016-03-03
* Fix a mistake in the world format documentationAleksey Vorona2016-03-03
* Add Lua interface to HTTPFetchRequestJeija2016-02-22
7, 1, error_handler)); if(!lua_isnumber(L, -1)) throw LuaError("allow_move should return a number. name=" + name); int ret = luaL_checkinteger(L, -1); lua_pop(L, 2); // Pop integer and error handler return ret; } // Return number of accepted items to be put int ScriptApiDetached::detached_inventory_AllowPut( const std::string &name, const std::string &listname, int index, ItemStack &stack, ServerActiveObject *player) { SCRIPTAPI_PRECHECKHEADER int error_handler = PUSH_ERROR_HANDLER(L); // Push callback function on stack if (!getDetachedInventoryCallback(name, "allow_put")) return stack.count; // All will be accepted // Call function(inv, listname, index, stack, player) InventoryLocation loc; loc.setDetached(name); InvRef::create(L, loc); // inv lua_pushstring(L, listname.c_str()); // listname lua_pushinteger(L, index + 1); // index LuaItemStack::create(L, stack); // stack objectrefGetOrCreate(L, player); // player PCALL_RES(lua_pcall(L, 5, 1, error_handler)); if (!lua_isnumber(L, -1)) throw LuaError("allow_put should return a number. name=" + name); int ret = luaL_checkinteger(L, -1); lua_pop(L, 2); // Pop integer and error handler return ret; } // Return number of accepted items to be taken int ScriptApiDetached::detached_inventory_AllowTake( const std::string &name, const std::string &listname, int index, ItemStack &stack, ServerActiveObject *player) { SCRIPTAPI_PRECHECKHEADER int error_handler = PUSH_ERROR_HANDLER(L); // Push callback function on stack if (!getDetachedInventoryCallback(name, "allow_take")) return stack.count; // All will be accepted // Call function(inv, listname, index, stack, player) InventoryLocation loc; loc.setDetached(name); InvRef::create(L, loc); // inv lua_pushstring(L, listname.c_str()); // listname lua_pushinteger(L, index + 1); // index LuaItemStack::create(L, stack); // stack objectrefGetOrCreate(L, player); // player PCALL_RES(lua_pcall(L, 5, 1, error_handler)); if (!lua_isnumber(L, -1)) throw LuaError("allow_take should return a number. name=" + name); int ret = luaL_checkinteger(L, -1); lua_pop(L, 2); // Pop integer and error handler return ret; } // Report moved items void ScriptApiDetached::detached_inventory_OnMove( const std::string &name, const std::string &from_list, int from_index, const std::string &to_list, int to_index, int count, ServerActiveObject *player) { SCRIPTAPI_PRECHECKHEADER int error_handler = PUSH_ERROR_HANDLER(L); // Push callback function on stack if (!getDetachedInventoryCallback(name, "on_move")) return; // function(inv, from_list, from_index, to_list, to_index, count, player) // inv InventoryLocation loc; loc.setDetached(name); InvRef::create(L, loc); lua_pushstring(L, from_list.c_str()); // from_list lua_pushinteger(L, from_index + 1); // from_index lua_pushstring(L, to_list.c_str()); // to_list lua_pushinteger(L, to_index + 1); // to_index lua_pushinteger(L, count); // count objectrefGetOrCreate(L, player); // player PCALL_RES(lua_pcall(L, 7, 0, error_handler)); lua_pop(L, 1); // Pop error handler } // Report put items void ScriptApiDetached::detached_inventory_OnPut( const std::string &name, const std::string &listname, int index, ItemStack &stack, ServerActiveObject *player) { SCRIPTAPI_PRECHECKHEADER int error_handler = PUSH_ERROR_HANDLER(L); // Push callback function on stack if (!getDetachedInventoryCallback(name, "on_put")) return; // Call function(inv, listname, index, stack, player) // inv InventoryLocation loc; loc.setDetached(name); InvRef::create(L, loc); lua_pushstring(L, listname.c_str()); // listname lua_pushinteger(L, index + 1); // index LuaItemStack::create(L, stack); // stack objectrefGetOrCreate(L, player); // player PCALL_RES(lua_pcall(L, 5, 0, error_handler)); lua_pop(L, 1); // Pop error handler } // Report taken items void ScriptApiDetached::detached_inventory_OnTake( const std::string &name, const std::string &listname, int index, ItemStack &stack, ServerActiveObject *player) { SCRIPTAPI_PRECHECKHEADER int error_handler = PUSH_ERROR_HANDLER(L); // Push callback function on stack if (!getDetachedInventoryCallback(name, "on_take")) return; // Call function(inv, listname, index, stack, player) // inv InventoryLocation loc; loc.setDetached(name); InvRef::create(L, loc); lua_pushstring(L, listname.c_str()); // listname lua_pushinteger(L, index + 1); // index LuaItemStack::create(L, stack); // stack objectrefGetOrCreate(L, player); // player PCALL_RES(lua_pcall(L, 5, 0, error_handler)); lua_pop(L, 1); // Pop error handler } // Retrieves core.detached_inventories[name][callbackname] // If that is nil or on error, return false and stack is unchanged // If that is a function, returns true and pushes the // function onto the stack bool ScriptApiDetached::getDetachedInventoryCallback( const std::string &name, const char *callbackname) { lua_State *L = getStack(); lua_getglobal(L, "core"); lua_getfield(L, -1, "detached_inventories"); lua_remove(L, -2); luaL_checktype(L, -1, LUA_TTABLE); lua_getfield(L, -1, name.c_str()); lua_remove(L, -2); // Should be a table if(lua_type(L, -1) != LUA_TTABLE) { errorstream<<"Detached inventory \""<<name<<"\" not defined"<<std::endl; lua_pop(L, 1); return false; } setOriginFromTable(-1); lua_getfield(L, -1, callbackname); lua_remove(L, -2); // Should be a function or nil if(lua_type(L, -1) == LUA_TFUNCTION) { return true; } else if(lua_isnil(L, -1)) { lua_pop(L, 1); return false; } else { errorstream<<"Detached inventory \""<<name<<"\" callback \"" <<callbackname<<"\" is not a function"<<std::endl; lua_pop(L, 1); return false; } }