aboutsummaryrefslogtreecommitdiff
Commit message (Expand)AuthorAge
...
* Attend to review, re-arrange blank lines, update lua_api.txtparamat2019-04-14
* Fix regression in automatic_face_movement_max_rotation_per_secPedro Gimeno2019-04-14
* Various network performance improvements (#8125)Jozef Behran2019-04-14
* World start time: Move to first full light (day night ratio = 1000) (#8410)Paramat2019-04-13
* Add Irrlicht-specific smart pointer (#6814)Vitaliy2019-04-12
* Add Mkdocs API site (#8133)Paul Ouellette2019-04-12
* Add node field to PlayerHPChangeReason table (#8368)Paul Ouellette2019-04-11
* Nodedef 'drop' documentation: Improve, add tool filtering (#8458)Paramat2019-04-09
* util/hex.h: Remove whitespace-only line (#8460)ANAND2019-04-08
* daynightratio.h: Improve codestyle, minor optimisations (#8453)Paramat2019-04-08
* Android settings: Use 'simple' leaves instead of 'fancy' (#8440)Paramat2019-04-07
* Optimize random turns in dungeongen (#8129)Jozef Behran2019-04-07
* Find PostgreSQL correctly (#8435)adrido2019-04-07
* util/hex.h: Reserve result space in hex_encode()starling132019-04-07
* Add deprecation warnings for ObjectRef:get/set_attribute (#8443)ANAND2019-04-07
* Stabilise 'day night ratio' to fix object brightness flicker (#8417)Paramat2019-04-04
* Change sign of pitch angle in debug menu (#8438)ANAND2019-04-04
* Change pitch fly binding to 'P', add to change keys menu (#8314)rubenwardy2019-04-03
* Fix commentsLoic Blot2019-03-31
* Create ServerThread earlier in the startup processLoïc Blot2019-03-31
* mapgen: drop mapgen id from child mapgens.Loïc Blot2019-03-31
* EmergeManager::initMapgens use FATAL_ERROR if and drop boolean returnLoïc Blot2019-03-31
* Use unordered_map instead of map for craft definitions (#8432)HybridDog2019-03-31
* Optimize core.after in a simple way (#8351)DS2019-03-27
* Require 'waving = 3' in a nodedef to apply the liquid waving shader (#8418)Paramat2019-03-27
* Dungeons: Do not remove nodes that have 'is_ground_content = false' (#8423)Paramat2019-03-26
* Prevent multi-line chat messages server-side (#8420)rubenwardy2019-03-26
* Document 'highly unstable' mapgens instead of 'stable' mapgens (#8404)Paramat2019-03-20
* Fix texture rotation for wallmounted nodeboxessfan52019-03-19
* httpfetch: Disable IPv6 here too if requested by settings (#8399)sfan52019-03-18
* num_emerge_threads: Initialise value to cope with setting syntax error (#8396)Paramat2019-03-18
* num_emerge_threads: Fix documentation of automatic selectionparamat2019-03-17
* Add newline before itemstring in item tooltip (#8213)Wuzzy2019-03-17
* core.after: Improve assertion message (#8388)ANAND2019-03-17
* Builtin: Add vector.angle(). Returns the angle between 2 vectors (#7738)ANAND2019-03-17
* Lua_api.txt: Document blockpos, coordinate conversion, map terminology (#8376)Paramat2019-03-16
* num_emerge_threads: Warn of crashes when > 1 (#8357)Paramat2019-03-14
* LINT fixes since recent tooling updateLoïc Blot2019-03-14
* Update our tooling (Clang 5 -> 7, GCC 7 -> 8)Loïc Blot2019-03-14
* Valleys mapgen code rewrite (#8101)Paramat2019-03-14
* Drop GUIConfirmRegistration::m_address unused fieldLoïc Blot2019-03-12
* Fix cast from const by accessing string data directly (#8354)rubenwardy2019-03-12
* HPChange Reason: Fix push after free, and type being overwritten (#8359)rubenwardy2019-03-12
* Fix serialization of std::time_t by casting to u64 first (#8353)rubenwardy2019-03-10
* Document the `float` special group (#8306)DS2019-03-10
* Display pitch angle in debug menu (#8321)Ragulan R2019-03-10
* Confirm registration GUI: Remove positional strings to fix Windows bug (#8258)Paramat2019-03-10
* Abort when trying to set a not registered node (#7011)HybridDog2019-03-07
* World config: Make depends easier to read (#7396)HybridDog2019-03-07
* Optimize string handling in path search (#8098)Jozef Behran2019-03-07
lass="hl kwb">bool ScriptApiClient::on_receiving_message(const std::string &message) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_chat_messages lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_receiving_chat_message"); // Call callbacks lua_pushstring(L, message.c_str()); runCallbacks(1, RUN_CALLBACKS_MODE_OR_SC); return readParam<bool>(L, -1); } void ScriptApiClient::on_damage_taken(int32_t damage_amount) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_chat_messages lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_damage_taken"); // Call callbacks lua_pushinteger(L, damage_amount); runCallbacks(1, RUN_CALLBACKS_MODE_OR_SC); } void ScriptApiClient::on_hp_modification(int32_t newhp) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_chat_messages lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_hp_modification"); // Call callbacks lua_pushinteger(L, newhp); runCallbacks(1, RUN_CALLBACKS_MODE_OR_SC); } void ScriptApiClient::on_death() { SCRIPTAPI_PRECHECKHEADER // Get registered shutdown hooks lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_death"); // Call callbacks runCallbacks(0, RUN_CALLBACKS_MODE_FIRST); } void ScriptApiClient::environment_step(float dtime) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_globalsteps lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_globalsteps"); // Call callbacks lua_pushnumber(L, dtime); try { runCallbacks(1, RUN_CALLBACKS_MODE_FIRST); } catch (LuaError &e) { getClient()->setFatalError(std::string("Client environment_step: ") + e.what() + "\n" + script_get_backtrace(L)); } } void ScriptApiClient::on_formspec_input(const std::string &formname, const StringMap &fields) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_chat_messages lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_formspec_input"); // Call callbacks // param 1 lua_pushstring(L, formname.c_str()); // param 2 lua_newtable(L); StringMap::const_iterator it; for (it = fields.begin(); it != fields.end(); ++it) { const std::string &name = it->first; const std::string &value = it->second; lua_pushstring(L, name.c_str()); lua_pushlstring(L, value.c_str(), value.size()); lua_settable(L, -3); } runCallbacks(2, RUN_CALLBACKS_MODE_OR_SC); } bool ScriptApiClient::on_dignode(v3s16 p, MapNode node) { SCRIPTAPI_PRECHECKHEADER const NodeDefManager *ndef = getClient()->ndef(); // Get core.registered_on_dignode lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_dignode"); // Push data push_v3s16(L, p); pushnode(L, node, ndef); // Call functions runCallbacks(2, RUN_CALLBACKS_MODE_OR); return lua_toboolean(L, -1); } bool ScriptApiClient::on_punchnode(v3s16 p, MapNode node) { SCRIPTAPI_PRECHECKHEADER const NodeDefManager *ndef = getClient()->ndef(); // Get core.registered_on_punchgnode lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_punchnode"); // Push data push_v3s16(L, p); pushnode(L, node, ndef); // Call functions runCallbacks(2, RUN_CALLBACKS_MODE_OR); return readParam<bool>(L, -1); } bool ScriptApiClient::on_placenode(const PointedThing &pointed, const ItemDefinition &item) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_placenode lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_placenode"); // Push data push_pointed_thing(L, pointed, true); push_item_definition(L, item); // Call functions runCallbacks(2, RUN_CALLBACKS_MODE_OR); return readParam<bool>(L, -1); } bool ScriptApiClient::on_item_use(const ItemStack &item, const PointedThing &pointed) { SCRIPTAPI_PRECHECKHEADER // Get core.registered_on_item_use lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_item_use"); // Push data LuaItemStack::create(L, item); push_pointed_thing(L, pointed, true); // Call functions runCallbacks(2, RUN_CALLBACKS_MODE_OR); return readParam<bool>(L, -1); } bool ScriptApiClient::on_inventory_open(Inventory *inventory) { SCRIPTAPI_PRECHECKHEADER lua_getglobal(L, "core"); lua_getfield(L, -1, "registered_on_inventory_open"); std::vector<const InventoryList*> lists = inventory->getLists(); std::vector<const InventoryList*>::iterator iter = lists.begin(); lua_createtable(L, 0, lists.size()); for (; iter != lists.end(); iter++) { const char* name = (*iter)->getName().c_str(); lua_pushstring(L, name); push_inventory_list(L, inventory, name); lua_rawset(L, -3); } runCallbacks(1, RUN_CALLBACKS_MODE_OR); return readParam<bool>(L, -1); } void ScriptApiClient::setEnv(ClientEnvironment *env) { ScriptApiBase::setEnv(env); }