From db503ec162b1025043c2e63c82e4f7e0cc32df57 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 29 Nov 2024 12:56:27 +0300 Subject: [PATCH 1/7] fix 3d-text docs --- doc/en/3d-text.md | 16 ++++++++-------- doc/ru/3d-text.md | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/en/3d-text.md b/doc/en/3d-text.md index 3f3dc7f1..6e957a37 100644 --- a/doc/en/3d-text.md +++ b/doc/en/3d-text.md @@ -4,14 +4,14 @@ The appearance of 3D text, is configured via a table, like [particles](particles.md). All fields are optional. -| Field | Description | Default | -| -------------- | ---------------------------- | ---------------- | -| display | Display format | static_billboard | -| color | Text color | {1, 1, 1, 1} | -| scale | Text scale | 1 | -| renderDistance | Text rendering distance | 32 | -| xray_opacity | Visibility through obstacles | 0 | -| perspective | Perspective coefficient | 1 | +| Field | Description | Default | +| --------------- | ---------------------------- | ---------------- | +| display | Display format | static_billboard | +| color | Text color | {1, 1, 1, 1} | +| scale | Text scale | 1 | +| render_distance | Text rendering distance | 32 | +| xray_opacity | Visibility through obstacles | 0 | +| perspective | Perspective coefficient | 1 | Available display formats: diff --git a/doc/ru/3d-text.md b/doc/ru/3d-text.md index ac6affd3..a53075ca 100644 --- a/doc/ru/3d-text.md +++ b/doc/ru/3d-text.md @@ -9,7 +9,7 @@ | display | Формат отображения | static_billboard | | color | Цвет текста | {1, 1, 1, 1} | | scale | Масштаб | 1 | -| renderDistance | Дистанция отрисовки текста | 32 | +| render_distance | Дистанция отрисовки текста | 32 | | xray_opacity | Коэффициент видимости через препятствия (просвечивание) | 0 | | perspective | Коэффициент перспективы | 1 | From 4c8f3c7baed9e6a9da0f8aa3ef25b5a755fac29e Mon Sep 17 00:00:00 2001 From: DomaJa <149813486+DSDemen@users.noreply.github.com> Date: Fri, 29 Nov 2024 12:39:55 +0200 Subject: [PATCH 2/7] Finnish base lang update --- res/content/base/texts/fi_FI.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/res/content/base/texts/fi_FI.txt b/res/content/base/texts/fi_FI.txt index cea864b6..97c4f83d 100644 --- a/res/content/base/texts/fi_FI.txt +++ b/res/content/base/texts/fi_FI.txt @@ -23,3 +23,4 @@ wood=puu torch=taskulamppu bazalt breaker=basaltti rikkooja wooden door=puu ovi +ice=jää From fdee9d5c1a1122734f50c335dfd5126eab929397 Mon Sep 17 00:00:00 2001 From: DomaJa <149813486+DSDemen@users.noreply.github.com> Date: Fri, 29 Nov 2024 13:05:47 +0200 Subject: [PATCH 3/7] Finnish Lang Update 2 --- res/texts/fi_FI.txt | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/res/texts/fi_FI.txt b/res/texts/fi_FI.txt index 40c5dadc..dab72a92 100644 --- a/res/texts/fi_FI.txt +++ b/res/texts/fi_FI.txt @@ -7,11 +7,28 @@ Back=Takaisin Continue=Jatka Add=lisätä Converting world...=Maailman muuttuminen on käynnissä... +Version=Versio +Creator=Tekijä +Dependencies=Riippuvuudet +Description=Kuvaus +Unlimited=Rajaton +Chat=Keskustelu +Console=Konsoli +Log=Loki +Problems=Ongelmia +Monitor=Valvonta +Debug=Virheenkorjaus +File=Tiedosto +devtools.traceback=Puhelupino (viimeisestä) error.pack-not-found=Pakettia ei löytynyt! error.dependency-not-found=Käytetty riippuvuutta ei löytynyt pack.remove-confirm=Poistetaanko kaikki pakettien sisältö maailmasta (peruuttamattomasti)? +# Подсказки +graphics.gamma.tooltip=Valon kirkkauskäyrä +graphics.backlight.tooltip=Taustavalo estää täydellisen pimeyden + # Меню menu.Apply=Tallenna menu.Audio=Ääni @@ -20,6 +37,7 @@ menu.Content Error=Virhe Sisällössä menu.Content=Sisältö menu.Continue=Jatka menu.Controls=Ohjaus +menu.Display=Näyttö menu.Graphics=Grafiikka menu.missing-content=Sisältö Puuttuu! menu.New World=Uusi Maailma @@ -29,6 +47,10 @@ menu.Page not found=Sivu ei löytynyt! menu.Quit=Poistu menu.Save and Quit to Menu=Tallenna ja Takaisin Valikkoon menu.Settings=Asetukset +menu.Reset settings=Palauta asetukset +menu.Contents Menu=Sisältöpaketin valikko +menu.Open data folder=Avaa data-kansio +menu.Open content folder=Avaa kansio [content] world.Seed=Siemen world.Name=Nimi @@ -38,14 +60,20 @@ world.generators.flat=Tasainen world.Create World=Luo Maailma world.convert-request=Indekseissä on muutoksia! Kääntää maailman? world.delete-confirm=Poistetaanko maailma pysyvästi? +world.upgrade-request=Maailman muoto on vanhentunut! Kääntää maailman? +world.convert-with-loss=Muuntaa maailman tappioilla? +world.convert-block-layouts=Estokentissä on muutoksia! Kääntää maailman? # Настройки settings.Ambient=Tausta settings.Backlight=Taustavalo settings.Camera Shaking=Tärisevä kamera +settings.Camera Inertia=Kameran inertia +settings.Camera FOV Effects=Näkökentän tehosteet settings.Fog Curve=Sumukäurä settings.FOV=Näkokenttä settings.Fullscreen=Koko näyttö +settings.Framerate=Kuvataajuus settings.Gamma=Gamma settings.Language=Kieli settings.Load Distance=Latausetäisyys @@ -56,8 +84,12 @@ settings.Music=Musiikki settings.Regular Sounds=Tavalliset Äänet settings.UI Sounds=Käyttöliittymän äänet settings.V-Sync=Pystytahdistus +settings.Key=Painike +settings.Controls Search Mode=Hae sidotun ohjauspainikkeen perusteella +settings.Limit Background FPS=Rajoita taustakuvanopeutta # Управление +chunks.reload=Lataa kimpale uudelleen devtools.console=Konsoli movement.forward=Eteenpäin movement.back=Taaksepäin @@ -69,8 +101,11 @@ movement.crouch=Hiipiä movement.cheat=Huijata hud.inventory=Varasto player.pick=Valitse lohko -player.attack=Lyödä / Rikkoa +player.attack=Lyödä +player.destroy=Rikkoa player.build=Aseta lohko +player.fast_interaction=Nopeutettu vuorovaikutus player.flight=Lento +player.drop=Heitä kappale camera.zoom=Lähentäminen camera.mode=Vaihda kameratilaa From 16a6da3753bc872fb5a1f6d68596cf92d53b58bd Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 29 Nov 2024 17:55:31 +0300 Subject: [PATCH 4/7] prevent 'core:empty' item drop --- res/content/base/modules/util.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/res/content/base/modules/util.lua b/res/content/base/modules/util.lua index a4519b53..11e3717b 100644 --- a/res/content/base/modules/util.lua +++ b/res/content/base/modules/util.lua @@ -1,6 +1,9 @@ local base_entities = {} function base_entities.drop(ppos, itemid, count, pickup_delay) + if itemid == 0 or not itemid then + return nil + end return entities.spawn("base:drop", ppos, {base__drop={ id=itemid, count=count, From b69494aea3094bdfdef044c2152a4aae3b834a18 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 29 Nov 2024 17:57:18 +0300 Subject: [PATCH 5/7] rename --- res/content/base/modules/util.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/res/content/base/modules/util.lua b/res/content/base/modules/util.lua index 11e3717b..2112c210 100644 --- a/res/content/base/modules/util.lua +++ b/res/content/base/modules/util.lua @@ -1,6 +1,6 @@ -local base_entities = {} +local util = {} -function base_entities.drop(ppos, itemid, count, pickup_delay) +function util.drop(ppos, itemid, count, pickup_delay) if itemid == 0 or not itemid then return nil end @@ -11,4 +11,4 @@ function base_entities.drop(ppos, itemid, count, pickup_delay) }}) end -return base_entities +return util From 05003a408299c9f74ab21c9f20e9ba239b68ae27 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 29 Nov 2024 20:32:18 +0300 Subject: [PATCH 6/7] fix fatal error on uncaught lua exceptions in network functions calls --- src/logic/scripting/lua/libs/libnetwork.cpp | 8 ++++---- src/logic/scripting/lua/lua_util.cpp | 17 +++++++++++++++++ src/logic/scripting/lua/lua_util.hpp | 1 + 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/logic/scripting/lua/libs/libnetwork.cpp b/src/logic/scripting/lua/libs/libnetwork.cpp index a2d48b5b..7f503c23 100644 --- a/src/logic/scripting/lua/libs/libnetwork.cpp +++ b/src/logic/scripting/lua/libs/libnetwork.cpp @@ -9,7 +9,7 @@ static int l_get(lua::State* L) { std::string url(lua::require_lstring(L, 1)); lua::pushvalue(L, 2); - auto onResponse = lua::create_lambda(L); + auto onResponse = lua::create_lambda_nothrow(L); engine->getNetwork().get(url, [onResponse](std::vector bytes) { engine->postRunnable([=]() { @@ -23,7 +23,7 @@ static int l_get_binary(lua::State* L) { std::string url(lua::require_lstring(L, 1)); lua::pushvalue(L, 2); - auto onResponse = lua::create_lambda(L); + auto onResponse = lua::create_lambda_nothrow(L); engine->getNetwork().get(url, [onResponse](std::vector bytes) { auto buffer = std::make_shared>( @@ -40,7 +40,7 @@ static int l_connect(lua::State* L) { std::string address = lua::require_string(L, 1); int port = lua::tointeger(L, 2); lua::pushvalue(L, 3); - auto callback = lua::create_lambda(L); + auto callback = lua::create_lambda_nothrow(L); u64id_t id = engine->getNetwork().connect(address, port, [callback](u64id_t id) { engine->postRunnable([=]() { callback({id}); @@ -122,7 +122,7 @@ static int l_recv(lua::State* L) { static int l_open(lua::State* L) { int port = lua::tointeger(L, 1); lua::pushvalue(L, 2); - auto callback = lua::create_lambda(L); + auto callback = lua::create_lambda_nothrow(L); u64id_t id = engine->getNetwork().openServer(port, [callback](u64id_t id) { engine->postRunnable([=]() { callback({id}); diff --git a/src/logic/scripting/lua/lua_util.cpp b/src/logic/scripting/lua/lua_util.cpp index 86419906..8c83dc50 100644 --- a/src/logic/scripting/lua/lua_util.cpp +++ b/src/logic/scripting/lua/lua_util.cpp @@ -263,6 +263,23 @@ scripting::common_func lua::create_lambda(State* L) { }; } +scripting::common_func lua::create_lambda_nothrow(State* L) { + auto funcptr = create_lambda_handler(L); + return [=](const std::vector& args) -> dv::value { + getglobal(L, LAMBDAS_TABLE); + getfield(L, *funcptr); + for (const auto& arg : args) { + pushvalue(L, arg); + } + if (call_nothrow(L, args.size(), 1)) { + auto result = tovalue(L, -1); + pop(L); + return result; + } + return nullptr; + }; +} + int lua::create_environment(State* L, int parent) { int id = nextEnvironment++; diff --git a/src/logic/scripting/lua/lua_util.hpp b/src/logic/scripting/lua/lua_util.hpp index 70dd7705..983abb39 100644 --- a/src/logic/scripting/lua/lua_util.hpp +++ b/src/logic/scripting/lua/lua_util.hpp @@ -574,6 +574,7 @@ namespace lua { runnable create_runnable(lua::State*); scripting::common_func create_lambda(lua::State*); + scripting::common_func create_lambda_nothrow(lua::State*); inline int pushenv(lua::State* L, int env) { if (getglobal(L, env_name(env))) { From c9040df0903342a4a964637bf7ae45e6be83c170 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Fri, 29 Nov 2024 20:44:16 +0300 Subject: [PATCH 7/7] fix it temporary and think deeper after 0.25 release --- src/logic/scripting/lua/lua_util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/logic/scripting/lua/lua_util.cpp b/src/logic/scripting/lua/lua_util.cpp index 8c83dc50..091418cd 100644 --- a/src/logic/scripting/lua/lua_util.cpp +++ b/src/logic/scripting/lua/lua_util.cpp @@ -175,7 +175,7 @@ int lua::call_nothrow(State* L, int argc, int nresults) { int handler_pos = gettop(L) - argc; pushcfunction(L, l_error_handler); insert(L, handler_pos); - if (lua_pcall(L, argc, LUA_MULTRET, handler_pos)) { + if (lua_pcall(L, argc, -1, handler_pos)) { auto errorstr = tostring(L, -1); if (errorstr) { log_error(errorstr); @@ -187,7 +187,7 @@ int lua::call_nothrow(State* L, int argc, int nresults) { return 0; } remove(L, handler_pos); - return nresults == -1 ? 1 : nresults; + return 1; } void lua::dump_stack(State* L) {