Compare commits

..

1172 Commits

Author SHA1 Message Date
Gregor Parzefall
d445638265 Bump version to 5.8.1 2024-05-06 20:58:14 +02:00
Gregor Parzefall
f61f6626b7 Fix Android build for 5.8.1 2024-05-06 20:58:14 +02:00
Gregor Parzefall
857ba25115 Android CI: Additionally make an AAB for uploading to the Play Store (#14584) 2024-05-06 20:58:14 +02:00
grorp
00774bc28b Fix some Game members not being freed after some startup errors (#14561) 2024-05-06 20:58:14 +02:00
Gregor Parzefall
f572266f19 Fix local server startup and shutdown blocking the main thread
Co-authored-by: sfan5 <sfan5@live.de>
2024-05-06 20:58:14 +02:00
Gregor Parzefall
c3893064a3 Fix all cached media being loaded at once on the main thread 2024-05-06 20:58:14 +02:00
grorp
4183443f02 Allow sync HTTP fetches to be interrupted to fix hanging (#14412)
Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
2024-05-06 20:58:14 +02:00
sfan5
5715434d5e Skip Android deps download if they already exist
It's close to impossible to test locally built changes otherwise.
2024-05-06 20:58:14 +02:00
lhofhansl
ab2419db24 Allow shaders with disabled post processing pipeline (#14338)
- Allow disabling of the post processing pipeline while leaving shaders enabled
- Also disable post processing on Android by default
2024-05-06 20:58:14 +02:00
David Heidelberg
35a83c3514 Enable IPO/LTO by default except for debug builds (#14198)
Test case:

```
$ cmake . -DRUN_IN_PLACE=TRUE -DCMAKE_BUILD_TYPE=Release -DBUILD_SERVER=TRUE -DENABLE_TOUCH=FALSE

         minetest minetestserver
W/o LTO:      13M           7.3M
W/  LTO:      11M           5.9M
difference:   15%            19%
```

Also fixes various compiler warnings resulting from compilation using LTO.

---------

Signed-off-by: David Heidelberg <david@ixit.cz>
2024-05-06 20:58:14 +02:00
sfan5
de09cac1e9 Drop valgrind from CI and instead enable ASan
The recently added ioctl use is reported as a false-positive by valgrind.
I tried moving it to different compilers/versions two times and only
hit further issues that were valgrind's fault.

Also includes a tiny fix.
2024-05-06 20:58:14 +02:00
sfan5
b64f4bdb3a Optimize fs::CopyFileContents on Linux and Windows 2024-05-06 20:58:14 +02:00
sfan5
008310aad9 Add unit tests for fs::CopyFileContents 2024-05-06 20:58:14 +02:00
sfan5
4d024d737c Bypass media transfer in single player 2024-05-06 20:58:14 +02:00
grorp
50edb30a18 Save the settings in more cases to avoid losing setting changes (especially on Android) (#14266) 2024-05-06 20:58:14 +02:00
Muhammad Rifqi Priyo Susanto
00f6bd0f08 Android: Use the correct value for notification (#14209)
The notification channel creation is moved into MainActivity.
The notification channel ID string is stored into a static variable.
The name and description of the notification channel are stored into the strings resource file.

Co-authored-by: sfan5 <sfan5@live.de>
2024-05-06 20:58:14 +02:00
Maintainer_
81e40a1172 Fix GameUI text staying visible during shutdown. (#14197) 2024-05-06 20:58:14 +02:00
grorp
fe4f89f3fa Touchscreen: Make server-sent overrides of button textures work (#14145) 2024-05-06 20:58:14 +02:00
Gregor Parzefall
0d372250c1 Fix TouchScreenGUI ignoring server-sent pitch changes 2024-05-06 20:58:14 +02:00
Gregor Parzefall
367720020c Fix touch input on Linux
The code relied on touch IDs being consecutive. This is true on Android, but not on Linux.
Therefore, touch input on Linux was broken since 53886dcdb5.
2024-05-06 20:58:14 +02:00
grorp
0dab82085d Fix unittest failure for release versions (#14067) 2024-05-06 20:58:14 +02:00
SmallJoker
cb211d63cd Merge remote-tracking branch 'upstream/stable-5' into HEAD 2023-12-04 19:04:18 +01:00
rubenwardy
49ce5a2de6 Bump version to 5.8.0 2023-12-04 17:15:36 +00:00
updatepo.sh
30769589bf Remove junk translation file 2023-12-03 19:11:32 +01:00
updatepo.sh
6cf9b7472a Run mod_translation_updater.py 2023-12-03 19:03:45 +01:00
updatepo.sh
4be8b77598 Run updatepo.sh 2023-12-03 18:48:54 +01:00
updatepo.sh
bae9f65411 Update from builtin/settingtypes.txt 2023-12-03 18:47:50 +01:00
Krock
0a20d30f83 Various little translation fixups 2023-12-03 18:41:15 +01:00
Nisa Syazwani
7245bcc614 Translated using Weblate (Malay)
Currently translated at 100.0% (1310 of 1310 strings)
2023-12-03 18:41:15 +01:00
chocomint
51136780d6 Translated using Weblate (Spanish)
Currently translated at 89.6% (1174 of 1310 strings)
2023-12-03 18:41:15 +01:00
gallegonovato
ea6eb0dfc8 Translated using Weblate (Spanish)
Currently translated at 89.6% (1174 of 1310 strings)
2023-12-03 18:41:15 +01:00
nyommer
ab88fc6835 Translated using Weblate (Hungarian)
Currently translated at 96.7% (1268 of 1310 strings)
2023-12-03 18:41:15 +01:00
AlexTECPlayz
30b28280eb Translated using Weblate (Romanian)
Currently translated at 49.3% (647 of 1310 strings)
2023-12-03 18:41:15 +01:00
BreadW
e5672111d2 Translated using Weblate (Japanese)
Currently translated at 100.0% (1310 of 1310 strings)
2023-12-03 18:41:15 +01:00
Spurnita
ce0aca49c2 Translated using Weblate (Catalan)
Currently translated at 22.5% (296 of 1310 strings)
2023-12-03 18:41:15 +01:00
Muhammad Rifqi Priyo Susanto
0d3b71564f Translated using Weblate (Javanese)
Currently translated at 12.9% (170 of 1310 strings)
2023-12-03 18:41:15 +01:00
Ritwik
0a51fde971 Translated using Weblate (Hindi)
Currently translated at 29.8% (391 of 1310 strings)
2023-12-03 18:41:15 +01:00
milewood
a13a165e9b Translated using Weblate (Chinese (Simplified))
Currently translated at 84.0% (1101 of 1310 strings)
2023-12-03 18:41:15 +01:00
Wuzzy
8a7d3d07de Translated using Weblate (German)
Currently translated at 100.0% (1310 of 1310 strings)
2023-12-03 18:41:15 +01:00
Giov4
0977728ea0 Translated using Weblate (Italian)
Currently translated at 93.7% (1228 of 1310 strings)
2023-12-03 18:41:15 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
92eb63c867 Translated using Weblate (Malay + Jawi) 2023-12-03 18:41:07 +01:00
YearOfFuture
0c4a15fa16 Translated using Weblate (Ukrainian)
Currently translated at 75.4% (989 of 1310 strings)
2023-12-03 18:39:34 +01:00
Nanashi Mumei
01ac9e15ef Translated using Weblate (Russian)
Currently translated at 100.0% (1310 of 1310 strings)
2023-12-03 18:39:34 +01:00
Muhammad Rifqi Priyo Susanto
dd3fc83777 Translated using Weblate (Indonesian)
Currently translated at 100.0% (1310 of 1310 strings)
2023-12-03 18:39:34 +01:00
waxtatect
6a5e480a58 Translated using Weblate (French)
Currently translated at 100.0% (1310 of 1310 strings)
2023-12-03 18:39:34 +01:00
Lars Müller
419d971891 Translated using Weblate (German)
Currently translated at 99.0% (1297 of 1310 strings)
2023-12-03 18:17:42 +01:00
sfan5
9e62cb5c04 Translated using Weblate (German)
Currently translated at 99.0% (1297 of 1310 strings)
2023-12-03 18:17:42 +01:00
Desour
bf53e7e1ca Fix anticheat false positives whith speed physics override 2023-12-03 12:23:17 +01:00
AFCMS
91134015e7 Document minetest.get_gametime() returning nil at init time (#14047)
Co-authored-by: sfan5 <sfan5@live.de>
2023-12-03 15:00:29 +07:00
Muhammad Rifqi Priyo Susanto
047520d91e Inventory: Add remaining items into the source slot directly (#14021)
Remaining items are added into the source slot directly when left-dragging over the source slot.
2023-12-03 15:00:07 +07:00
DS
6106e4e72b Fix sound and particlespawner id generation (#14059)
* Fix server sound ids being reused to early

* Fix particlespawner id generation

It always returned 0.
Also, now the ids always grow, to make a conflict with ids in lua unlikely.
2023-12-01 00:09:53 +01:00
SmallJoker
a7e5456099 Server: avoid re-use of recent ParticleSpawner and Sound IDs (#14045)
This improves the reliability when removing and re-adding handles quickly.
Looping through the entire ID range avoids collisions caused by any race condition.
2023-11-29 21:10:19 +01:00
sfan5
d6a8b546e4 Enable clean transparent filter in more cases
It was determined that this fixes scaling artifacts that can happen with bilinear,
trilinear or anisotropic filtering alone.
Since the previous commit did not bring back the relevant setting, we fix this
shortcoming by just enabling it in all cases where it is known to help.
2023-11-29 21:09:21 +01:00
sfan5
7f9326805c Return texture filter settings to previous state
This partially reverts commit 72ef90885d.

fixes #14007
2023-11-29 21:09:21 +01:00
sfan5
36f4953502 Update credits for 5.8.0 release (#14017) 2023-11-28 23:11:29 +01:00
grorp
dc6452db1b Don't copy user texture packs into Android bundle (#14053) 2023-11-28 21:02:56 +01:00
grorp
cfe1953c2d Take aliases into account for automatic package installation (#14052) 2023-11-28 21:02:41 +01:00
Wuzzy
dfe00f88e1 Fix missing word in German builtin translation (#14051) 2023-11-28 21:02:19 +01:00
Muhammad Rifqi Priyo Susanto
53886dcdb5 Formspec: Pass the second-touch event as is (#13872)
The second-touch event is passed to the GUIFormSpecMenu::OnEvent() function as a touch event.
There are two types of event for inventory formspec: (1) mouse event and (2) touch event.
The touch event is just a modifier of the mouse event.


Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>
2023-11-28 07:00:07 +07:00
grorp
771da80bbb Make it possible again to see item tooltips on Android (#14029)
This change is a quick fix so that item tooltips show again on Android.
2023-11-25 17:07:07 +01:00
Zughy
0f3ac7c956 Update Italian builtin translation (#13997) 2023-11-25 17:05:07 +01:00
Muhammad Rifqi Priyo Susanto
71490a417e Update Indonesian translation of builtin (#13996)
U+0020 (Space) is changed to U+00A0 (No-Break Space) to match the original string.
2023-11-25 17:04:44 +01:00
grorp
4255ac3022 Mainmenu: Avoid the header being displayed behind the formspec (#13924)
This change keeps the current header placement code, but adds additional code to make sure the header doesn't end up behind the formspec.
2023-11-25 17:04:33 +01:00
ZenonSeth
6783734612 Wireshark dissector: Made sure var 'pos' was only assigned locally to function (#14027) 2023-11-23 18:26:00 +01:00
Wuzzy
61db32beee Fix mod translation updater bugs (#13974) 2023-11-19 20:46:52 +01:00
MisterE123
31ee7af3ab lua_api.md: Add tick marks to position HUD element 2023-11-19 20:46:40 +01:00
jordan4ibanez
72edfe3d04 Fix openSUSE build dependencies
They were incomplete.
2023-11-19 20:46:03 +01:00
Desour
7199ee4ff8 Devtest: Fix testnodes bouncy color calculation
Values were out of range.
2023-11-19 20:45:18 +01:00
Desour
585e6aa80b Clamp values in read_ARGB8 2023-11-19 20:45:18 +01:00
Desour
1bc74b0ba1 Fix undefined inf to s32 cast in GUIScrollBar::setPos 2023-11-19 20:45:18 +01:00
Desour
73e85b2ebb Fix cached wanted_range and camera_fov being written with out-of-range value 2023-11-19 20:45:18 +01:00
sfan5
0e4de28988 Try to fix VS build failures 2023-11-19 16:22:20 +01:00
Muhammad Rifqi Priyo Susanto
aa912e90a7 Make text containers wider in the Volume Change dialog (#13995)
These containers are widened to account for translations.
2023-11-15 07:00:03 +07:00
DS
8cf76e004f Add new flags to minetest.features for 5.8.0 features (#13978) 2023-11-12 20:08:57 +01:00
superfloh247
7cb20dd6c2 Fix undefined behaviour in modulo360f (#13976)
Resolves a crash on macOS/arm64 by no longer depending on UB.
2023-11-12 20:08:33 +01:00
updatepo.sh
2bc0d76f63 Update translation files 2023-11-11 12:11:09 +01:00
updatepo.sh
8abb5796ed Update example conf and settings translations 2023-11-11 12:09:35 +01:00
YearOfFuture
7a658c1a6a Translated using Weblate (Ukrainian)
Currently translated at 76.3% (1023 of 1340 strings)
2023-11-11 12:06:10 +01:00
Maksim Gamarnik
1b0a34b9d1 Translated using Weblate (Ukrainian)
Currently translated at 72.4% (971 of 1340 strings)
2023-11-11 12:06:10 +01:00
YearOfFuture
8b5fc7f23a Translated using Weblate (Ukrainian)
Currently translated at 72.4% (971 of 1340 strings)
2023-11-11 12:06:10 +01:00
Maksim Gamarnik
ee35d7df58 Translated using Weblate (Ukrainian)
Currently translated at 69.8% (936 of 1340 strings)
2023-11-11 12:06:10 +01:00
dandelionsmellr
8d1f1b4704 Translated using Weblate (Ukrainian)
Currently translated at 67.3% (902 of 1340 strings)
2023-11-11 12:06:10 +01:00
Maksim Gamarnik
50f48ce9df Translated using Weblate (Ukrainian)
Currently translated at 67.2% (901 of 1340 strings)
2023-11-11 12:06:10 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
e14f905299 Translated using Weblate (Malay (Jawi))
Currently translated at 53.9% (723 of 1340 strings)
2023-11-11 12:06:10 +01:00
Nanashi Mumei
6980f516d4 Translated using Weblate (Russian)
Currently translated at 100.0% (1340 of 1340 strings)
2023-11-11 12:06:10 +01:00
dandelionsmellr
52e66b6dfe Translated using Weblate (Ukrainian)
Currently translated at 59.8% (802 of 1340 strings)
2023-11-11 12:06:10 +01:00
Maksim Gamarnik
645e4abf52 Translated using Weblate (Ukrainian)
Currently translated at 59.8% (802 of 1340 strings)
2023-11-11 12:06:10 +01:00
dandelionsmellr
b0932ef458 Translated using Weblate (Ukrainian)
Currently translated at 59.8% (802 of 1340 strings)
2023-11-11 12:06:10 +01:00
Muhammad Rifqi Priyo Susanto
330aee974e Translated using Weblate (Javanese)
Currently translated at 0.0% (0 of 1340 strings)
2023-11-11 12:06:10 +01:00
Timur Seber
a1d7c25587 Translated using Weblate (Tatar)
Currently translated at 7.6% (103 of 1340 strings)
2023-11-11 12:06:10 +01:00
109247019824
6c4352eaf9 Translated using Weblate (Bulgarian)
Currently translated at 32.5% (436 of 1340 strings)
2023-11-11 12:06:10 +01:00
Spurnita
2f279d2403 Translated using Weblate (Catalan)
Currently translated at 18.6% (250 of 1340 strings)
2023-11-11 12:06:10 +01:00
chocomint
842b2bbd36 Translated using Weblate (Spanish)
Currently translated at 90.8% (1218 of 1340 strings)
2023-11-11 12:06:10 +01:00
BreadW
d056bb3ee7 Translated using Weblate (Japanese)
Currently translated at 94.4% (1265 of 1340 strings)
2023-11-11 12:06:10 +01:00
waxtatect
adf9a3953b Translated using Weblate (French)
Currently translated at 100.0% (1340 of 1340 strings)
2023-11-11 12:06:10 +01:00
Ярослав Рукавицын
c7dd8c18ed Translated using Weblate (Russian)
Currently translated at 94.1% (1262 of 1340 strings)
2023-11-11 12:06:10 +01:00
Lemente
d8c8bf1897 Translated using Weblate (French)
Currently translated at 96.9% (1299 of 1340 strings)
2023-11-11 12:06:10 +01:00
waxtatect
b0c92e885e Translated using Weblate (French)
Currently translated at 96.9% (1299 of 1340 strings)
2023-11-11 12:06:10 +01:00
ROllerozxa
80ae408eb9 Translated using Weblate (Swedish)
Currently translated at 65.5% (879 of 1340 strings)
2023-11-11 12:06:10 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
9720eb50b3 Translated using Weblate (Malay)
Currently translated at 100.0% (1340 of 1340 strings)
2023-11-11 12:06:10 +01:00
Bas Huis
1efa3a165e Translated using Weblate (Dutch)
Currently translated at 83.9% (1125 of 1340 strings)
2023-11-11 12:06:10 +01:00
ROllerozxa
b730c0aa9a Translated using Weblate (Norwegian Bokmål)
Currently translated at 52.4% (703 of 1340 strings)
2023-11-11 12:06:10 +01:00
Muhammad Rifqi Priyo Susanto
bc26bdc2bf Translated using Weblate (Indonesian)
Currently translated at 100.0% (1340 of 1340 strings)
2023-11-11 12:06:09 +01:00
Translator
3187aca3c9 Translated using Weblate (French)
Currently translated at 94.4% (1265 of 1340 strings)
2023-11-11 12:06:09 +01:00
Janar Leas
c4b7876a1a Translated using Weblate (Estonian)
Currently translated at 44.7% (600 of 1340 strings)
2023-11-11 12:06:09 +01:00
Wuzzy
904dbe730d Translated using Weblate (German)
Currently translated at 100.0% (1340 of 1340 strings)
2023-11-11 12:06:09 +01:00
Gregor Parzefall
8bf2031310 Get rid of hidden settings in settings_translation_file.cpp 2023-11-11 11:59:38 +01:00
Wuzzy
af474d10a4 Fix bad translation function names in builtin (#13977) 2023-11-10 07:00:17 +07:00
MisterE123
fe8d04d0b3 Fix misrendered fall_damage_add_percent calculation formula (#13969)
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2023-11-09 19:55:26 +01:00
Gregor Parzefall
394450758e Fix auto_install_spec being used as a table (#13970)
(It's a string since #13906.)
2023-11-09 19:54:47 +01:00
JosiahWI
56902745c8 Extract updateClouds method from updateFrame (#13939)
Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>
2023-11-08 07:00:59 +07:00
corpserot
9e952603b2 Lump MT_LOGCOLOR env together with other color env (#13887) 2023-11-08 07:00:36 +07:00
Thresher
80c4c260ae Refactor and move world_format.txt to world_format.md (#13504)
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
2023-11-08 07:00:04 +07:00
ROllerozxa
570fc90bf6 Debundle Minetest Game (#13818) 2023-11-07 22:18:26 +01:00
Muhammad Rifqi Priyo Susanto
7213ff7a00 Resolves some warnings for Android version (#13862) 2023-11-05 19:02:01 +01:00
Gregor Parzefall
adec16790b Offer ContentDB updates for leftover bundled Minetest Game (#13906) 2023-11-05 19:01:19 +01:00
Zughy
726326924d Clarify get_translated_string string argument (#13948)
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2023-11-05 19:00:32 +01:00
Muhammad Rifqi Priyo Susanto
4d2227cfa5 Rename mtt_update to mod_translation_updater (#13952)
Clarifies the purpose of the translation update script by giving it a more explanatory name.
2023-11-05 09:11:30 +01:00
Nils Dagsson Moskopp
2025dcffbd Revert "Don't trigger a key event if a key with the same associated char was pressed (#13773)"
This partially reverts commit d57c936b08.

The reverted commit prevented recognition of key combinations.
It correctly changed a test case to no longer use “KEY_NUMPAD_5”.

Several keyboard layouts use a key combination to input a “+” (e.g. Neo2);
therefore some users could no longer input “+” to increase the view range.

Co-authored-by: savilli <78875209+savilli@users.noreply.github.com>
2023-10-30 21:23:59 +01:00
Desour
ec7a1f02e7 Fix out-of-bounds access in NodeDefManager::nodeboxConnects 2023-10-30 21:23:47 +01:00
Desour
1d31533601 Reformat rot array in NodeDefManager::nodeboxConnects, to make it less magic 2023-10-30 21:23:47 +01:00
Desour
64104585c5 Devtest: Add more connected nodebox test nodes 2023-10-30 21:23:47 +01:00
Gregor Parzefall
96197025b9 Fix hypertext[] sometimes calculating incorrect scrollbar height (#13943) 2023-10-29 17:54:31 +01:00
Muhammad Rifqi Priyo Susanto
1363059416 Fix issues in Minetest's English texts (#13913)
Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
Co-authored-by: Desour <ds.desour@proton.me>
Co-authored-by: sfan5 <sfan5@live.de>
2023-10-29 12:24:39 +01:00
Desour
b3988d964a Sounds: Do not fade paused sounds 2023-10-29 00:40:07 +02:00
Desour
2ad17136dc Sounds: Fix dtime being in milliseconds 2023-10-29 00:40:07 +02:00
Desour
b2aa5d9261 Sounds: Don't pause new sounds when paused 2023-10-29 00:39:38 +02:00
rubenwardy
4ee32c5441 Add package update detection on Content tab (#13807) 2023-10-28 17:33:44 +01:00
sfan5
ddce858c34 Speed up macOS CI
- skip nonsense during package installation
- use actual number of available cores
2023-10-27 20:22:40 +02:00
sfan5
00be802c5c Use macos-latest for CI
Old versions lose support relatively quickly and then silently degrade
to e.g. compiling all dependencies from source which takes a long time.
2023-10-27 20:22:40 +02:00
sfan5
8d2e1289a4 Use newer IrrlichtMt 2023-10-27 19:00:04 +02:00
Desour
454eb3901d Inventory: Fix deleted inventory being used for regaining locked lists 2023-10-27 18:47:07 +02:00
Desour
a464b41d99 Inventory: Release resizes-locked lists on all on_-callbacks 2023-10-27 18:47:07 +02:00
ROllerozxa
1a562ca144 Prevent Windows Defender warnings in singleplayer (Bind singleplayer server to 127.0.0.1) 2023-10-27 12:03:43 +02:00
sfan5
03ba9370b9 Deprecate .bmp format 2023-10-27 11:05:27 +02:00
Nils Dagsson Moskopp
2f16227302 Set color of scrollbar/dropdown button symbols and checkmarks to white
Before this patch, the symbols were rendered black on dark background.

Previous images were edited like this:

1. The colors were inverted with GIMP's “linear inversion” method.
2. Image files were optimized using “optipng -o7 -zm1-9 -strip all”.

Co-authored-by: ROllerozxa <rollerozxa@voxelmanip.se>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2023-10-27 11:05:00 +02:00
sfan5
15c3fb7b7a Amend list of planned breakages 2023-10-24 18:17:18 +02:00
Gregor Parzefall
2ce14ce4eb Use hypertext[] for credits so that long lines are wrapped (#13914) 2023-10-22 15:32:14 +02:00
SmallJoker
906417cc0d GUI: Autofocus newly opened GUIModalMenu instances (#13911)
This in particular fixes incorrect event propagation to menus that
are no longer shown, such as the key change menu when opened within
the settings tab.
2023-10-22 15:31:42 +02:00
SmallJoker
2fbf5f4250 CSM: Fix duplicate player names (#13910) 2023-10-22 15:31:29 +02:00
Alexander Chibrikin
3491509b21 Add Russian translation of builtin (#13896)
Co-authored-by: Zemtzov7 <72821250+zmv7@users.noreply.github.com>
2023-10-22 15:31:11 +02:00
DS
7e8831a414 Inventory: Don't throw resize lock exception in destructor (#13894)
... of nodemeta inventories.
2023-10-22 15:30:11 +02:00
Cora de la Mouche
341e53f2e2 Remove deprecation mark on TGA texture format (#13877) 2023-10-22 15:29:28 +02:00
Muhammad Rifqi Priyo Susanto
c9655e54ce Change some keys to be triggered once every key press (#13883)
Those keys are below:
- KeyType::CAMERA_MODE
- KeyType::SCREENSHOT
- KeyType::TOGGLE_BLOCK_BOUNDS
- KeyType::TOGGLE_HUD
- KeyType::MINIMAP
- KeyType::TOGGLE_CHAT
- KeyType::TOGGLE_FOG
- KeyType::TOGGLE_DEBUG
- KeyType::TOGGLE_PROFILER
- KeyType::RANGESELECT


Co-authored-by: Gregor Parzefall <82708541+grorp@users.noreply.github.com>
2023-10-22 02:00:08 +07:00
updatepo.sh
8a9855241c Update translation files 2023-10-20 23:14:25 +02:00
updatepo.sh
72fc564758 Update example conf and settings translations 2023-10-20 23:12:43 +02:00
BRN Systems
81fee2207e Translated using Weblate (Slovak)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:05 +02:00
gallegonovato
425db09ede Translated using Weblate (Spanish)
Currently translated at 92.1% (1248 of 1355 strings)
2023-10-20 22:54:05 +02:00
Gábriel
0f2b196b32 Translated using Weblate (Hungarian)
Currently translated at 98.2% (1331 of 1355 strings)
2023-10-20 22:54:05 +02:00
watilin
bb7c0ceea0 Translated using Weblate (French)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:05 +02:00
Jorge Batista Ramos Junior
24c2ef2996 Translated using Weblate (Portuguese (Brazil))
Currently translated at 99.0% (1342 of 1355 strings)
2023-10-20 22:54:04 +02:00
Filippo Alfieri
f7775640d5 Translated using Weblate (Italian)
Currently translated at 99.5% (1349 of 1355 strings)
2023-10-20 22:54:04 +02:00
Christian Elbrianno
3127dd902a Added translation using Weblate (Javanese) 2023-10-20 22:54:04 +02:00
Wuzzy
6445fbaadc Translated using Weblate (German)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Tirifto
4a4861c26f Translated using Weblate (Esperanto)
Currently translated at 85.9% (1164 of 1355 strings)
2023-10-20 22:54:04 +02:00
Farooq Karimi Zadeh
332f1af325 Translated using Weblate (Persian)
Currently translated at 0.1% (1 of 1355 strings)
2023-10-20 22:54:04 +02:00
José Douglas
520cfaf13e Translated using Weblate (Portuguese (Brazil))
Currently translated at 97.9% (1327 of 1355 strings)
2023-10-20 22:54:04 +02:00
Farooq Karimi Zadeh
7b14b867f5 Added translation using Weblate (Persian) 2023-10-20 22:54:04 +02:00
Marco Ciampa
8ab517d242 Translated using Weblate (Esperanto)
Currently translated at 85.2% (1155 of 1355 strings)
2023-10-20 22:54:04 +02:00
Claybiokiller
c0f0770f65 Translated using Weblate (Chinese (Simplified))
Currently translated at 91.0% (1234 of 1355 strings)
2023-10-20 22:54:04 +02:00
Linerly
28e06f7d9c Translated using Weblate (Indonesian)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Nanashi Mumei
77f2c94395 Translated using Weblate (Russian)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Emmily
17e0ec27eb Translated using Weblate (Esperanto)
Currently translated at 84.7% (1149 of 1355 strings)
2023-10-20 22:54:04 +02:00
yue weikai
d62abbc938 Translated using Weblate (Chinese (Simplified))
Currently translated at 90.4% (1226 of 1355 strings)
2023-10-20 22:54:04 +02:00
Eoghan Murray
00b7208b5a Translated using Weblate (Irish)
Currently translated at 1.7% (24 of 1355 strings)
2023-10-20 22:54:04 +02:00
Eoghan Murray
92248e8018 Translated using Weblate (Gaelic)
Currently translated at 11.1% (151 of 1355 strings)
2023-10-20 22:54:04 +02:00
Yic95
78aad07be9 Translated using Weblate (Chinese (Traditional))
Currently translated at 70.9% (961 of 1355 strings)
2023-10-20 22:54:04 +02:00
Eoghan Murray
50cdf0e9bf Added translation using Weblate (Irish) 2023-10-20 22:54:04 +02:00
Muhammad Rifqi Priyo Susanto
a644e8c70a Translated using Weblate (Indonesian)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Hugo Carvalho
2e96f99e9c Translated using Weblate (Portuguese)
Currently translated at 98.8% (1339 of 1355 strings)
2023-10-20 22:54:04 +02:00
Milan Šalka
57cc054bb3 Translated using Weblate (Slovak)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Hugo Rosa
8df315378d Translated using Weblate (Portuguese (Brazil))
Currently translated at 97.9% (1327 of 1355 strings)
2023-10-20 22:54:04 +02:00
Jynweythek Vordhosbn
bcfd1fcdba Translated using Weblate (Spanish)
Currently translated at 92.1% (1248 of 1355 strings)
2023-10-20 22:54:04 +02:00
Joaquín Villalba
6f93853e65 Translated using Weblate (Spanish)
Currently translated at 92.1% (1248 of 1355 strings)
2023-10-20 22:54:04 +02:00
joserene-007
c8b98d1eeb Translated using Weblate (Spanish)
Currently translated at 92.1% (1248 of 1355 strings)
2023-10-20 22:54:04 +02:00
Skrripy
356ee9d2a9 Translated using Weblate (Ukrainian)
Currently translated at 55.2% (749 of 1355 strings)
2023-10-20 22:54:04 +02:00
Ács Zoltán
db5a15e14c Translated using Weblate (Hungarian)
Currently translated at 97.9% (1327 of 1355 strings)
2023-10-20 22:54:04 +02:00
Salif Mehmed
e2ab89d253 Translated using Weblate (Bulgarian)
Currently translated at 34.2% (464 of 1355 strings)
2023-10-20 22:54:04 +02:00
Jakub Z
85884c15e7 Translated using Weblate (Polish)
Currently translated at 87.3% (1183 of 1355 strings)
2023-10-20 22:54:04 +02:00
Dominik Gęgotek
fc5ff8d8c7 Translated using Weblate (Polish)
Currently translated at 87.3% (1183 of 1355 strings)
2023-10-20 22:54:04 +02:00
Janar Leas
34e566f726 Translated using Weblate (Estonian)
Currently translated at 46.8% (635 of 1355 strings)
2023-10-20 22:54:04 +02:00
MikeL
a18be49827 Translated using Weblate (Maori)
Currently translated at 0.8% (11 of 1355 strings)
2023-10-20 22:54:04 +02:00
MikeL
2871a9fee8 Added translation using Weblate (Maori) 2023-10-20 22:54:04 +02:00
ROllerozxa
2817b9d84b Translated using Weblate (Swedish)
Currently translated at 66.6% (903 of 1355 strings)
2023-10-20 22:54:04 +02:00
Timur Seber
4cc05906bd Translated using Weblate (Tatar)
Currently translated at 0.9% (13 of 1355 strings)
2023-10-20 22:54:04 +02:00
facilitas
d04c1b5d73 Added translation using Weblate (Interlingua) 2023-10-20 22:54:04 +02:00
Артём Котлубай
2a518d8661 Translated using Weblate (Russian)
Currently translated at 99.3% (1346 of 1355 strings)
2023-10-20 22:54:04 +02:00
Application-maker
9b71b2f5d9 Translated using Weblate (Russian)
Currently translated at 99.3% (1346 of 1355 strings)
2023-10-20 22:54:04 +02:00
Robinson
261bf52440 Translated using Weblate (Czech)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Pexauteau Santander
9b76946540 Translated using Weblate (Czech)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Martin Šimek
9c0b546942 Translated using Weblate (Czech)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Roland Meier
ac3bb40692 Translated using Weblate (German)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Vít Skalický
54a39e3c4e Translated using Weblate (Czech)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Martin Šimek
def9db9d16 Translated using Weblate (Czech)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Nicolae Crefelean
ed1c6b432c Translated using Weblate (Romanian)
Currently translated at 53.5% (725 of 1355 strings)
2023-10-20 22:54:04 +02:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
dc88e6f927 Translated using Weblate (Malay (Jawi))
Currently translated at 59.0% (800 of 1355 strings)
2023-10-20 22:54:04 +02:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
ce53230ab2 Translated using Weblate (Malay)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
José Muñoz
cd17caab7e Translated using Weblate (Spanish)
Currently translated at 89.6% (1215 of 1355 strings)
2023-10-20 22:54:04 +02:00
nyommer
d5bf34271f Translated using Weblate (Hungarian)
Currently translated at 97.6% (1323 of 1355 strings)
2023-10-20 22:54:04 +02:00
Sharpik
941896ef28 Translated using Weblate (Czech)
Currently translated at 68.2% (925 of 1355 strings)
2023-10-20 22:54:04 +02:00
Furkan Baytekin
f362ed0880 Translated using Weblate (Turkish)
Currently translated at 89.0% (1207 of 1355 strings)
2023-10-20 22:54:04 +02:00
Sava Kujundžić
be1c441157 Translated using Weblate (Serbian (latin))
Currently translated at 7.4% (101 of 1355 strings)
2023-10-20 22:54:04 +02:00
Pexauteau Santander
8c3b8b7b4c Translated using Weblate (Slovak)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:04 +02:00
Mimi Kush
be1e781399 Translated using Weblate (Spanish)
Currently translated at 89.6% (1215 of 1355 strings)
2023-10-20 22:54:04 +02:00
Šimon Brandner
b10fe4ddd6 Translated using Weblate (Czech)
Currently translated at 68.1% (924 of 1355 strings)
2023-10-20 22:54:04 +02:00
José Muñoz
d54d4b4618 Translated using Weblate (Spanish)
Currently translated at 88.5% (1200 of 1355 strings)
2023-10-20 22:54:04 +02:00
jolesh
09104e17a0 Translated using Weblate (Esperanto)
Currently translated at 84.3% (1143 of 1355 strings)
2023-10-20 22:54:04 +02:00
Walter Bulbazor
7a5247cc33 Translated using Weblate (Occitan)
Currently translated at 24.3% (330 of 1355 strings)
2023-10-20 22:54:04 +02:00
Tor Egil Hoftun Kvæstad
475809ed40 Translated using Weblate (Norwegian Nynorsk)
Currently translated at 43.2% (586 of 1355 strings)
2023-10-20 22:54:04 +02:00
Артём Котлубай
2f9742c64f Translated using Weblate (Russian)
Currently translated at 99.1% (1344 of 1355 strings)
2023-10-20 22:54:03 +02:00
Tsaqib Fadhlurrahman Soka
85c9c27e42 Translated using Weblate (Indonesian)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:03 +02:00
Marian
8c9a4d9a05 Translated using Weblate (Slovak)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:03 +02:00
Ács Zoltán
1b2396ee9e Translated using Weblate (Hungarian)
Currently translated at 97.0% (1315 of 1355 strings)
2023-10-20 22:54:03 +02:00
Alexandros Koutroulis
dd587aa30d Translated using Weblate (Greek)
Currently translated at 27.8% (377 of 1355 strings)
2023-10-20 22:54:03 +02:00
waxtatect
9ccc0bd27e Translated using Weblate (French)
Currently translated at 100.0% (1355 of 1355 strings)
2023-10-20 22:54:03 +02:00
Gregor Parzefall
b1dec37adb Clean up and improve mainmenu theme / game theme code (#13885) 2023-10-18 20:18:50 +02:00
JosiahWI
62eb6cfed0 Extract updatePauseState from Game::run (#13893) 2023-10-18 20:17:30 +02:00
DS
6026003508 Warn only once about positional stereo sounds (#13895) 2023-10-18 20:16:45 +02:00
Gregor Parzefall
6fdc7e0dad Make hypertext[] respect font size settings (#13858) 2023-10-16 20:47:16 +02:00
DS
3c41195986 Inventory: Fix picking up items via drop and pickup doubleclick (#13891) 2023-10-16 20:46:57 +02:00
Desour
5e0f14266d Fix forgotten CLANG_MINIMUM_VERSION update 2023-10-14 13:23:17 +02:00
DS
12e98678f6 Particle cleanup (#13394) 2023-10-11 17:07:30 +02:00
Thresher
352a403bd0 Optimize PNG files (#13509) 2023-10-09 17:13:44 +02:00
Muhammad Rifqi Priyo Susanto
7e678b5686 Prevent early respawns caused by up/down button in the death screen (#13870) 2023-10-09 17:13:33 +02:00
sfan5
b270c2bd68 Don't print ASCII art when using ncurses 2023-10-09 17:13:18 +02:00
DS
11ec75c2ad ActiveObjectMgr fixes (#13560) 2023-10-09 17:13:04 +02:00
Loïc Blot
929a13a9a0 build: Allow disabling documentation build + print more build flags (#13871)
* build: permit to disable documentation build

* build: add a message about some BUILD_* flags
2023-10-09 15:35:12 +02:00
Wuzzy
2c74797d34 Add script to update/generate mod translations (#13739) 2023-10-08 16:47:11 +01:00
Gregor Parzefall
d05da513be Notify users to reinstall MTG if worlds exist (#13850) 2023-10-08 16:47:00 +01:00
Gregor Parzefall
26bb397852 Add advanced settings checkbox and hide advanced settings by default (#13861)
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2023-10-07 21:34:59 +02:00
sfan5
01d26c0e0e Warn when ignoring bind_address 2023-10-05 17:29:49 +02:00
sfan5
e02bf9fb1a Log timeout when a httpfetch times out 2023-10-05 17:29:49 +02:00
sfan5
9ec40ce8e9 Enforce minimum for curl(_file_download)_timeout 2023-10-05 17:29:49 +02:00
rvenson
ac8a9f9502 Update range values of meta set functions in the documentation 2023-10-05 17:29:26 +02:00
Muhammad Rifqi Priyo Susanto
c60d971bc4 Move unsupported language list into a separate file (#13865) 2023-10-05 17:29:02 +02:00
DS
8db4381304 MapblockMeshGenerator: Use more verbose member names (#13244) 2023-10-04 00:28:43 +02:00
corpserot
5a5697273b lua_api_deploy: fix code blocks parsing (#13847) 2023-10-03 20:34:24 +02:00
sfan5
de0036f4c1 Document air_equivalent as deprecated 2023-10-02 13:44:12 +02:00
Gregor Parzefall
33cc29bbda Allow setting custom third person front view camera offset (#13686)
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2023-10-02 13:44:03 +02:00
Caleb Butler
3a4bf14c20 Replace all core::unicode::ustring with std::u32string (#13775) 2023-10-02 13:43:38 +02:00
Gregor Parzefall
56965bc814 Android: Add field_enter_after_edit[] formspec element (#13836) 2023-10-01 11:20:50 +02:00
Gregor Parzefall
94eba15c34 Misc. mainmenu fixes (#13859)
* settingstypes.txt: Fix wrong default value for profiler.report_path

* Disable Irrlicht file picker on Android
  (It doesn't work.)

* Join Game tab: Fix server description textarea being misaligned with background

* Reduce distance between tab and gamebar on Android
  Allows using a higher gui_scaling value without the gamebar going off-screen.

Co-authored-by: ROllerozxa <rollerozxa@voxelmanip.se>
2023-10-01 11:19:52 +02:00
Desour
c90c545d33 Put the internal sound definitions into a new sound namespace 2023-09-30 18:54:26 +02:00
Desour
bbc64a2eb5 Split sound_openal_internal into serval files 2023-09-30 18:54:26 +02:00
Desour
606215fae9 Move sound_openal and sound_openal_internal into new src/client/sound directory 2023-09-30 18:54:26 +02:00
Desour
8fa2ea71ef Move soundmanager into its own thread
Fixes sound queues running empty on client step hiccups.
2023-09-26 22:10:57 +02:00
Desour
591e45657f Bump minimum clang version to 7.0.1
std::variant is broken in clang < 7.0.1 with libstdc++
see: https://github.com/llvm/llvm-project/issues/32569
2023-09-26 22:10:57 +02:00
sfan5
b0d5cedeb6 Fix missing initialization for m_game_focused 2023-09-24 16:46:18 +02:00
sfan5
d113636a43 Fix UB in NetworkPacket class 2023-09-24 16:46:18 +02:00
sfan5
5109fa7eda Fix crash when processing empty mesh buffers 2023-09-24 16:46:18 +02:00
Gregor Parzefall
ff87be6e5f Remove unused "mNormal" uniform to fix crash on GLES2 with shaders 2023-09-24 16:46:05 +02:00
Gregor Parzefall
4cf900c779 Fix error when enabling texture packs (#13829) 2023-09-23 18:20:23 +02:00
ROllerozxa
c247761213 Escape package description in content tab 2023-09-22 21:25:58 +02:00
savilli
d57c936b08 Don't trigger a key event if a key with the same associated char was pressed (#13773) 2023-09-22 21:25:13 +02:00
David Leal
9f47e123d2 animaition -> animation (#13827)
Also changed `range` to `frame_range`,
2023-09-22 18:41:33 +02:00
sfan5
c3114132d3 Improve readability and infos in verbose log (#13828) 2023-09-22 18:41:10 +02:00
ROllerozxa
5949172735 Build MkDocs Lua API docs using GitHub CI, deploy to api.minetest.net (#13675)
* Build MkDocs Lua API documentation using GitHub CI and Pages instead

* Remove Lua highlight hack as codeblocks are correctly marked as Lua now

* fix line endings
2023-09-18 19:17:18 +03:00
x2048
e36b2226b9 Skip face culling in shadows for double-sided materials (e.g. plantlike) (#13500)
* Skip face culling in shadows for double-sided materials (e.g. plantlike)

* Keep previous face culling for transparent surfaces e.g. water
2023-09-17 21:42:14 +02:00
ROllerozxa
a88e61c2cf Improve UX when no game exists and drop default_game (#13550) 2023-09-17 18:45:28 +01:00
Gregor Parzefall
5bfc5d44c0 Two ContentDB GUI fixes (#13806) 2023-09-16 18:36:28 +02:00
Gregor Parzefall
4f735fba05 Settings GUI: Noise parameter setting fixes (#13797) 2023-09-16 18:35:35 +02:00
Wuzzy
8ebaf753d3 New physics overrides (#11465) 2023-09-15 20:10:08 +02:00
sfan5
2479d51cc6 Fix double-free of minimap textures 2023-09-13 15:27:07 +02:00
sfan5
033128d8dc Show better description to users when std::bad_alloc happens 2023-09-13 13:58:59 +02:00
SmallJoker
4ef93fe25f Allow place_param2 = 0 node placement predictions (#13787)
The placement prediction value 0 was accidentally ignored
and made the clients fall back to automatic rotation based
on the node paramtype2 value.

This now changes the internal representation to properly
indicate the disabled state (e.g. 'nil' in Lua).
2023-09-13 13:57:57 +02:00
Gregor Parzefall
833c324498 Make the crosshair DPI-aware (#13772) 2023-09-11 18:59:32 +02:00
rubenwardy
48ab1835da Replace settings tab with button 2023-09-09 18:49:33 +02:00
Zughy
798b9eae4a Add settings button icon 2023-09-09 18:49:33 +02:00
Desour
010d08f6a4 Fix -Wmissing-braces warnings in mapblock_mesh.cpp 2023-09-09 18:48:56 +02:00
Desour
7897450b27 Fix -Winconsistent-missing-override warnings 2023-09-09 18:48:56 +02:00
Desour
2ad4c9e0ce Fix -Wunused-but-set-variable warnings 2023-09-09 18:48:56 +02:00
Gregor Parzefall
95056f9783 Higher default graphics settings on Android (#13780) 2023-09-07 17:55:11 +02:00
Gregor Parzefall
1a568cc491 Fix that negative integer values for float settings don't get a ".0" suffix (#13779) 2023-09-05 15:36:05 +02:00
Gregor Parzefall
83b85ba16a Rewrite the gamebar (#13768) 2023-09-02 23:02:02 +02:00
chmodsayshello
294ad98776 Send ever lasting particle spawners to all players (#13774) 2023-09-02 22:58:11 +02:00
sfan5
f080aa29b5 Remove usage of obsolete HighPrecisionFPU field 2023-09-01 12:46:36 +02:00
Gregor Parzefall
4252f9d4d5 Restore the appearance of the "Start Game" tab after #13761 (#13769) 2023-08-30 14:45:44 +02:00
rubenwardy
0cbf96cc83 Use formspec version 6 in the main menu (#13761) 2023-08-28 22:36:54 +01:00
Gregor Parzefall
7b56daa236 Small setting-related fixes (#13755) 2023-08-27 20:18:41 +02:00
savilli
852d6a7976 Fix potential freeze in core.check_for_falling 2023-08-27 20:12:53 +02:00
SmallJoker
bf9f831cb2 Inventory: skip redundant stack movement
The list of dragged stacks includes the source stack, which
however does not need to be moved onto itself.
This is an optimization.
2023-08-27 20:12:10 +02:00
SmallJoker
0ba899e239 Inventory: Fix assertion caused by a no-op stack movement 2023-08-27 20:12:10 +02:00
Rising Leaf
660151572f Do not render objects that are invisble into the shadow map 2023-08-26 20:12:17 +02:00
1F616EMO~nya
54eacca287 Use issue templates for creating issues (#13222) 2023-08-25 22:00:05 +07:00
Desour
f47b00426a Revert "Get rid of guiroot"
This reverts commit 45e7a80057.
2023-08-24 22:14:44 +02:00
Desour
7e4dccb3b5 Revert "Get rid of global guienv variable"
This reverts commit 16da954bd7.
2023-08-24 22:14:44 +02:00
Desour
f98726c516 Revert "Use our GUIButton in touchscreengui"
This reverts commit f7f3aaf43c.
Fixes #13743.
2023-08-24 22:14:44 +02:00
Gregor Parzefall
aea9242a96 Allow nodes to have their post_effect_color affected by lighting (#13637)
Co-authored-by: DS <ds.desour@proton.me>
2023-08-24 20:16:36 +02:00
Gregor Parzefall
92b6ff4721 TouchScreenGUI: Fix only 9 hotbar slots being usable (#13698)
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
2023-08-24 17:45:51 +02:00
Gregor Parzefall
72ef90885d Clean up texture filtering settings (#13683) 2023-08-24 10:50:47 +02:00
gamefreq0
d0ee63c766 Enable shift-click crafting (#13729) 2023-08-24 12:00:54 +07:00
fluxionary
587e2b2526 Set item description as infotext for item entities (#13728) 2023-08-24 12:00:18 +07:00
rubenwardy
a65cdbe66e Settings GUI: Use language names rather than codes (#13752) 2023-08-24 00:33:23 +01:00
Montandalar
7b3ed32003 Persist text inputs in mainmenu local tab
Co-authored-by: archfan <33993466+archfan7411@users.noreply.github.com>
2023-08-14 18:17:53 +02:00
sfan5
2c987b66c1 Move implementations of some LuaVoxelManip functions to l_mapgen 2023-08-14 18:16:36 +02:00
sfan5
e48f15c135 Skip liquid updates in MapgenSinglenode if not applicable 2023-08-14 18:16:36 +02:00
sfan5
bf36a90579 Optimize Mapgen::updateLiquid()
-55% runtime in singlenode usage, which is the best case
2023-08-14 18:16:36 +02:00
sfan5
43c9c38a28 Fix itemdef defaults not being applied in async env 2023-08-14 18:16:36 +02:00
sfan5
f6bddc4e8d Fix registered_craftitems not populated in async env 2023-08-14 18:16:36 +02:00
sfan5
f9c881eb5a Add two missing classes to async environment 2023-08-14 18:16:36 +02:00
Desour
16da954bd7 Get rid of global guienv variable
(It can already be accessed via the renderingengine.)
2023-08-14 18:13:47 +02:00
Desour
45e7a80057 Get rid of guiroot
The guienvironment already provides a root gui element, we don't need to add another one.
(For CGUIEnvironment, the env itself is the root element.)
2023-08-14 18:13:47 +02:00
Desour
7e7aceb8c1 Replace all actual uses of irrlicht CGUIStaticText with our StaticText 2023-08-14 18:13:47 +02:00
Desour
d75c956dbc Remove ugly hack in static_text.h
Just use the root element, like GUIButton:add().
2023-08-14 18:13:47 +02:00
Desour
f7f3aaf43c Use our GUIButton in touchscreengui 2023-08-14 18:13:47 +02:00
Desour
91c0439922 Use our GUIButton in our GUIScrollBar
Note that GUIScrollBar needs an ISimpleTextureSource now due to button styling.
2023-08-14 18:13:47 +02:00
Desour
9d62abbe46 Replace any uses of CGUIScrollBar and IGUIScrollBar with GUIScrollBar 2023-08-14 18:13:47 +02:00
Desour
124d064015 GUIButton: Default BgColor to white, as opposed to unintialized
(Same as what CGUIButton uses (via colors=0).)
2023-08-14 18:13:47 +02:00
Desour
2903f692ba GUIButton: Use default member initializers 2023-08-14 18:13:47 +02:00
Desour
7f9de5db0b Make touchscreengui compile 2023-08-14 18:13:47 +02:00
jordan4ibanez
14441a289e Document openSUSE Required Packages 2023-08-14 18:13:36 +02:00
rubenwardy
137e4ce866 Fix hypertext in the mainmenu (#13731) 2023-08-13 13:28:33 +01:00
Gregor Parzefall
526c5f2348 ContentDB GUI: Load package list asynchronously (#13551) 2023-08-13 13:28:24 +01:00
ROllerozxa
e4bedc7ea8 Make content tab use real coordinates and minor cleanups (#13719) 2023-08-13 13:28:16 +01:00
rubenwardy
c6a0ead72d Add warning for initial properties directly inside definition (#9650) 2023-08-13 00:19:03 +01:00
Zughy
98f097dc2f Warn about unsupported file extensions for media 2023-08-06 14:16:00 +02:00
ROllerozxa
c816aa5374 Settings GUI: Fix path settings on Windows 2023-08-06 14:15:49 +02:00
Zughy
4d9a67682d DOCS: state that get_wielded_item returns a copy of the item 2023-08-06 14:15:34 +02:00
rubenwardy
d16d1a1341 Settings GUI: Add setting dependencies (#13704) 2023-08-05 17:55:27 +01:00
rubenwardy
752ce1a1b2 Settings GUI: Move shadow presets to Shaders, remove Most Used (#13713) 2023-08-05 17:33:18 +01:00
JosiahWI
28fce8aad5 Add dev stage to docker image (#13573) 2023-07-30 15:29:25 +01:00
Nikita K
e0948f42ab Add Void Linux specifics to build documentation (#13693) 2023-07-30 14:55:06 +01:00
Joachim Stolberg
21ecdd5681 Fix textarea scrollbar inside border=false (#13678) 2023-07-30 14:54:52 +01:00
Wuzzy
20e9969313 Improve object documentation in lua_api.md (#13239)
Co-authored-by: DS <ds.desour@proton.me>
2023-07-30 14:54:01 +01:00
OgelGames
3f2a10bb4b Fix decode_base64 returning nothing instead of nil (#13697) 2023-07-30 14:53:47 +01:00
doxygen-spammer
9f25378ddd Add performance test nodes, using complex meshes. (#13161) 2023-07-30 14:53:08 +01:00
Gregor Parzefall
cc8280426f Minor additions to the VoxelManip docs 2023-07-28 00:40:01 +02:00
Stvk imension
ba6de431a2 Android: Remove Migration Code (#13590)
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
2023-07-27 14:09:17 +02:00
Gregor Parzefall
c14e4d1795 Increase the resolution of the logo shown on the about tab 2023-07-22 17:20:12 +02:00
Desour
e0192e256f Fix incorrect rounding in GUIInventoryList::getItemIndexAtPos 2023-07-22 17:19:57 +02:00
ndren
53c594abe0 Introduce and start using microsecond sleep on Linux (#13445) 2023-07-22 17:19:49 +02:00
sfan5
72ed8514c5 Use newer IrrlichtMt 2023-07-20 22:15:47 +02:00
Gregor Parzefall
6f0d36c41a Fixes and improvements 2023-07-20 22:15:47 +02:00
Gregor Parzefall
7473e4cafd Expose all OpenGL filtering modes, use OpenGL names for them
Because of a review comment on the Irrlicht PR by numberZero.
2023-07-20 22:15:47 +02:00
Gregor Parzefall
6bf63d4b41 Rename SMaterial::TextureLayer -> SMaterial::TextureLayers
It's not the "texture layer" of the material, but an array of texture layers.
2023-07-20 22:15:47 +02:00
Gregor Parzefall
05ebe2418b Rename E_MATERIAL_FLAG -> E_MATERIAL_PROP
The enum values don't reference material flags, but material properties.
2023-07-20 22:15:47 +02:00
Gregor Parzefall
9bef3c136a Split up texture filtering properties of SMaterialLayer into MinFilter and MagFilter
You can	now set	the filter used	when scaling textures down and the filter used when scaling textures up separately.
2023-07-20 22:15:47 +02:00
Gregor Parzefall
307e380f30 Refactor the way you set material properties
Instead of using SMaterial::setFlag, you now set them directly on SMaterial or SMaterialLayer.
2023-07-20 22:15:47 +02:00
SmallJoker
128d22e6ee GUI: Automatic scaling of checkboxes and scrollbars (#13666)
Mainly helpful on high-DPI screens or when 'gui_scaling' is changed
2023-07-17 20:46:15 +02:00
Nekobit
50234b8e5c Fix string conversion for FreeBSD (#13648) 2023-07-17 20:46:06 +02:00
Gregor Parzefall
3552537fc4 Fix that transparent text still draws a text shadow (#13649)
Makes fade out animations of text more pleasant to look at.
2023-07-17 20:45:56 +02:00
DS
f41e9e3e0f Add Irrlicht device info to the mainmenu About tab (#13636) 2023-07-17 20:44:54 +02:00
archfan
9b310a6e6f Decrease sneak margin to combat phasing through thin walls (#13607)
A 1/16th-node-thick wall is 0.625 meters thick, and the previous margin of 0.1 meters meant that these walls could be phased through by sneaking against them. A margin lower than 0.625 prevents this.
2023-07-17 20:44:33 +02:00
Muhammad Rifqi Priyo Susanto
2061984313 Simplifies code by using Irrlicht's operator overloads
New variables are added to replace in-place calculations.
2023-07-14 21:00:29 +07:00
Muhammad Rifqi Priyo Susanto
3a47559e86 Fix some memory leaks and code style issues
Maximum line length is 95 characters.
Some members' name are changed.
Struct initialisations use brace syntax; eliminating the usage of the memset function.
Iterations use for-each-loop instead of while-loop+iterator.
char * -> std::string
button_info * -> std::shared_ptr<button_info>
2023-07-14 21:00:29 +07:00
Desour
8e09077de8 Fix sound manager not being stepped by GUIEngine 2023-07-14 14:42:00 +02:00
Gregor Parzefall
1837a11c22 Improve messages when changing viewing range and exceeding server-set limit (#13647) 2023-07-14 14:41:45 +02:00
sfan5
bf987bf58a Handle blit_back_with_light with empty area
fixes #13306
2023-07-13 20:42:39 +02:00
sfan5
4a14a18799 Fix mapgen_v6 crashing
this variable was accidentally shadowed in 20b10b569
2023-07-09 20:59:57 +02:00
lhofhansl
136a93f628 Reverse eye-offset Z-coordinate in 3rd person front view (#13369) 2023-07-08 12:00:15 +07:00
Gregor Parzefall
0218963f1b Fix max_formspec_size not taking gui_scaling into account (#13493) 2023-07-07 21:42:43 +02:00
SmallJoker
078bd95a49 Formspec: prevent infinite loop caused by negative background9[] size (#13624) 2023-07-07 21:42:10 +02:00
lhofhansl
869df17ddf Server enforcement for fog_distance (#13448) to block cheating (#13643)
This enforces the fog_distance (if set) at the server, so that a hacked client could not cheat and retrieve blocks beyond the set distance.
2023-07-06 09:36:46 -07:00
Gregor Parzefall
26453df2f7 Don't crash if a Lua error occurs inside get_staticdata 2023-07-03 20:34:02 +02:00
ROllerozxa
d71872af23 Fix texture paths for system-installed builds
* window icon
* custom touchscreen checkbox sprites
2023-07-03 20:31:03 +02:00
Lars Müller
25ef8f3934 Fix local animations not resetting
Converts `LocalPlayerAnimation` to a scoped enum to prevent such bugs in the future
2023-07-02 12:47:18 +02:00
Muhammad Rifqi Priyo Susanto
ff498fc206 Android: Reliably showing an IME for text input dialog (#13521)
This commit is inspired by this blog post: https://developer.squareup.com/blog/showing-the-android-keyboard-reliably/
2023-07-01 14:00:30 +07:00
lhofhansl
0ade097e99 Allow the server to control fog_distance and fog_start via the sky-api (#13448) 2023-06-30 19:11:17 -07:00
numzero
dde8f0e20a Replace a non-aligned cuboid with a cylinder in client::ActiveObjectMgr::getActiveSelectableObjects 2023-06-29 18:58:10 +02:00
numzero
21035bf5d4 Add unit test on client::ActiveObjectMgr::getActiveSelectableObjects 2023-06-29 18:58:10 +02:00
numzero
d7291e0600 Update client::ActiveObjectMgr::getActiveSelectableObjects API 2023-06-29 18:58:10 +02:00
AFCMS
aaae9d5a77 Fix .clang-format file config values 2023-06-29 18:57:55 +02:00
x2048
c09a3a52ac Add antialiasing filters (FXAA, SSAA) (#13253) 2023-06-28 05:30:08 +02:00
sfan5
442d5fc75c Add unit tests for isBlockInSight() 2023-06-26 22:51:49 +02:00
numzero
3b74cc4a41 Replace PP with direct printing 2023-06-26 22:51:32 +02:00
numzero
de77fe8ade Allow printing irr::core::vector[23]d directly to an std::ostream 2023-06-26 22:51:32 +02:00
Vitaliy
2f6a9d12f1 Allow running individual unit tests 2023-06-25 11:13:48 +02:00
Vitaliy
aada2403c9 Try all known video drivers if the requested one fails to initialize 2023-06-25 11:13:23 +02:00
LoneWolfHT
35ad3dabab Fix MSVC github action 2023-06-24 20:38:31 +02:00
s20
4fb6754903 Adding gettext in the compilation dependency packages list 2023-06-24 20:38:11 +02:00
Gregor Parzefall
7e51e2dea6 Fix compiler error on MSVC with ENABLE_TOUCH=TRUE 2023-06-24 20:37:59 +02:00
sfan5
84fb663d6c Add VoxelArea::intersect() 2023-06-23 09:05:26 +02:00
sfan5
659828b142 Rename ModApiEnvMod and ModApiItemMod
The 'mod' could have meant module in the past but no other classes do this.
2023-06-23 09:05:26 +02:00
sfan5
610578e3e2 Use swapNode for set_node_level and add_node_level
While this is a behaviour change I don't think the old one made any sense.
It's possible that someone hit this before and wrote a workaround for it,
they won't be affected by this change.
It only makes things work that didn't before.
2023-06-23 09:05:26 +02:00
sfan5
62629939ff Genericize find_node_near and find_node_in implementations in C++ 2023-06-23 09:05:26 +02:00
sfan5
20b10b5691 Refactor EmergeParams owner 2023-06-23 09:05:26 +02:00
sfan5
32ff832108 Save Lua globals after mod loading
These are used for the async env currently and will be needed elsewhere soon.
2023-06-23 09:05:26 +02:00
sfan5
4fdd2dec59 Move core.run_callbacks and related to common folder 2023-06-23 09:05:26 +02:00
sfan5
524d446757 Minor script api fixes/cleanups 2023-06-23 09:05:26 +02:00
wsor4035
5b6bc8a12b Remove unsupported media formats from client.cpp 2023-06-22 17:52:48 +02:00
LoneWolfHT
6a328197a5 MSVC CI job: Compile with gettext and LuaJIT 2023-06-22 17:52:35 +02:00
Gregor Parzefall
03ffc2618c TouchScreenGUI: Add an exit / "ESC" button to the rare controls bar (#13574) 2023-06-22 17:50:36 +02:00
numzero
7c26cb1c35 Drop unused tile rotations 2023-06-22 17:50:20 +02:00
numzero
1102f92dac Use a enum for tile rotation 2023-06-22 17:50:20 +02:00
numzero
729671d6ae In getNodeTile, use a descriptive struct for the lookup table 2023-06-22 17:50:20 +02:00
numzero
d676520526 Optimize trigonometry out of MapblockMeshGenerator::drawCuboid 2023-06-22 17:50:20 +02:00
numzero
c29d897854 Optimize trigonometry out of MapblockMeshGenerator::drawLiquidTop 2023-06-22 17:50:09 +02:00
numzero
b8ddde0a96 Store liquid data as dimensionless fractions instead of BS multiplies 2023-06-22 17:50:09 +02:00
Vitaliy
43c9647fe5 Use absolute URL for the roadmap (#13617) 2023-06-21 16:00:04 +07:00
Desour
03dda13910 OpenALSoundManager: Fix a buffer overflow 2023-06-20 20:54:39 +02:00
AFCMS
531122ee86 Add .fleet folder to gitignore (#13611) 2023-06-20 22:00:15 +07:00
lhofhansl
8f25f487fe Instrument touchMapBlocks and block loading/deserialization. (#13314) 2023-06-19 16:59:08 -07:00
Vitaliy
f1feeb319c Cull liquid back face on liquid-glasslike interface (#13594) 2023-06-18 13:52:14 -07:00
DS
edcbfa31c9 Sound refactor and improvements (#12764) 2023-06-16 20:15:21 +02:00
Wuzzy
8e1af25738 DevTest: Add example nodes for disable_descend 2023-06-16 20:14:08 +02:00
Wuzzy
6b3deaa170 Add disable_descend to disable active node sinking 2023-06-16 20:14:08 +02:00
Muhammad Rifqi Priyo Susanto
a4e69d6843 TouchScreenGUI: Read coordinates directly for virtual joystick (#13567)
The movement's direction and speed are calculated directly from the button's relative screen coordinate. The previous method was to trigger the movement using a keyboard event.
The only virtual joystick status left is Aux1 button.

---------

Co-authored-by: Gregor Parzefall <gregor.parzefall@posteo.de>
2023-06-16 22:40:16 +07:00
Desour
c549e84abb Silence a -Wsign-compare warning for invlist indices 2023-06-15 13:55:20 +02:00
Desour
dade95e142 Fix curl deprecation warnings, and set minimum curl version to 7.56.0 2023-06-15 13:55:20 +02:00
Desour
f947e2afec Fix some gcc -Wself-move warnings 2023-06-15 13:55:20 +02:00
Desour
6a05d63993 Use [[noreturn]] 2023-06-15 10:38:44 +02:00
Desour
5e6d144567 Enable -Wimplicit-fallthrough and use [[fallthrough]] attribute 2023-06-15 10:38:44 +02:00
Desour
9c348d057e Replace the old STATIC_ASSERT macro with static_assert 2023-06-15 10:38:44 +02:00
Desour
8b108ed5f2 Use nicer syntax for nested namespace definitions 2023-06-15 10:38:44 +02:00
Desour
e700182f44 Replace Optional with std::optional 2023-06-15 10:38:44 +02:00
Desour
34ad551efc Use MutexAutoLock for Thread::m_start_finished_mutex 2023-06-15 10:38:44 +02:00
Desour
5d863d7e9c Bump C++ std to 17 2023-06-15 10:38:44 +02:00
Desour
28766d1879 Bump minimum gcc and clang versions 2023-06-15 10:38:44 +02:00
Pascal Abresch
ba80d1ce1f Implement check_offset for decorations 2023-06-15 10:36:46 +02:00
DS
c91182e1b3 Move the platform-dependent stuff in renderingengine.cpp to irrlicht (#13348) 2023-06-11 14:17:39 +02:00
DS
553dc02deb Fix some memleaks from GUIButtonImage (#13564)
* `m_foreground_image` was grabbed, but not dropped in the destructor.
* `m_image` was created with new. It is grabbed by itself and by the env (not only by the env!, so it's an owning ptr). This owning ptr also was never dropped.
2023-06-06 19:01:32 +02:00
Desour
1b51ff333a Use unique_ptr for ServerInventoryManager::DetachedInventory::inventory 2023-06-05 20:43:33 +02:00
Desour
1780d1bbde Use unique_ptrs for MapSector::m_blocks 2023-06-05 20:43:33 +02:00
Desour
08ea467bfe Use unique_ptr for g_httpfetch_thread 2023-06-05 20:43:33 +02:00
Desour
cfb1b879e0 Use unique_ptrs for CurlFetchThread::m_all_ongoing 2023-06-05 20:43:33 +02:00
Desour
d0bcdff5ce Use unique_ptrs for leveldb db and iterators 2023-06-05 20:43:33 +02:00
Zughy
8445c5fe60 Extend roadmap approval time from one week to one month 2023-06-05 12:02:59 +02:00
Gregor Parzefall
a1463263b5 Auto-detect locale on Android (#13561) 2023-06-05 12:02:10 +02:00
Gregor Parzefall
a857c46e6e Make the settings GUI more usable on Android (#13543) 2023-06-05 12:01:54 +02:00
Desour
d9f478cbfb Remove a misleading MutexAutoLock in l_to_table
The temporary is immediately destructed, so the mutex isn't locked
after the line.
Removed the lock, because the Settings member-functions used by
push_settings_table lock the mutex and are thread-safe, but would
cause a dead-lock.
2023-06-05 12:01:08 +02:00
OgelGames
252c79d53a Inventory mouse shortcut improvements (#13146)
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
2023-06-05 12:00:32 +02:00
mazes-80
23f7aab354 Item Entity: prevent moveresult assert when attached (#13353) 2023-06-05 12:00:11 +02:00
Gregor Parzefall
e5a5d5a672 Fix various cases of double-escaped error messages 2023-06-05 11:59:37 +02:00
Riley Adams
29b7aea38b Cavegen y biome check (#13472) 2023-06-05 11:59:22 +02:00
sfan5
1ef9fc9d1f Bump used IrrlichtMt version 2023-06-04 20:36:46 +02:00
Muhammad Rifqi Priyo Susanto
7221de6ede Option to invert direction or disable mouse wheel for hotbar item selection
More changed callbacks for the settings are added in readSettings(). Those are also deregistered when the Game object is destroyed.
2023-05-31 12:40:00 +07:00
Treer
8cd1296049 Add additional texture modifiers (#10100)
* Adjust hue, saturation, and lightness
* Colorize using hue, saturation, and lightness
* Adjust contrast & brightness
* Hard light
* Overlay
* Screen
* Create texture of a given size and color
2023-05-29 20:17:39 +01:00
lhofhansl
a8ec6092e2 Load blocks and objects behind player when in third-persion front-view (#13431) 2023-05-29 10:26:42 -07:00
Gregor Parzefall
fc3d6c1dd9 Place nodes with single tap on Android (+ bugfix) (#13187)
Don't place nodes when closing button bars.
Update docs (also in-game).
Rename "Default controls" -> "Controls" in Android pause menu since players can't change them (normally), so calling them "default" doesn't make sense.
2023-05-29 12:30:30 +07:00
lhofhansl
6832bf044e Avoid jittering when player is attached (#12439)
* Avoid very jittering when player is attached.

Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: Vitaliy <numzer0@yandex.ru>
2023-05-28 11:36:34 -07:00
ROllerozxa
394dd9ffa5 Fix settings dialog not resetting filter when closed (#13513) 2023-05-27 15:35:01 +01:00
sfan5
8cccd75e81 Android build via CMake (#13528)
* the thing

* the thing 2
2023-05-26 15:21:23 +02:00
Thresher
00c647e4cc Convert spaces to tabs (#13506)
* Convert spaces to tabs

* Desour reviews 1-3 fix

* Desour fixes

* Undo alignment changes
2023-05-26 15:13:57 +02:00
ROllerozxa
f4cb16cc2d Disable desynchronize_mapblock_texture_animation by default (#13514) 2023-05-26 13:48:37 +02:00
Zughy
d6eb6ff973 Reset player lighting when passing no arguments (#13525)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2023-05-26 13:47:16 +02:00
Zughy
b60d38b7f9 Reset day/night ratio even when passing no arguments (#13524)
* reset day_night_ratio when passing zero fields

* Update lua_api.md

---------

Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2023-05-26 13:45:42 +02:00
Thresher
180ec92ef9 Remove trailing whitespace (#13505) 2023-05-18 20:34:18 +02:00
SmallJoker
95a9f4ab7c Inventory: Allow InvRef:set_list with new_size >= old_size (#13497)
Fixes a regression introduced by enforced checks to work with
valid pointers within inventory actions.
2023-05-18 20:32:55 +02:00
Gregor Parzefall
f393214fef Settings menu improvements regarding default values (#13489)
The reset button now removes the setting from minetest.conf instead of setting it to its default value.
The reset button is now shown whenever a value is present in minetest.conf
Float settings now get a .0 suffix if they have no decimal places.
2023-05-18 20:32:26 +02:00
savilli
5ba70cf5ef Fix crash on handling wallmounted nodes with invalid param2 (#13487) 2023-05-18 20:31:04 +02:00
Zemtzov7
35112f2453 Disable vertical movement when both jump and sneak keys are pressed (#13426) 2023-05-18 20:30:21 +02:00
Gregor Parzefall
15fb4cab15 Fix Android segfault when game exits before TouchScreenGUI is initalized 2023-05-11 22:51:16 +02:00
sfan5
15445a0fbe Raise and clean up _WIN32_WINNT constant 2023-05-11 22:51:01 +02:00
Wuzzy
80574cdbe8 Fix rotation of 4dir in schematic placement (#13432) 2023-05-11 22:50:52 +02:00
Stvk imension
3de54039ae Document Android controls (#13061) 2023-05-11 22:50:38 +02:00
Buckaroo Banzai
65692ad1b5 Add min/max protocol version to minetest.get_version() (#13482) 2023-05-06 16:16:21 +01:00
rubenwardy
bc4fc6d648 Fix shadows dropdown and clean up shader settings (#13481) 2023-05-03 22:28:02 +01:00
rubenwardy
ad37df7f2e Fix crash when multiple mods with the same name provide settings 2023-05-01 21:39:12 +01:00
rubenwardy
d35672e78e Redesign/unify mainmenu settings interface 2023-05-01 17:11:41 +01:00
Zughy
a421a1d764 Add setting icons 2023-05-01 17:11:41 +01:00
DS
bec9c68bf3 Release invlist resizelock while doing the recursive callback in move_somewhere mode (#13470)
Fixes a crash in popular creative inventory mods that set the list when you put
something into trash.
2023-04-30 18:20:48 +02:00
lhofhansl
b35aa10579 Guarantee ActiveObjectMgr::m_active_object is not modified while iterating (#13468)
Currently if a mod creates new active objects in on_deactivate the server could crash.
2023-04-28 11:17:48 -07:00
Desour
7f6b09dce8 Use json forward-declarations 2023-04-27 18:50:33 +02:00
Desour
8b73743baa Reduce number of recursively included headers
This should improve compilation speed.

Things changed:
* Prefer forward-declarations in headers.
* Move header-includes out of headers if possible.
* Move some functions definitions out of headers.
* Put some member variables into unique_ptrs (see Client).
2023-04-27 18:50:33 +02:00
Desour
e9e8eed360 GUIChatConsole: Use primary selection 2023-04-27 18:50:17 +02:00
Desour
062b4d036a GUIEditBox: Use primary selection 2023-04-27 18:50:17 +02:00
AFCMS
d197ff0f9d Use Lua code blocks in lua_api.md 2023-04-26 20:09:08 +02:00
rubenwardy
9c90358912 Split compilation instructions from README.md (#13457) 2023-04-25 21:02:02 +01:00
SmallJoker
0fb6dbab36 InventoryManager: Disallow resizing or deleting inventory lists that are in use (#13360)
Naive solution to prevent InventoryList UAF and OOB ItemStack access caused by shrink/clear operations on InventoryLists within callbacks of an inventory action.

Co-authored-by: Desour <ds.desour@proton.me>
2023-04-22 17:42:36 +02:00
rubenwardy
4158b72971 Add ability to override item images using meta (#12614) 2023-04-17 19:44:41 +01:00
rubenwardy
8c2c7fadbf Add lua_api.txt to point to new file 2023-04-16 20:23:53 +01:00
rubenwardy
b1786e88ac Use .md extension for markdown files
Linking to line numbers is brittle, linking to sections/headings is better.

If you still want to link to a line number, you can append ?plain=1 to GitHub's URL
2023-04-16 20:23:53 +01:00
rubenwardy
5cd6a22dd3 Update settingtypes (#13428)
* Move settings to correct sections
* Improve titles and descriptions
* Make defaults in settingtypes.txt and defaultsettings.cpp match

Fixes #9002
2023-04-14 22:32:25 +01:00
rubenwardy
b89077187b Fix ContentDB page not being reset when changing type
Fixes #13362
2023-04-14 20:34:03 +01:00
rubenwardy
c5fb50298a Prevent installing mods when there is no base game (#13429) 2023-04-14 20:23:25 +01:00
Desour
ccd696c49a Throw Hocroft-Karp onto shapeless recipes 2023-04-14 21:10:09 +02:00
Desour
50e91b882c Add some simple unittests for shapeless recipes
Note: devtest also has craft unittests (see devtest/mods/unittests/crafting.lua),
      but those aren't run at load-time.
2023-04-14 21:10:09 +02:00
DS
ae7271b725 Fix background[] pos-offset lower-right-corner being at least (1,1) (#13320)
IGUIElement has a MinSize for the RelativeRect, which is at least (1,1).
This means a pos offset of (0,0) will cause a seemingly off-by-1 error at the
lower right corner, and (0.1,0.1) for example will just not work on the lower
right corner.
Ergo, we can't use the AbsoluteRect for storing the pos offset.
2023-04-14 21:05:09 +02:00
DS
d49d80a4a0 Store whether window is maximized (#12861) 2023-04-14 21:04:03 +02:00
cat-master21
0b08e1b1d2 AppImageBuilder.yml: add script section and update to Jammy (#13078) 2023-04-14 13:00:20 +01:00
Lars
f9b1176fa9 Track server's max AsyncRunStep 2023-04-14 00:09:48 +01:00
Lars
3d232e2345 Add MAX profiler option 2023-04-14 00:09:48 +01:00
rubenwardy
9d1ae80e89 Add focused styling to buttons (#13414) 2023-04-14 00:09:29 +01:00
Gregor Parzefall
2a1bc82887 Fix black loading screen background if menu_clouds = false (#13322) 2023-04-13 18:12:48 +01:00
Wuzzy
d1e5dbefc7 Clarify documentation of punch key (#13238) 2023-04-13 18:12:26 +01:00
Desour
fc116ec950 Play object footstep sound at feet 2023-04-13 18:12:13 +01:00
Desour
7283d2495f Devtest: Add bigfoot for footstep sounds 2023-04-13 18:12:13 +01:00
Zardshard
e139749b5c Simulate all keys being released when when game loses focus (#13336) 2023-04-13 18:06:21 +02:00
sfan5
fe75ec8d0d Update dependency libraries in buildbot 2023-04-13 18:05:39 +02:00
AFCMS
68f81ace97 Add vector.in_area() utility function (#13390) 2023-04-12 10:46:26 +01:00
rubenwardy
2fc7eb3ea2 Remove formspec_default_bg_color/opacity settings (#13419)
These settings are unnecessary. They only apply when formspecs don't have a background/bgcolor set. In practice, most games do theme their GUIs. Removing low value settings simplifies code and improves UX by decluttering the settings menu

Split out from #12140
2023-04-11 19:57:36 +01:00
Desour
1dd13da37d Get rid of global dummySoundManager
There is no need for this to be globally unique.
2023-04-11 20:06:15 +02:00
Desour
b201c03625 Use smart-ptrs in GUIEngine 2023-04-11 20:06:15 +02:00
Desour
ceec560779 Add make_irr 2023-04-11 20:06:15 +02:00
Stvk imension
d39a07efea Android: Minor Code Improvements (#13342) 2023-04-10 23:05:01 +01:00
Riley Adams
73391013f7 Add node pos to node damage HP change reason (#13196) 2023-04-10 23:04:52 +01:00
David Leal
1d88d85f1c Add progress_bar.png and progress_bar_bg.png to LICENSE file 2023-04-10 19:57:41 +02:00
Lars
4a742be73e Do not call updateDrawList, updateDrawListShadow, and touchMapBlocks in the same frame 2023-04-09 07:10:17 -10:00
Lars
8982998681 Add a default direction light for shadows 2023-04-09 07:10:17 -10:00
sfan5
9d736e8b8b Drop ENABLE_GLES option
ENABLE_GLES predates forking Irrlicht. Its primary use was to distinguish Irrlicht-ogles from upstream version as Minetest could be compiled with either.
That's not necessary anymore and gets in the way sometimes.
2023-04-08 20:19:35 +02:00
sfan5
c26e122485 Move video_driver default selection to runtime 2023-04-08 20:19:35 +02:00
Desour
67068cfaf4 Get rid of wgettext 2023-04-08 20:17:50 +02:00
Vitaliy
35929d27e3 Remove fast faces (#13216)
Co-authored-by: Lars <larsh@apache.org>
2023-04-08 20:17:15 +02:00
sfan5
2e497cc471 Merge remote-tracking branch 'origin/stable-5' into HEAD 2023-04-08 19:32:11 +02:00
sfan5
c2a9ac24ac Continue with 5.8.0-dev 2023-04-08 18:05:03 +02:00
sfan5
1b95998d11 Bump version to 5.7.0 2023-04-08 18:04:52 +02:00
Артём Котлубай
cc29bb473d Translated using Weblate (Russian)
Currently translated at 99.1% (1343 of 1355 strings)
2023-04-08 17:37:31 +02:00
Денис Савченко
bdebacd3a5 Translated using Weblate (Ukrainian)
Currently translated at 54.8% (743 of 1355 strings)
2023-04-08 17:37:31 +02:00
Timofey Bezruchenko
036d08fb70 Translated using Weblate (Russian)
Currently translated at 99.1% (1343 of 1355 strings)
2023-04-08 17:37:31 +02:00
waxtatect
803a57a490 Translated using Weblate (French)
Currently translated at 100.0% (1355 of 1355 strings)
2023-04-08 17:37:31 +02:00
dreigiau
f2433c7b63 Translated using Weblate (Welsh)
Currently translated at 17.4% (237 of 1355 strings)
2023-04-08 17:37:31 +02:00
Walter Bulbazor
f9376ac763 Translated using Weblate (Occitan)
Currently translated at 23.6% (320 of 1355 strings)
2023-04-08 17:37:30 +02:00
109247019824
6885fd4fd0 Translated using Weblate (Bulgarian)
Currently translated at 33.1% (449 of 1355 strings)
2023-04-08 17:37:30 +02:00
Marian
cee1c5d11d Translated using Weblate (Slovak)
Currently translated at 99.3% (1346 of 1355 strings)
2023-04-08 17:37:30 +02:00
Артём Котлубай
22041c5e8a Translated using Weblate (Russian)
Currently translated at 99.0% (1342 of 1355 strings)
2023-04-08 17:37:30 +02:00
Julien Maulny
f0fcc150d0 Translated using Weblate (French)
Currently translated at 100.0% (1355 of 1355 strings)
2023-04-08 17:37:30 +02:00
dreigiau
469a2eb4a4 Added translation using Weblate (Welsh) 2023-04-08 17:37:30 +02:00
Rodion Borisov
7ae5c91d62 Translated using Weblate (Russian)
Currently translated at 98.9% (1341 of 1355 strings)
2023-04-08 17:37:30 +02:00
waxtatect
051102cde0 Translated using Weblate (Spanish)
Currently translated at 88.4% (1199 of 1355 strings)
2023-04-08 17:37:30 +02:00
Giov4
76b61f07c9 Translated using Weblate (Italian)
Currently translated at 96.1% (1303 of 1355 strings)
2023-04-08 17:37:30 +02:00
Wuzzy
52956464a5 Translated using Weblate (German)
Currently translated at 100.0% (1355 of 1355 strings)
2023-04-08 17:37:30 +02:00
grreby
046ca78dfa Translated using Weblate (Czech)
Currently translated at 68.1% (924 of 1355 strings)
2023-04-08 17:37:30 +02:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
aa28084604 Translated using Weblate (Malay (Jawi))
Currently translated at 58.2% (789 of 1355 strings)
2023-04-08 17:37:30 +02:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
a3a4640257 Translated using Weblate (Malay)
Currently translated at 100.0% (1355 of 1355 strings)
2023-04-08 17:37:30 +02:00
BreadW
87b3e9cc5f Translated using Weblate (Japanese)
Currently translated at 100.0% (1355 of 1355 strings)
2023-04-08 17:37:30 +02:00
Muhammad Rifqi Priyo Susanto
4083fcf93a Translated using Weblate (Indonesian)
Currently translated at 100.0% (1355 of 1355 strings)
2023-04-08 17:37:30 +02:00
waxtatect
1036c2a639 Translated using Weblate (French)
Currently translated at 100.0% (1355 of 1355 strings)
2023-04-08 17:37:30 +02:00
sfan5
7bfea9b0fe Disable ubuntu-18.04 CI workflows
the base image has been removed by Github, we can see how to fix these later
2023-04-08 17:27:28 +02:00
SmallJoker
ba2fee0751 Particle spawner: Fix missing parameters
The changes done to clientpackethandler.cpp and server.cpp move the
compatibility code into a protocol version check so that older code
parts can easily be removed in the future (e.g. bump of minimal version).
2023-04-08 17:23:17 +02:00
SmallJoker
f8e0778fc9 Particle spawner: Move definitions to source
Long functions were moved to the source file to keep the header
short to speed up compiling. This has no functional change.
2023-04-08 17:23:17 +02:00
SmallJoker
9c9309cdbb Lua API: Catch serialization error for chat messages (#13337)
Prevents server errors caused by too long chat messages from the Lua API.
2023-04-07 12:49:35 +02:00
SmallJoker
d975ebdcb9 Limit formspec fields to 640K (#13380)
Fixes an issue where long inputs could cause issues when dealing with formspecs.
The expected data is usually below 1 KiB, however that's not a technical limit.
2023-04-07 12:49:23 +02:00
Lars
7048fc25dd Take mesh-bounding-sphere into account in updateDrawListShadow 2023-04-03 13:57:05 -07:00
Lars
b01f85d573 Revert "Add mesh-holding blocks to shadow drawlist. (#13203)"
This reverts commit 2a8becd650.
2023-04-03 13:57:05 -07:00
SmallJoker
1c1f1b1615 Revert "Enable connected glass by default (#13242)"
This reverts commit a93f3542d9 for
the upcoming 5.7.0 release.

See https://github.com/minetest/minetest/issues/8290 for a detailed discussion.
2023-04-02 20:56:31 +02:00
x2048
6c0a6925fc Corrections to loops and BFS cullers (#13375)
* Reset usage timers in loops culler
* Correctly touch map blocks when using bfs culler
* Align use of variables
* Report statistics when using loop culler
2023-04-01 22:41:00 +02:00
sfan5
819e9fc615 Do not rely on ZSTD_CLEVEL_DEFAULT define 2023-04-01 22:06:03 +02:00
lhofhansl
48fc286a95 Restart map-send cycle if visible blocks are soon to be unloaded. (#13277)
* Restart map-send cycle if visible blocks are soon to be unloaded.
* Reset completion timer when camera or position changed.

Co-authored-by: sfan5 <sfan5@live.de>
2023-03-30 09:19:13 -07:00
x2048
93898957b6 Return 'loops' occlusion culler under a setting (#13352)
* Add occlusion_culler setting to minetest.conf.example
* Add raytraced occlusion culling to 'loops' algorithm

---------

Co-authored-by: sfan5 <sfan5@live.de>
2023-03-30 00:10:23 +02:00
sfan5
bd88d299b9 Bump protocol version
and correct documentation of previous version
2023-03-29 23:19:39 +02:00
sfan5
0a698d92c3 Update credits tab and mailmap 2023-03-29 23:19:11 +02:00
DS
0f496f1ed2 Always build locale files in CMAKE_SOURCE_DIR if building RUN_IN_PLACE (#13272) 2023-03-27 20:02:48 +02:00
DS
ea095d3f69 Fix core.item_eat for same-item replace_with_item and split stacks before dropping (#13286)
The replace_with_item can be added to the slot of the wield item, which
is afterwards overwritten. This causes item loss.
2023-03-27 20:02:23 +02:00
DS
2180dc14ef Fix safeLoadFile() skipping 2 chars too much from the shebang (#13310) 2023-03-27 20:01:05 +02:00
Muhammad Rifqi Priyo Susanto
baf99f826c Add Indonesian translation of builtin 2023-03-24 12:35:12 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi (MNH48)
9c07bf68f1 Add Malay translation of builtin 2023-03-24 12:34:58 +01:00
DS
ed632f3854 Safely handle block deletion (#13315)
Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
2023-03-24 12:34:44 +01:00
x2048
f3b198e490 Return shadow_sky_body_orbit_tilt setting
Used as a default value when the game does not change the value via API (e.g. legacy server)
2023-03-24 12:34:21 +01:00
x2048
9af587c54e Move rendering engine reset after deletion of game objects 2023-03-20 11:42:16 +01:00
x2048
6cd2eea487 Move drawing of wield tool into a dedicated step of the pipeline (#13338) 2023-03-19 21:31:15 +01:00
Wuzzy
09342c0811 Clarify documentation of inventory actions (#13181)
The text was not clear enough on what these do exactly. It was written in a way that sounded like this allows you to capture ALL inventory changes of the player inventory. However, this is not true: It only captures inventory changes within the player inventory or when the item was exchanged with another inventory.
2023-03-19 20:25:08 +01:00
Wuzzy
0050f12b32 Various smaller lua_api documentation updates (#13240)
This fixes several smaller documentation issues at once because posting one PR for every tiny documentation fix is a nightmare.
2023-03-19 20:24:37 +01:00
luk3yx
5fa63a0b0c Fix server-side formspec state keeping issue (#13332) 2023-03-19 20:23:11 +01:00
x2048
6fe9bc8ae1 Remove obsolete rendering core init code (#13341)
Also removes duplicate call to shadow render step
2023-03-19 20:22:45 +01:00
Gregor Parzefall
38e005294f Remove default keybind for pitchmove (#13319) 2023-03-16 14:57:44 +01:00
olive
b1c8a7d055 Fix empty port assertion error in 'Join Game' menu
Pressing "Register" when the port field was empty led to an assertion error inside `create_register_dialog`, it was simply checking the port was a number.
2023-03-16 14:57:20 +01:00
x2048
2bed338ef7 Fix occasional black screen on startup 2023-03-16 14:56:27 +01:00
Jude Melton-Houghton
b7359f5fa9 Update nodes in LBM loop 2023-03-13 18:17:07 +01:00
DS
cac1dca95b Improvement of #12974: better linear independent vector (#12979) 2023-03-13 18:16:07 +01:00
DS
02346819f9 Fix rendertarget size being saved as screensize (#13313) 2023-03-12 19:56:49 +01:00
lhofhansl
3e148e2810 Fix infinite viewing_range (#13225)
Use a simplified version of the old loops culler for infinite viewing range.
2023-03-12 09:37:47 -07:00
DS
b1ed0ef721 Fix ChatPrompt crash in very narrow windows (#13305)
In very narrow windows, `m_cols` can be small (i.e. 0).
Hence, `m_view <= m_line.size() + 1 - m_cols` does not guarantee
`m_view <= m_line.size()`.
`std::string::substr(pos, npos)` requires `pos <= size()`.
2023-03-11 17:46:49 +01:00
Wuzzy
1aeb0280df Update German translation of builtin 2023-03-11 17:46:09 +01:00
Wuzzy
e73a4ea506 Update builtin locale 2023-03-11 17:46:09 +01:00
x2048
705195b43e Scale culler steps proportionally to the mesh sizes (#13250) 2023-03-11 14:10:26 +01:00
x2048
1de8a1e962 Fix missing shadows when sun tilt is zero 2023-03-11 13:49:40 +01:00
updatepo.sh
ad41d0af9d Run updatepo.sh 2023-03-09 15:57:12 +01:00
updatepo.sh
c77f3d4dc4 Update minetest.conf.example and translation file 2023-03-09 15:38:46 +01:00
Muhammad Rifqi Priyo Susanto
225659f6e0 Translated using Weblate (Indonesian)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:35 +01:00
Fábio Rodrigues Ribeiro
ad203b75e1 Translated using Weblate (Portuguese (Brazil))
Currently translated at 97.4% (1315 of 1350 strings)
2023-03-09 15:31:35 +01:00
ssantos
37f4d6e447 Translated using Weblate (Portuguese)
Currently translated at 99.7% (1346 of 1350 strings)
2023-03-09 15:31:35 +01:00
unacceptium core
b12eb5e490 Translated using Weblate (Hungarian)
Currently translated at 97.6% (1318 of 1350 strings)
2023-03-09 15:31:35 +01:00
Guih48
a32bbc8941 Translated using Weblate (Hungarian)
Currently translated at 97.6% (1318 of 1350 strings)
2023-03-09 15:31:35 +01:00
W K
0263069255 Translated using Weblate (Polish)
Currently translated at 87.2% (1178 of 1350 strings)
2023-03-09 15:31:35 +01:00
Jakub Z
8ac5c45da5 Translated using Weblate (Polish)
Currently translated at 87.2% (1178 of 1350 strings)
2023-03-09 15:31:35 +01:00
Giov4
7dd28f0751 Translated using Weblate (Italian)
Currently translated at 93.1% (1258 of 1350 strings)
2023-03-09 15:31:35 +01:00
Jynweythek Vordhosbn
0f50d2d329 Translated using Weblate (Spanish)
Currently translated at 88.2% (1192 of 1350 strings)
2023-03-09 15:31:35 +01:00
Matheus Bastos
306b86ee91 Translated using Weblate (Portuguese (Brazil))
Currently translated at 97.4% (1315 of 1350 strings)
2023-03-09 15:31:35 +01:00
Ghurir
ff22d650ed Translated using Weblate (Arabic)
Currently translated at 38.5% (521 of 1350 strings)
2023-03-09 15:31:35 +01:00
Matheus Vinicius
be5710810b Translated using Weblate (Portuguese)
Currently translated at 99.7% (1346 of 1350 strings)
2023-03-09 15:31:35 +01:00
Ghurir
8d691e6633 Translated using Weblate (Dutch)
Currently translated at 90.0% (1216 of 1350 strings)
2023-03-09 15:31:35 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
6f53af2416 Translated using Weblate (Malay (Jawi))
Currently translated at 55.7% (753 of 1350 strings)
2023-03-09 15:31:35 +01:00
gnu-ewm
7e22d472a3 Translated using Weblate (Polish)
Currently translated at 83.3% (1125 of 1350 strings)
2023-03-09 15:31:35 +01:00
Pexauteau Santander
ecb1bd7ac8 Translated using Weblate (Slovak)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:35 +01:00
Jakub Z
78d5c95006 Translated using Weblate (Polish)
Currently translated at 83.3% (1125 of 1350 strings)
2023-03-09 15:31:35 +01:00
ROllerozxa
36c5ea2d5d Translated using Weblate (Swedish)
Currently translated at 66.2% (894 of 1350 strings)
2023-03-09 15:31:35 +01:00
waxtatect
cd0801a4fa Translated using Weblate (French)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:35 +01:00
Kristian
fb7bfb62d8 Translated using Weblate (Danish)
Currently translated at 52.8% (713 of 1350 strings)
2023-03-09 15:31:35 +01:00
Filip
bc2d863492 Translated using Weblate (Danish)
Currently translated at 52.5% (710 of 1350 strings)
2023-03-09 15:31:35 +01:00
Kristian
87d3c773bf Translated using Weblate (Danish)
Currently translated at 52.5% (710 of 1350 strings)
2023-03-09 15:31:35 +01:00
Filip
22350290c5 Translated using Weblate (Danish)
Currently translated at 51.7% (698 of 1350 strings)
2023-03-09 15:31:35 +01:00
Kristian
9cb12e3565 Translated using Weblate (Danish)
Currently translated at 51.4% (695 of 1350 strings)
2023-03-09 15:31:35 +01:00
Filip
34097e3a6f Translated using Weblate (Danish)
Currently translated at 50.1% (677 of 1350 strings)
2023-03-09 15:31:35 +01:00
Kristian
cbe35af9c9 Translated using Weblate (Danish)
Currently translated at 50.1% (677 of 1350 strings)
2023-03-09 15:31:35 +01:00
Gao Tiesuan
1ca1ea2ca9 Translated using Weblate (Chinese (Simplified))
Currently translated at 90.5% (1222 of 1350 strings)
2023-03-09 15:31:35 +01:00
AFCMS
bf7478b0a8 Translated using Weblate (French)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:35 +01:00
BreadW
611f6b0cff Translated using Weblate (Japanese)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:35 +01:00
Apika Luca
c1d2c0d4ec Translated using Weblate (Spanish)
Currently translated at 86.3% (1166 of 1350 strings)
2023-03-09 15:31:35 +01:00
CouldBeMathijs
1e4b6ba1a3 Translated using Weblate (Dutch)
Currently translated at 89.7% (1212 of 1350 strings)
2023-03-09 15:31:35 +01:00
109247019824
880c2ecb3b Translated using Weblate (Bulgarian)
Currently translated at 32.5% (440 of 1350 strings)
2023-03-09 15:31:34 +01:00
Marian
a5a991576f Translated using Weblate (Slovak)
Currently translated at 99.7% (1346 of 1350 strings)
2023-03-09 15:31:34 +01:00
Linerly
b37886375f Translated using Weblate (Indonesian)
Currently translated at 98.1% (1325 of 1350 strings)
2023-03-09 15:31:34 +01:00
waxtatect
7fa9dbccf3 Translated using Weblate (French)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:34 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
0fbdc58303 Translated using Weblate (Malay)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:34 +01:00
Артём Котлубай
15239d1449 Translated using Weblate (Russian)
Currently translated at 99.7% (1347 of 1350 strings)
2023-03-09 15:31:34 +01:00
Wuzzy
6fd412c745 Translated using Weblate (German)
Currently translated at 100.0% (1350 of 1350 strings)
2023-03-09 15:31:34 +01:00
lhofhansl
1f0d042377 Reduce server CPU consumed by occlusion culling. (#13260)
Cache blocks already occluded at a specific distance. The RemoteClient typically visits the same distance multiple time - especially at larger distances, so this saves significant CPU from recalculating the occlusion state of blocks.
2023-03-05 21:33:41 -08:00
sfan5
9ef3c8ce38 Increase used IrrlichtMt version 2023-03-05 22:00:27 +01:00
Thomas Laubrock
4f06df719d Kubernetes: Deployments are stable since v1.16
https://kubernetes.io/docs/reference/using-api/deprecation-guide/#deployment-v116
K8s Version v1.16 doesn't allow `extensions/v1beta1` as API version.
2023-03-05 15:10:22 +01:00
ROllerozxa
c91f3f99fd Minor adjustments now that OpenGLES 2 is the default driver on Android (#12391) 2023-03-05 15:07:40 +01:00
SmallJoker
847ed04e0a Tile: Fix segfault caused by invalid PNG data 2023-03-05 14:41:55 +01:00
Lars
e66e583f5e Remove accidental emacs files. 2023-03-03 17:51:45 -08:00
lhofhansl
dcf6a6a67b Log server map send cycle time. (#13259)
* Measure server map send time per player.
2023-03-03 17:41:30 -08:00
sfan5
915befecc5 Re-enable verbose logging on Android
Without recompiling, there's no way to see it in logcat otherwise.
2023-03-02 19:57:18 +01:00
sfan5
fee2e3ee27 Fix task ordering and more in Gradle Android build 2023-03-02 19:57:18 +01:00
PrairieWind
a93f3542d9 Enable connected glass by default (#13242) 2023-03-02 19:56:55 +01:00
lynx197
8c7276c9d4 Add git installation steps for Arch/Alpine to README 2023-03-01 09:09:58 +01:00
DS
514bf3582c Document that item_image_button[] name is non-optional 2023-03-01 09:09:29 +01:00
numzero
d6be6682ec Drop dependency on IrrCompileConfig
The only remaining thing is IRRLICHT_SDK_VERSION via irrlicht.h
2023-03-01 09:06:23 +01:00
rubenwardy
39f4d26177 Add minetest.get_player_window_information() (#12367) 2023-02-27 22:58:41 +00:00
lhofhansl
fbbdae93ee Fix for #13255: Check if client has a block even if the server has unloaded it. (#13256) 2023-02-27 09:57:03 -08:00
lhofhansl
fe3ea090d1 Don't expire blocks visible to the client. (#13255) 2023-02-26 14:18:18 -08:00
sofar
2083252c05 Sky: transmit body_orbit_tilt to client. (#13193)
This obsoletes the current client-side setting entirely. The server can
transmit the tilt to the client directly and will send 0.0f as default
value.

Co-authored-by: x2048 <codeforsmile@gmail.com>
Co-authored-by: sfan5 <sfan5@live.de>
2023-02-26 01:08:33 +01:00
DS
6e1c70e02b Fix a -Wreorder warning 2023-02-22 11:06:48 +01:00
lhofhansl
63c378fb5b Reduce client's packet processing budget per iteration from 100 to 10ms. (#13237) 2023-02-21 16:33:21 -08:00
x2048
2553db5c81 Fix rounding errors when slicing the shadow draw list (#13226) 2023-02-20 21:01:05 +01:00
Alex
af4009d924 Add chat HUD flag (#13189) 2023-02-20 21:00:37 +01:00
sofar
cf19167e99 Add jpeg and png libraries to the Fedora DNF install hint. (#13191)
Co-authored-by: sfan5 <sfan5@live.de>
2023-02-19 00:52:30 +00:00
paradust7
aa5dc0968b Fix typo and missing entry in serveropcodes 2023-02-18 16:47:08 +01:00
sfan5
3bafbaac49 Remove dead code behind Irrlicht version checks 2023-02-18 16:46:51 +01:00
Vitra Suchovich
2dafce6206 Say /setpassword is insecure 2023-02-18 00:04:52 +01:00
jordan4ibanez
0e721f7571 lua_api.txt: Explain what a float range is 2023-02-18 00:03:50 +01:00
Muhammad Rifqi Priyo Susanto
c1e430ef68 Android: Increase minimum SDK version to 21
Target/compiled SDK version is increased to 33.
Build Tools, NDK, and Gradle are also updated.
2023-02-18 00:03:28 +01:00
20kdc
75e6cc190a Source image tracking in tile generation (#12514) 2023-02-18 00:03:03 +01:00
lhofhansl
2a8becd650 Add mesh-holding blocks to shadow drawlist. (#13203)
When mesh chunking and shadows are enabled, make sure that the mesh-holding blocks are added to the shadow drawlist.
Otherwise those portions of the shadows will not be rendered.
2023-02-16 15:43:08 -10:00
x2048
4cd6b773bb Fix no color values on bloom texture (#13197)
Align meaning of 'exposure' variable across different stages
Put 'exposure' variable behind ENABLE_AUTO_EXPOSURE
2023-02-10 21:04:37 +01:00
lhofhansl
d3a6ee00e6 Generalize mesh chunking, and make it configurable. (#13179)
* Generalize mesh chunking. Set 3x3x3 chunks.

* Make mesh chunk size configurable... Default to 1 (off).

* Extract all mesh grid maths into a dedicated class

---------

Co-authored-by: x2048 <codeforsmile@gmail.com>
2023-02-08 13:42:12 -08:00
lhofhansl
56d2567b5d Separate drawlist from non-rendered blocks. (#13176) 2023-02-01 08:41:23 -08:00
kab0u
8bbb673c0b Improve the documentation for chat command definition in lua_api.txt (#13168) 2023-01-31 17:31:48 +01:00
x2048
69fc206109 8x block meshes (#13133)
Reduce the number of drawcalls by generating a mesh per 8 blocks (2x2x2). Only blocks with even coordinates (lowest bit set to 0) will get a mesh.

Note: This also removes the old 'loops' algorithm for building the draw list, because it produces visual artifacts and cannot be made compatible with the approach of having a mesh for every 8th block without hurting performance.

Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
Co-authored-by: Lars <larsh@apache.org>
Co-authored-by: sfan5 <sfan5@live.de>
2023-01-31 17:30:59 +01:00
lhofhansl
cded6a3945 Display whole profiler numbers up to 999999 without scientific notation. (#13155) 2023-01-24 17:40:23 -08:00
x2048
b8aaad4f1e Remove the 'loops' occlusion culler (#13169) 2023-01-23 10:58:29 +01:00
DS
8478796226 Decrease minimum for repeat_place_time (#13165) 2023-01-23 00:20:12 +01:00
sfan5
87d509e462 Implement --debugger option to improve UX when debugging crashes (#13157) 2023-01-23 00:19:30 +01:00
x2048
6f5703baf1 Clear exposure compensation state textures on creation (#13151) 2023-01-23 00:18:48 +01:00
veprogames
cf5add1472 Use default values from cpp_api/s_env.cpp for register_abm in lua_api.txt (#13163) 2023-01-21 09:43:20 +01:00
maxchen32
47c8b5d57a Fix a README mistake on option SPATIAL_LIBRARY (#13162) 2023-01-21 09:42:55 +01:00
x2048
ca13c51024 Fix concurrency in texture source (#13150) 2023-01-19 21:44:27 +01:00
Wuzzy
e21d5613a6 Change DevTest header (font = "undefined medium") (#13147)
Font downloaded from https://undefined-medium.com/
2023-01-16 20:16:45 +01:00
SmallJoker
ecd6d61697 Revisit F6 statistics formatting (#13126) 2023-01-16 20:16:23 +01:00
Muhammad Rifqi Priyo Susanto
a2a280691c Fix Enter key after creating a new world (#12997)
Prevents Enter key or "double-click" event to play the world just after creating a new world
2023-01-16 20:16:08 +01:00
Jude Melton-Houghton
2f9f0c0900 Improve chat history (#12975) 2023-01-14 16:14:37 -05:00
sfan5
8fded9d990 Disable Prometheus in singleplayer mode 2023-01-14 13:11:15 +01:00
Jude Melton-Houghton
3992a13f24 Improve MetaDataRef:{get,set}_float precision (#13130) 2023-01-12 15:40:34 -05:00
Jude Melton-Houghton
5f2925c59c Increase ftos precision (#13141) 2023-01-12 14:12:31 -05:00
Jude Melton-Houghton
956026bb6b Break long lines of option help (#13136) 2023-01-12 14:12:05 -05:00
Jude Melton-Houghton
ab1fe80150 Error when string.split is given empty separator (#13132) 2023-01-10 09:25:48 -05:00
Wuzzy
a3177b89d8 DevTest: chest_of_everything mod: Add search, bag, improve formspec (#13064) 2023-01-09 21:40:41 +01:00
x2048
139db66901 Remove mapblock cache for mesh generation. (#13124)
Reduces memory consumption and improves performance
2023-01-09 21:40:08 +01:00
Jude Melton-Houghton
d69cb4fb5d Always set globals in __newindex (#13131) 2023-01-09 15:00:49 -05:00
ROllerozxa
d0b6f217ae Add option to exclude Development Test from release packages (#13081)
* `INSTALL_DEVTEST` is the option name
2023-01-09 20:34:13 +01:00
ROllerozxa
390b5caaaa Fix crash on Android with IrrlichtMt9 (#13123)
Caused by mouse control
2023-01-08 14:04:17 +01:00
iliekprogrammar
fb28ca463e Clamp player wieldindex when processing hotbar item selection (#13098) 2023-01-08 14:03:16 +01:00
lhofhansl
55804c56e9 Report collisionMoveSimple for client and server. (#13105) 2023-01-07 16:31:31 -08:00
David Leal
d82d18bfb1 Replace minetest_game with "Minetest Game" where appropriate 2023-01-07 12:58:16 +01:00
Desour
d603619ad3 Devtest: Add jukebox 2023-01-06 22:38:35 +01:00
Desour
4685849f89 Devtest: Rename soundstuff init.lua 2023-01-06 22:38:35 +01:00
Desour
07624125ef Devtest: Add branding iron
Allows giving names to objects.
2023-01-06 22:38:35 +01:00
ROllerozxa
bb74da5903 Remove old rollback migration code (#13082) 2023-01-06 22:35:20 +01:00
x2048
6d45c243f8 Add dynamic exposure correction (#12959)
* Add uniform for frame delta time
* Adjust exposure in logarithmic (EV) space
* Add network support and LUA API
* Add testing mod
2023-01-06 22:33:25 +01:00
x2048
2715cc8bf6 Occlusion culling algorithm based on recursive descend (#13104)
Co-authored-by: DS <vorunbekannt75@web.de>
2023-01-06 22:31:06 +01:00
sfan5
059f62d7d6 Use consistent optimization flags for *BSD
This was added for seemingly no reason in c410e9182d (2014)
2023-01-05 23:09:51 +01:00
Awkanimus
0dbb20fd63 Document mod storage psql settings in world_format.txt 2023-01-05 21:59:08 +01:00
sfan5
6377ce921d Bump used IrrlichtMt version 2022-12-31 12:48:53 +01:00
x2048
89e7f72c92 Use multiple threads for mesh generation (#13062)
Co-authored-by: sfan5 <sfan5@live.de>
2022-12-27 18:44:18 +01:00
SmallJoker
03e710160f Lua API: Document shader dependencies of set_lighting() (#13079) 2022-12-26 21:59:55 +01:00
lhofhansl
1e7804aaf6 Allow saturation to be controlled by the server. (#13075) 2022-12-25 16:15:32 -08:00
ROllerozxa
afd5caa26a Fully remove pageflip 3D mode (#13074) 2022-12-25 10:57:39 -05:00
ROllerozxa
7f01471141 Fix join game tab being slightly shorter than the others (#13073) 2022-12-25 10:57:21 -05:00
Jean-Patrick Guerrero
33363c2a7e Fix progress bar look on HiDPI displays (#13055) 2022-12-24 12:26:56 -05:00
Jude Melton-Houghton
d13b12b791 Store MapEditEvent blocks in a vector (#13071) 2022-12-24 12:21:59 -05:00
Jude Melton-Houghton
5c248c2d7d Add callback on_mapblocks_changed 2022-12-24 08:24:59 -05:00
Jude Melton-Houghton
7701e70dc9 Make MapEditEvent more complete
SetBlocksNotSent is no longer used.
2022-12-24 08:24:59 -05:00
ndren
62ee02b8ba Set and unset relative mouse mode where necessary (#12636)
* Set and unset relative mouse mode where necessary

Co-authored-by: sfan5 <sfan5@live.de>
2022-12-24 09:38:30 +01:00
Gregor Parzefall
475f85fc91 Document the gain of auto-selected dig sounds 2022-12-21 13:29:43 +01:00
Jude Melton-Houghton
0fc97a1483 Use a Lua error handler that calls tostring (#11913) 2022-12-15 07:37:49 -05:00
Jude Melton-Houghton
1f3b5e553b Fix plantlike_rooted world-aligned node base textures (#12994)
Co-authored-by: Wuzzy <Wuzzy@disroot.org>
2022-12-12 08:45:09 -05:00
updatepo.sh
981d79157a Update translation files 2022-12-10 15:38:30 +01:00
updatepo.sh
111d047b0a Update minetest.conf.example 2022-12-10 15:35:46 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
024c99fc47 Translated using Weblate (Malay)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
Артём Котлубай
219904dc54 Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
Emmily
0bff85f7b0 Translated using Weblate (Esperanto)
Currently translated at 88.2% (1290 of 1462 strings)
2022-12-10 15:30:43 +01:00
runs
b30e0681a0 Translated using Weblate (Galician)
Currently translated at 97.2% (1422 of 1462 strings)
2022-12-10 15:30:43 +01:00
Mikitko
8cba08d423 Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
waxtatect
6ae870b27d Translated using Weblate (Spanish)
Currently translated at 88.6% (1296 of 1462 strings)
2022-12-10 15:30:43 +01:00
Muhammad Rifqi Priyo Susanto
f004432ec2 Translated using Weblate (Indonesian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
Nicolae Crefelean
5cfe76bb60 Translated using Weblate (Romanian)
Currently translated at 46.5% (680 of 1462 strings)
2022-12-10 15:30:43 +01:00
LL Productions FR
866fbf9149 Translated using Weblate (Esperanto)
Currently translated at 87.8% (1285 of 1462 strings)
2022-12-10 15:30:43 +01:00
Tianshu Feng
8660f90868 Translated using Weblate (Chinese (Simplified))
Currently translated at 93.7% (1371 of 1462 strings)
2022-12-10 15:30:43 +01:00
Nyuh Nyash
569c83a8e7 Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
runs
4a1ca5e16c Translated using Weblate (Spanish)
Currently translated at 88.5% (1295 of 1462 strings)
2022-12-10 15:30:43 +01:00
Темак
49183e3555 Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
Kisjuhász Attila
1fb1a9e211 Translated using Weblate (Hungarian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
Wuzzy
f858bb9a75 Translated using Weblate (German)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:43 +01:00
Alex B
fbe97a1b08 Translated using Weblate (Italian)
Currently translated at 96.2% (1407 of 1462 strings)
2022-12-10 15:30:43 +01:00
Gao Tiesuan
d1055aa8d8 Translated using Weblate (Chinese (Simplified))
Currently translated at 91.5% (1339 of 1462 strings)
2022-12-10 15:30:43 +01:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
1dde03dfec Translated using Weblate (Malay (Jawi))
Currently translated at 61.1% (894 of 1462 strings)
2022-12-10 15:30:43 +01:00
Abdou-31
5240febeef Translated using Weblate (Arabic)
Currently translated at 38.6% (565 of 1462 strings)
2022-12-10 15:30:43 +01:00
109247019824
c6aea54497 Translated using Weblate (Bulgarian)
Currently translated at 29.5% (432 of 1462 strings)
2022-12-10 15:30:43 +01:00
tryvseu
15aac97790 Translated using Weblate (Norwegian Nynorsk)
Currently translated at 37.4% (547 of 1462 strings)
2022-12-10 15:30:43 +01:00
Bright Geyser
68493bd14a Translated using Weblate (Lithuanian)
Currently translated at 15.5% (228 of 1462 strings)
2022-12-10 15:30:43 +01:00
Ács Zoltán
41960c0019 Translated using Weblate (Hungarian)
Currently translated at 98.7% (1443 of 1462 strings)
2022-12-10 15:30:43 +01:00
Ritwik
eb6c88f8c0 Translated using Weblate (Hindi)
Currently translated at 29.7% (435 of 1462 strings)
2022-12-10 15:30:43 +01:00
Hraponssi
928b6d659c Translated using Weblate (Finnish)
Currently translated at 23.4% (343 of 1462 strings)
2022-12-10 15:30:43 +01:00
Jiri Grönroos
058bf1e6ec Translated using Weblate (Finnish)
Currently translated at 23.4% (343 of 1462 strings)
2022-12-10 15:30:43 +01:00
daudiffa
7e793438a3 Translated using Weblate (Indonesian)
Currently translated at 98.2% (1437 of 1462 strings)
2022-12-10 15:30:43 +01:00
Văn Chí
c476bc3772 Translated using Weblate (Vietnamese)
Currently translated at 42.2% (618 of 1462 strings)
2022-12-10 15:30:43 +01:00
Davide Giuliano
5a9982b7e0 Translated using Weblate (Italian)
Currently translated at 96.3% (1408 of 1462 strings)
2022-12-10 15:30:43 +01:00
Yic95
08279a7565 Translated using Weblate (Chinese (Traditional))
Currently translated at 75.5% (1104 of 1462 strings)
2022-12-10 15:30:43 +01:00
Simone Starace
baac5459c4 Translated using Weblate (Italian)
Currently translated at 95.2% (1393 of 1462 strings)
2022-12-10 15:30:43 +01:00
Pietro Cappuccino
4f77005614 Translated using Weblate (Italian)
Currently translated at 95.2% (1393 of 1462 strings)
2022-12-10 15:30:42 +01:00
Muhammad Rifqi Priyo Susanto
ee2d3bc293 Translated using Weblate (Indonesian)
Currently translated at 98.2% (1436 of 1462 strings)
2022-12-10 15:30:42 +01:00
ahdplayer
8797c5bea4 Translated using Weblate (Turkish)
Currently translated at 92.4% (1351 of 1462 strings)
2022-12-10 15:30:42 +01:00
Ian giestas pauli
9d6a2bda24 Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:42 +01:00
Giov4
1cdd690630 Translated using Weblate (Italian)
Currently translated at 93.6% (1369 of 1462 strings)
2022-12-10 15:30:42 +01:00
Batkhuyag Bavuudorj
692163275d Translated using Weblate (Mongolian)
Currently translated at 2.3% (35 of 1462 strings)
2022-12-10 15:30:42 +01:00
Andrei Stepanov
042c7490ed Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:42 +01:00
Kauã Maia
c1aed7b4d3 Translated using Weblate (Portuguese)
Currently translated at 98.4% (1439 of 1462 strings)
2022-12-10 15:30:42 +01:00
marcin
bebf1d1f3e Translated using Weblate (Polish)
Currently translated at 80.6% (1179 of 1462 strings)
2022-12-10 15:30:42 +01:00
Adam Jagoda
db7151be53 Translated using Weblate (Polish)
Currently translated at 80.6% (1179 of 1462 strings)
2022-12-10 15:30:42 +01:00
Темак
e160505595 Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:42 +01:00
Andrei Stepanov
9bfbe80d06 Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:42 +01:00
Темак
4159b2860f Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:42 +01:00
Andrei Stepanov
c86adf87ae Translated using Weblate (Russian)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:42 +01:00
Batkhuyag Bavuudorj
fb738ae85a Added translation using Weblate (Mongolian) 2022-12-10 15:30:42 +01:00
Walter Bulbazor
0aae94ba7e Translated using Weblate (Occitan)
Currently translated at 14.3% (210 of 1462 strings)
2022-12-10 15:30:42 +01:00
Conight
73c8e1f03a Translated using Weblate (Chinese (Simplified))
Currently translated at 91.4% (1337 of 1462 strings)
2022-12-10 15:30:42 +01:00
Темак
3cd99d8e6d Translated using Weblate (Russian)
Currently translated at 96.1% (1405 of 1462 strings)
2022-12-10 15:30:42 +01:00
Hugo Carvalho
3e6098f5c6 Translated using Weblate (Portuguese)
Currently translated at 97.7% (1429 of 1462 strings)
2022-12-10 15:30:42 +01:00
Artur Adamczyk
56fc164fdd Translated using Weblate (Polish)
Currently translated at 77.5% (1134 of 1462 strings)
2022-12-10 15:30:42 +01:00
Andrés Morgensen
8f881b04f4 Translated using Weblate (Spanish)
Currently translated at 88.3% (1291 of 1462 strings)
2022-12-10 15:30:42 +01:00
Valentino
80c9c66e16 Translated using Weblate (Spanish)
Currently translated at 88.3% (1291 of 1462 strings)
2022-12-10 15:30:42 +01:00
waxtatect
5d68026c2d Translated using Weblate (Spanish)
Currently translated at 88.3% (1291 of 1462 strings)
2022-12-10 15:30:42 +01:00
waxtatect
ed8dce4e72 Translated using Weblate (French)
Currently translated at 100.0% (1462 of 1462 strings)
2022-12-10 15:30:42 +01:00
Adam Jagoda
af8151d827 Translated using Weblate (Polish)
Currently translated at 76.2% (1115 of 1462 strings)
2022-12-10 15:30:42 +01:00
Jude Melton-Houghton
c18c082059 Prevent air acceleration with 0 jump speed (#13036) 2022-12-10 09:08:50 -05:00
Jude Melton-Houghton
1798ad0ec4 Avoid out-of-bounds memory access in attached node placement prediction (#13038) 2022-12-10 09:00:27 -05:00
sfan5
504e43e0da Remove Irrlicht documentation URL from key settings (#13010) 2022-12-04 12:35:28 +01:00
sfan5
37386b9c3c Expose dtime_s to LBM handler 2022-12-04 12:35:14 +01:00
Tamara Schmitz
aa3505a9e4 Add missing optional dependencies to Container Image (#12914) 2022-12-04 12:35:03 +01:00
Jude Melton-Houghton
b85831e389 Fix startup after removing last game (#13015) 2022-12-03 11:35:38 -05:00
Jude Melton-Houghton
291c42ed57 Let mods choose a forceload limit (#13002) 2022-12-03 10:41:45 -05:00
Jude Melton-Houghton
f80ea73bfb Let mods choose a forceload limit (#13002) 2022-12-03 10:41:34 -05:00
Jude Melton-Houghton
b3ffc4b327 Add minetest.get_mapgen_edges (#12999) 2022-12-03 10:40:46 -05:00
lhofhansl
e84d259ec7 Remove shader caching hack. (#12991) 2022-11-30 13:56:14 -08:00
Muhammad Rifqi Priyo Susanto
281f9a9f88 Android: Segmentation fault fix, PendingIntent flag, and other fixes (#12960)
* Android: Segmentation fault fix, PendingIntent flag, and other fixes

- Information about the crosshair is sent after camera initialization.
- Since API 31, PendingIntent requires mutability flag.
- super (class) is called in onRequestPermissionsResult().
- GameActivity suppresses "unused" warning since most of its methods are called from native code.
- Non-null safety is added for nullable function calls.
- Warning/error logging is added for various function calls' return value.

* Move utility functions into Utils.java

- Some nullable functions are changed to be non-null functions.
- Some null checking outside it is removed.
- More annotations are added to functions and parameters.
2022-11-30 10:50:06 -05:00
Jude Melton-Houghton
055fc69c11 Handle num lock in chat (#12984) 2022-11-30 10:43:12 -05:00
Jude Melton-Houghton
3ff8adf599 Avoid resetting music when dialog opens (#13003) 2022-11-30 10:42:30 -05:00
Jude Melton-Houghton
da4a4086cf Fix /help privs checks (#13008) 2022-11-29 18:25:47 -05:00
Jude Melton-Houghton
aac1635bf7 Have minetest.debug call tostring (#13004) 2022-11-29 07:12:08 -05:00
Jude Melton-Houghton
38169db765 Wrap debug text on screen (#12978) 2022-11-28 12:17:36 -05:00
Jude Melton-Houghton
d0a118f5b1 Add minetest.get_game_info and allow reading game.conf (#12989)
Co-authored-by: sfan5 <sfan5@live.de>
2022-11-28 07:21:43 -05:00
Jude Melton-Houghton
3fd5bff128 Abort active ABM iteration when content changes (#12998) 2022-11-27 15:55:10 -05:00
Muhammad Rifqi Priyo Susanto
40a45b8c99 Virtual joystick: Use s32 when using m_screensize as a subtrahend (#12814)
If still uses u32, m_screensize will yield a big value (underflow) when used as a subtrahend.
ETIE_MOVED is allowed to be run if joystick's ID is available and virtual joystick is fixed.
Add .0f for some float values.
2022-11-26 09:16:14 -05:00
savilli
f04d4d0291 Fix touchscreen crash due to missing rangeselect 2022-11-25 19:57:03 +01:00
Jude Melton-Houghton
8b26bab37d Remove unnecessary bool return types 2022-11-24 17:58:25 -05:00
Jude Melton-Houghton
7c21347a40 Rename "mod metadata" to "mod storage" everywhere 2022-11-24 17:58:25 -05:00
Jude Melton-Houghton
8817af07fb Deprecate special handling of ${key} syntax in metadata values (#12970) 2022-11-24 17:56:43 -05:00
Wuzzy
3c7f26d937 Add support for attached facedir/4dir nodes (#11432) 2022-11-24 17:56:07 -05:00
x2048
1c10988d6a Fix entity visiblity in bright artificial light (#12906) 2022-11-23 22:40:26 +01:00
Jude Melton-Houghton
9527cc3fa0 avoid clearChildAttachments iterator invalidation (#12987) 2022-11-23 14:48:12 -05:00
Jude Melton-Houghton
386bfcda2b Fix reading schematics after their resolution (#12985) 2022-11-23 11:53:21 -05:00
Jude Melton-Houghton
4da8a18c8c Check specific outputs for isatty (#12980) 2022-11-21 12:08:40 -05:00
x2048
70a82b0784 Avoid shadow flicker at certain angles (#12961)
Change the way look direction and camera position are quantized when calculating light frustum
2022-11-20 21:28:01 +01:00
DS
5f24a3c0c7 Object selection: Improve distance checks (#12974) 2022-11-20 21:27:47 +01:00
Jude Melton-Houghton
475005012a Improve ABM and LBM registration error handling (#12969) 2022-11-20 21:26:54 +01:00
lhofhansl
7bf64fc61a Add configurable saturation (#12865)
* Add configurable saturation

Co-authored-by: Pevernow <3450354617@qq.com>
Co-authored-by: x2048 <codeforsmile@gmail.com>

Author:    Lars <larsh@apache.org>
2022-11-18 11:49:52 -08:00
Abdou-31
dac05a500e Fix menu_lua_api.txt formatting (#12971) 2022-11-18 11:45:16 -05:00
Jude Melton-Houghton
b89eb605b7 Warn about potential infinite loop in on_construct (#12967)
Co-authored-by: sfan5 <sfan5@live.de>
2022-11-16 13:11:36 -05:00
StrajnarFilip
6b6cd42ce4 Added copy of LGPL-2.1 (#12950) 2022-11-16 13:09:53 -05:00
Riceball LEE
6bf662cb9e set_nametag_attributes: don't reset nametags if text param is not touched
fixes #12901
2022-11-15 16:46:26 +01:00
SmallJoker
8de9e2ac84 game.conf: Add setting to use volatile a map backend (#12956) 2022-11-15 16:45:48 +01:00
Jude Melton-Houghton
cd8a7fe472 Add MetaDataRef:get_keys (#12841) 2022-11-15 16:45:12 +01:00
lhofhansl
1a045da0dd Reduce active mgmt interval for a bit when a player joins. (#12925) 2022-11-10 15:25:38 -08:00
Jude Melton-Houghton
00eb65915f Add PostgreSQL helper pg_to_string 2022-11-10 18:56:48 +01:00
Jude Melton-Houghton
f8c781b46c Test PostgreSQL in CI 2022-11-10 18:56:48 +01:00
Jude Melton-Houghton
aaa05f901a Add mod storage PostgreSQL backend 2022-11-10 18:56:48 +01:00
Jude Melton-Houghton
9dbac989bd Improve testListMods 2022-11-10 18:56:48 +01:00
Jude Melton-Houghton
408af9d17d Test metadata value changing 2022-11-10 18:56:48 +01:00
Gregor Parzefall
88b04eadc9 Fix get_tool_wear_after_use for one use (insta-break) (#12945) 2022-11-09 11:58:53 -05:00
olive
042f7917e7 Flip player_back.png (#12940) 2022-11-09 11:58:21 -05:00
x2048
81bfc9c7a2 Resize hotbar immediately before drawing (#12930) 2022-11-09 11:57:55 -05:00
Abdou-31
d1b80b462e Fix typos and en_US/en_GB inconsistency in various files (#12902) 2022-11-09 11:57:19 -05:00
Tamara Schmitz
6191bafcad Dockerfile: refactoring and addition of entrypoint (#12939)
Previously source files were copied first, then build dependencies were
installed, then libraries cloned and built.
This was reordered to be:
1. install dependencies
2. clone and build libraries
3. Pull in minetest source and minetest_game
4. Build minetest

In addition the peristent volumes are now declared.
Also an entrypoint added making it possible to append command line
parameters.
2022-11-08 16:34:58 +01:00
Loïc Blot
322c8cf270 Reduce exposure of various internals (#12885)
* refactoring(StaticObjectList): don't expose m_active and m_stored anymore

This prevents our old crap code where anyone can access to StaticObjectList. use proper modifiers. It also permits to do a short cleanup on MapBlock using a helper

* refactoring(MapBlock): reduce a bit exposed m_active_blocks variable

* refactoring: MapBlock::m_node_timers is now private

We already had various helpers to perform this privatization, just use it. Also factorize the MapBlock stepping code for timers using already existing code and importing them from ServerEnvironment to MapBlock.

It's currently done pretty straight forward without any inheritance as MapBlock is just used everywhere, maybe in a future we'll have ServerMapBlock over MapBlock. Currently for a simple function let's just use proper objects and add a comment warning

* refactoring(Server): fix duplicated function for add/remove node

* refactoring(guiFormSpecMenu): add removeAll function to prevent duplicated code

* refactoring(ShadowRenderer) + perf: code quality  + increase performance

* All callers are already using the point and we should never test a function with nullptr node, it's a bug. Removed workaround which was hacky and fix the bug
* Drop clientmap lookup from shadowrendered, just use directly its
  pointer and forbid to push it in the generic list
* Reduce memory pressure on the renderShadowObject by preventing
  deallocating and reallocating multiple vectors on each node

* refactoring(MapBlock): reduce exposure of MapBlock::m_static_objects

It's not complete as some parts of the code are pretty nested, but it's better than before :)

* fix: better working on new functions & drop unwanted 2 lines

Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>

Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
2022-11-03 17:35:31 +01:00
x2048
957a3e52fe Return correct variable when debugging bloom.
Fixes #12922
2022-11-03 08:43:31 +01:00
x2048
9b24041394 Improve bloom effect (#12916)
* Remove the built-in exposure factor of 2.5
* Add physics-based bloom (https://learnopengl.com/Guest-Articles/2022/Phys.-Based-Bloom)
* Add luminance scaling for bloom layer to simulate HDR
* Add setting to control bloom strength
2022-11-02 09:09:48 +01:00
Muhammad Rifqi Priyo Susanto
fb3085a2c5 Android: Increase target/compiled SDK version to 32 (#12911)
Build Tools, NDK, and Gradle are also updated.
Repositories is changed from jcenter() to mavenCentral().
2022-10-31 14:19:30 +01:00
Muhammad Rifqi Priyo Susanto
987277de52 Send crosshair setting after the touch screen GUI has been initialized (#12910) 2022-10-31 14:17:50 +01:00
Lars Mueller
88af36dd10 Fix node placement regression 2022-10-31 14:17:28 +01:00
x2048
260de1c2b5 Enable negative values for sun/moon orbit tilt (Northern hemisphere) (#12904) 2022-10-30 16:54:06 +01:00
x2048
485b3b1203 Add comments explaining use of entity glow 2022-10-30 16:53:45 +01:00
x2048
bf1cc1bb84 Apply entity glow before translating to color space 2022-10-30 16:53:45 +01:00
x2048
3e7ee499d6 Always add increment when getting node interior light 2022-10-30 16:53:45 +01:00
x2048
a075d83752 Use the same light level for non-solid draw types as for solid 2022-10-30 16:53:45 +01:00
DS
fcd670e6f7 Add a worlds_here.txt file in the worlds folder and update .gitignore (#12720) 2022-10-30 16:53:31 +01:00
Lars Müller
077627181e Allow rotating entity selectionboxes (#12379) 2022-10-30 16:53:14 +01:00
lhofhansl
b829231992 Fix incorrect culling introduced by ##12710 (#12887) 2022-10-28 09:52:54 -07:00
lhofhansl
9aaed75eea Safety check the map's blocksize (#12895) 2022-10-27 19:31:42 -07:00
x2048
88820cd31c Shadow list improvements (#12898)
* Remove redundant checks when attaching SM texture to entities.
  Some of the checks were broken, leading to crashes when shadow intensity is set to 0
* Avoid memory leak in shadow casters list when wield mesh changes item stacks
2022-10-26 22:26:09 +02:00
Jean-Patrick Guerrero
16266397ed GUIInventoryList: Keep item size while moving (#12896) 2022-10-24 13:58:56 +02:00
Wuzzy
02c293ec63 Fix some outdated stuff about falling node docs 2022-10-23 21:59:24 +02:00
Jude Melton-Houghton
e86d23daed Check sizeof(int) and sizeof(size_t) 2022-10-23 21:59:12 +02:00
Wuzzy
0a82cb4072 DevTest: Colorize 2 nodebox nodes 2022-10-23 21:58:56 +02:00
Wuzzy
7a8ac00f9c DevTest: Cleanup callback logging 2022-10-23 21:58:56 +02:00
Wuzzy
9e186a42bd DevTest: Fix rendering of 2 texture test nodes 2022-10-23 21:58:56 +02:00
Wuzzy
c73d79841c DevTest: More node textures to tell them apart 2022-10-23 21:58:56 +02:00
Wuzzy
11d1a9cc37 DevTest: Use 4dir for chests 2022-10-23 21:58:56 +02:00
Wuzzy
9f11753930 DevTest: Restore callback item descriptions 2022-10-23 21:58:56 +02:00
Wuzzy
fd1930142e DevTest: Fix callback item textures 2022-10-23 21:58:56 +02:00
Wuzzy
a852ebe993 Remove credits for 2 images no longer in use 2022-10-23 21:58:56 +02:00
Wuzzy
0152d39215 DevTest: Refactor testhud features 2022-10-23 21:58:56 +02:00
Wuzzy
c761aa268d DevTest: Move 2 HUD commands to testhud & improve 2022-10-23 21:58:56 +02:00
Wuzzy
72b83acadc DevTest: No use privatizer on chest of everything 2022-10-23 21:58:56 +02:00
Wuzzy
998e50725c DevTest: Remove experimental mod 2022-10-23 21:58:56 +02:00
Wuzzy
a23701b5e6 DevTest: Move detached inv tests to chest mod 2022-10-23 21:58:56 +02:00
Wuzzy
c1e732448c DevTest: /test_place_node skips dummy/cb nodes 2022-10-23 21:58:56 +02:00
Wuzzy
23ef0d0916 DevTest: Clean up callback textures 2022-10-23 21:58:56 +02:00
Wuzzy
2da92ed81e DevTest: Move callback entities to callbacks mod 2022-10-23 21:58:56 +02:00
Wuzzy
cb7b96fc90 DevTest: Move callback items to callbacks mod 2022-10-23 21:58:56 +02:00
Wuzzy
68df0fb2ea DevTest: Move experimental items to other mods 2022-10-23 21:58:56 +02:00
Wuzzy
3a7fffc587 DevTest: Move more logging to log mod 2022-10-23 21:58:56 +02:00
Wuzzy
48530ccbc0 DevTest: Move benchmark commands to new mod 2022-10-23 21:58:56 +02:00
Wuzzy
6b9984b7e7 DevTest: Move /test_place_nodes to testnodes mod 2022-10-23 21:58:56 +02:00
Wuzzy
97a80b4816 DevTest: Move chat command logging to separate mod 2022-10-23 21:58:56 +02:00
Jude Melton-Houghton
8f1593e4e8 Add VoxelArea() constructor (#12886) 2022-10-22 08:05:45 -04:00
Abdou-31
7e11b8eb72 Fix typos and en_US/en_GB inconsistency in files inside doc directory (#12882) 2022-10-21 17:12:39 +02:00
Jude Melton-Houghton
c78d565e01 Fix use of unassigned global "check" 2022-10-21 17:12:21 +02:00
Riceball LEE
8bdedd2bcf guiChatConsole: fix the unicode characters crowded together on prompt (#12867)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2022-10-21 17:12:07 +02:00
DS
7153cb8a0b Fix formspec focus (#12795) 2022-10-21 17:11:41 +02:00
sfan5
9f0d88407d Revise bump_version.sh script to address shortcomings (#12789) 2022-10-21 17:09:44 +02:00
Jude Melton-Houghton
dafdb3edb4 Check for falling float nodes in liquid transform (#12862) 2022-10-18 18:03:05 -04:00
Jude Melton-Houghton
b38ffdec27 Implement vector and node conversion in Lua (#12609)
Co-authored-by: sfan5 <sfan5@live.de>
2022-10-18 18:01:44 -04:00
sfan5
23e9f5db43 Fix list sorting behaviour with missing geoip 2022-10-17 20:16:39 +02:00
Abdou-31
862419c76f Fix en_US/en_GB inconsistency in lua_api.txt 2022-10-17 07:56:52 -04:00
Abdou-31
4586f3342f Fix typos in lua_api.txt 2022-10-17 07:56:52 -04:00
sfan5
87051fca26 Take geographic distance into account for server list ordering (#12790) 2022-10-17 07:56:28 -04:00
SmallJoker
5d8a4917c5 LocalPlayer: Fix sneaking on nodes with large collisionboxes (#12626) 2022-10-17 07:56:04 -04:00
sfan5
25c5400250 Exclude MSVC from new Lua sanity check 2022-10-15 12:02:02 +02:00
sfan5
f680d10259 Other minor CMake improvements 2022-10-13 23:02:11 +02:00
sfan5
e8ee4cb40d Defer searching for libintl to CMake
resolves #12800
2022-10-13 23:02:11 +02:00
sfan5
af38bae57f Get rid of LuaJIT linking workarounds
...and replace them with a cautionary warning message if someone uses an old version.
The detection is kind of a hack but no choice as upstream is not interested in version numbering.
2022-10-13 23:02:11 +02:00
sfan5
558cbd89fb Add extra check in case someone tries to unbundle Lua 2022-10-13 23:02:11 +02:00
Jude Melton-Houghton
cb725a4555 Speed up find_nodes_in_area (#12845) 2022-10-13 09:35:19 -04:00
fluxionary
6b6f886bcd object ids are u16, not s16 (#12848) 2022-10-13 08:46:48 -04:00
Jude Melton-Houghton
f7ae70c3d9 Use enum to define custom registry indices 2022-10-13 08:46:16 -04:00
Jude Melton-Houghton
f073e37d2f Test on-lighting node param1 in lighting test 2022-10-13 08:46:16 -04:00
Jude Melton-Houghton
b3503e7853 Embed data directly in mapblocks 2022-10-09 13:43:48 -04:00
Jude Melton-Houghton
8f996e4a7c Remove unused MapBlock functionality 2022-10-09 13:43:48 -04:00
sfan5
7a28f2c4fa Fix tone mapping being always enabled
broke in 579fc93c24
2022-10-09 19:11:04 +02:00
Jude Melton-Houghton
9676364c1f Optimize lighting calculation (#12797) 2022-10-09 10:50:26 -04:00
fluxionary
440d966b93 add an 'equals' method to ItemStack and compatibility w/ lua '==' (#12771)
Co-authored-by: rubenwardy <rw@rubenwardy.com>
Co-authored-by: sfan5 <sfan5@live.de>
2022-10-09 08:06:09 -04:00
Wuzzy
b2a3f53b29 Improve documentation for liquid_alternative_* (#12810) 2022-10-09 08:05:40 -04:00
Wuzzy
c1c68775b2 DevTest: Explain purpose of most items in tooltips (#12833) 2022-10-09 08:05:22 -04:00
Wuzzy
804a318189 DevTest: Change texture for node-aligned node (#12831) 2022-10-06 17:25:40 +01:00
ROllerozxa
be5c675263 Only set quicktune keybinds in debug builds (#12779) 2022-10-06 17:07:57 +01:00
x2048
1e96403954 Use legacy call when rendering to a single texture
Fixes depth buffer in when undersampling > 1
2022-10-04 21:02:42 +02:00
x2048
579fc93c24 Make bloom shaders compatible with GLES2 (#12834)
Co-authored-by: Muhammad Rifqi Priyo Susanto <muhammadrifqipriyosusanto@gmail.com>
2022-10-04 13:52:56 +01:00
Jude Melton-Houghton
7632af3c73 Consolidate API object code (#12728)
Co-authored-by: sfan5 <sfan5@live.de>
2022-10-04 08:31:36 -04:00
Jude Melton-Houghton
b21fb18379 Disable -ffinite-math-only (#12832) 2022-10-03 12:13:35 -04:00
Wuzzy
b10d6542db DevTest: Reject buggy "/hp inf" command (#12830) 2022-10-03 12:13:23 -04:00
DS
22cbc05808 Add an item pick up callback (2) (#7712)
Co-authored-by: SmallJoker <mk939@ymail.com>
Co-authored-by: Jude Melton-Houghton <jwmhjwmh@gmail.com>
2022-10-01 15:21:06 -04:00
Wuzzy
977f656e09 Improve crafting recipe documentation (#12806) 2022-10-01 15:20:28 -04:00
sfan5
525fc3833c Implement tool use sounds 2022-09-30 14:02:14 +02:00
sfan5
bbdb1929c6 Clean up Game::handleDigging() and some related parts 2022-09-30 14:02:14 +02:00
Muhammad Rifqi Priyo Susanto
13a8948edd Improve double tap for jump detection (#12793) 2022-09-30 14:02:06 +02:00
Jude Melton-Houghton
e832cee1e6 Avert collision static detection rounding error (#12822) 2022-09-30 06:31:24 -04:00
Wuzzy
6eb7d57ed3 Fix inconsistent craft replacements (#9250) (#12819) 2022-09-30 06:30:39 -04:00
Wuzzy
5e7ea0664a Fix error msg if craft replacement w/ full inv (#12820) 2022-09-29 20:34:51 +02:00
x2048
9df79a4b2d Bloom (#12791)
Adds configurable light exposure control and bloom effect (light bleeding) with client-side settings.
2022-09-29 20:34:05 +02:00
Muhammad Rifqi Priyo Susanto
3978b9b8ed Add crosshair support for Android (#7865)
If enabled, a crosshair will be shown to select object.
This will give Android players a way to play like they play on desktop.
On third-person back camera mode, player is forced to use crosshair.
On third-person front camera mode, player is unable to select anything.

Co-authored-by: ROllerozxa <temporaryemail4meh+github@gmail.com>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2022-09-29 20:30:33 +02:00
20kdc
b1233056b7 Add zstd compression support (#12515) 2022-09-28 09:06:14 -04:00
DS
0251b01da6 Pause shader animation timer in singleplayer pause menu (#12766)
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-27 16:23:07 -04:00
pecksin
6ac38aa2c8 Restore and enhance bouncy behavior (#11939) 2022-09-27 16:22:36 -04:00
savilli
907dcdcf7b Add unittests for item movement code (#11885) 2022-09-27 16:22:11 -04:00
Wuzzy
3f801bc096 Fix liquid drawtype faces sometimes not rendering (#12807)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2022-09-26 19:27:47 -04:00
Jude Melton-Houghton
f4a01f3a5d Avoid duplication of mod metadata in memory (#12562)
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-26 17:03:43 -04:00
Jude Melton-Houghton
03428d9825 Modify PUC Lua to wrap C++ exceptions (#12445) 2022-09-26 07:23:48 -04:00
Jude Melton-Houghton
f916398a54 Add lighting test and benchmark (#12802) 2022-09-26 06:49:08 -04:00
Lars Mueller
8dec3a5ecb Fix double escape in update checker dialog 2022-09-25 13:45:37 +02:00
Tobias Frost
7069d99aa6 Fix two spelling mistakes
Co-authored-by: Tobias Frost <tobi@debian.org>
2022-09-25 13:45:27 +02:00
Aritz Erkiaga
5ced5c9b27 Briefly explain how facedir rotations work (#11934) 2022-09-25 13:45:02 +02:00
Lars Müller
1317cd12d7 Fix formula used for acceleration (#12353) 2022-09-20 10:55:51 +02:00
DS
11905a6db6 Rename a variable in localplayer.h, resolves a TODO 2022-09-20 10:55:11 +02:00
ndren
2c3f641e0b Simplify bit flip in sha1.cpp 2022-09-20 10:54:35 +02:00
sfan5
587f6656a4 Bump version to 5.6.1 2022-09-19 21:05:10 +02:00
Wuzzy
9acf2d3db7 Document minetest.parse_relative_number (#12576) 2022-09-18 18:38:55 +02:00
Jude Melton-Houghton
310b12b5ed Content ID caching in Lua (#12444)
* Cache content IDs in Lua

Co-authored-by: sfan5 <sfan5@live.de>
2022-09-18 17:46:48 +02:00
Jude Melton-Houghton
006d974c58 Catch exceptions in SQLite3 callback 2022-09-18 17:39:09 +02:00
Jude Melton-Houghton
b89608c624 Compile bitop library as C++ 2022-09-18 17:39:09 +02:00
Jude Melton-Houghton
6f5a68b7f7 Allow getmetatable in CSM (#12776) 2022-09-18 17:32:18 +02:00
DS
c9ed059d91 Client map: do frustum culling via planes (#12710) 2022-09-18 15:28:53 +02:00
sfan5
4377c03168 Bump used IrrlichtMt version 2022-09-16 20:27:29 +02:00
sfan5
a428a0cf37 Bump used IrrlichtMt version 2022-09-16 19:54:59 +02:00
savilli
1e0520074c Fix UAF in craft recipes (#12763)
If you call minetest.clear_craft after minetest.register_alias_force, the craft definition reference may not be removed from m_output_craft_definitions leading to UAF.
2022-09-16 19:18:51 +02:00
savilli
9428917870 Fix UAF in craft recipes (#12763)
If you call minetest.clear_craft after minetest.register_alias_force, the craft definition reference may not be removed from m_output_craft_definitions leading to UAF.
2022-09-16 13:20:14 +02:00
William Breathitt Gray
19e936362a Add support for MINETEST_USERDATA environment variable (#12639)
The MINETEST_USER_PATH environment variable can be used to define a
custom path for Minetest user data. If MINETEST_USER_PATH is empty or
unset, the HOME (or APPDATA on Windows) environment variable is used as
the default user data path; this ensures backwards compatibility with
existing user setups.
2022-09-16 13:19:44 +02:00
Wuzzy
1d04903c19 Add paramtype2s for 4 horizontal rotations and 64 colors (#11431)
4dir is like facedir, but only for 4 horizontal directions: NESW. It is identical in behavior to facedir otherwise. The reason why game makers would want to use this over facedir is 1) simplicity and 2) you get 6 free bits.
It can be used for things like chests and furnaces and you don't need or want them to "flip them on the side" (like you could with facedir).

color4dir is like colorfacedir, but you get 64 colors instead of only 8.
2022-09-16 13:18:55 +02:00
SmallJoker
b5e7280708 Content tab: Fix content download broken by bc3dccc 2022-09-16 13:01:23 +02:00
DS
b9f6832347 Fix tooltips for dropdown, scrollbar and more (#12747) 2022-09-14 13:48:06 +02:00
Jude Melton-Houghton
f8bb0cd3d1 Fix potential use-after-free with item metadata (#12729)
This fixes a use-after-free bug in the case where itemstack metadata is accessed after the itemstack has been garbage-collected.
2022-09-14 13:48:06 +02:00
Lars Mueller
129aef758e Serialize: Restore forward compatibility 2022-09-14 13:48:06 +02:00
Lars Mueller
94f55cf406 Serialize: Use numbers for refs to work around LuaJIT limits 2022-09-14 13:48:06 +02:00
sfan5
a20b758e19 Allow looped animation to be used safely with old clients
fixes #12657
2022-09-14 13:48:06 +02:00
pecksin
128842becf Chat weblink: remove comma as delimiter (#12730) 2022-09-14 13:48:06 +02:00
x2048
d51331f51f Convert entity glow value to color space before adding to the light 2022-09-14 13:48:06 +02:00
Niklp
4ef221a645 Fix incorrectly placed label in tab_online (#12732) 2022-09-14 13:48:06 +02:00
savilli
79010e972e Fix and enable x86 build for Android (#12700) 2022-09-14 13:48:06 +02:00
fluxionary
0ca530e251 Fix texture_min_size 2022-09-14 13:48:06 +02:00
Elliott Lester
57b4d46dbc Apply DPI Scaling to GUIModalMenu (#12693)
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-14 13:48:06 +02:00
rubenwardy
50df5e2f59 Fix crash when trying to overwrite a package
Before #11646, core.copy_dir would overwrite the target if it exists. Adding core.delete_dir restores the exact same behaviour

Fixes #12303
2022-09-14 13:48:06 +02:00
Fábio Rodrigues Ribeiro
b6db2c7262 Remove resolution of appstream screenshots (#12652)
resolves Appdata not valid #12597
2022-09-14 13:48:06 +02:00
sfan5
9441b69ad2 Move some CI jobs to newer compiler versions 2022-09-14 13:48:06 +02:00
x2048
08e3d16a58 Limit force shadow update to urgent blocks (#12692) 2022-09-14 13:48:06 +02:00
Lars Müller
3f3049fdba Check hp_max > 0 for entities (#12667) 2022-09-14 13:39:30 +02:00
Zughy
41fb7a8a7e Reassure previous nil behaviour for tiles and special_tiles (#12678)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2022-09-14 13:39:20 +02:00
Zughy
5b9828e094 Fix crash when crafting callbacks return strings (#12685)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2022-09-14 13:37:54 +02:00
Zughy
96e35585b0 Fix crash when stars are reset 2022-09-14 13:37:44 +02:00
DS
f3f3b752f2 Fix tooltips for dropdown, scrollbar and more (#12747) 2022-09-13 12:48:28 +01:00
SmallJoker
cea5fd56a4 Content tab: Change uninstall icon to trash bin (#12761)
A red cross might indicate 'cancel download' whereas the trash bin is generally a symbol for deletion.
2022-09-12 19:25:34 +02:00
wsor4035
482cc99b2c Fix trivial get_armor_groups documentation issue (#12760) 2022-09-12 19:25:25 +02:00
SmallJoker
bc3dccca5c Mainmenu: Properly sort mods and games (#12758)
This also removes trivial and unused pkgmgr functions
Fixes a bug caused by sorting in 2133fc8
2022-09-12 19:24:54 +02:00
Jude Melton-Houghton
fe13f9dfd1 Fix potential use-after-free with item metadata (#12729)
This fixes a use-after-free bug in the case where itemstack metadata is accessed after the itemstack has been garbage-collected.
2022-09-11 19:28:37 +02:00
Lars Mueller
7486f184c3 Serialize: Restore forward compatibility 2022-09-11 19:27:18 +02:00
Lars Mueller
6c24dc4e23 Serialize: Use numbers for refs to work around LuaJIT limits 2022-09-11 19:27:02 +02:00
sfan5
c607bee19e Allow looped animation to be used safely with old clients
fixes #12657
2022-09-10 12:21:29 +02:00
pecksin
adb03ccc6d Chat weblink: remove comma as delimiter (#12730) 2022-09-10 12:21:15 +02:00
ROllerozxa
2133fc84c4 Fix texture pack sorting in content tab (#12727)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2022-09-10 12:20:33 +02:00
DS
643971c948 Add documentation of sun/moon orientation/scale differences (#12145) 2022-09-06 11:21:55 +01:00
Herman Semenov
038da00e79 Code optimizations / refactor (#12704)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-06 11:21:09 +01:00
x2048
ff6dcfea82 Implement rendering pipeline and post-processing (#12465)
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: lhofhansl <lhofhansl@yahoo.com>
2022-09-06 08:25:18 +02:00
x2048
464043b8ab Convert entity glow value to color space before adding to the light 2022-09-04 16:00:13 +02:00
Niklp
2854c19792 Fix incorrectly placed label in tab_online (#12732) 2022-09-02 01:05:40 +01:00
savilli
75d88dcae2 Fix and enable x86 build for Android (#12700) 2022-08-25 22:48:49 +01:00
fluxionary
0ab9bf926d Fix texture_min_size 2022-08-24 22:38:14 +02:00
rubenwardy
2d10fa7867 Prevent loading a world with unresolved dependencies (#12542) 2022-08-19 12:31:36 +01:00
x2048
8c29c4f620 Use Sky class to obtain directional light source position for shadows (#12662)
* Also remove unused Sky::getSkyBodyOrbitTilt method

Fixes misalignment of sun position and shadow direction at high tilt values.
2022-08-17 16:30:05 +02:00
celeron55
3f67215df9 Log sockets into tracestream instead of dstream (#12701) 2022-08-16 15:18:11 +01:00
rubenwardy
c4ffe630f1 Add package title to ContentDB error messages (#12705) 2022-08-16 13:46:11 +01:00
Elliott Lester
7c5e3cac6a Apply DPI Scaling to GUIModalMenu (#12693)
Co-authored-by: sfan5 <sfan5@live.de>
2022-08-15 21:19:47 +01:00
rubenwardy
adc89f7977 Add unit tests for pkgmgr.install_dir 2022-08-15 21:19:24 +01:00
rubenwardy
db612c10ee Refactor pkgmgr.install_dir to simplify logic 2022-08-15 21:19:24 +01:00
rubenwardy
0090446ccf Fix crash when trying to overwrite a package
Before #11646, core.copy_dir would overwrite the target if it exists. Adding core.delete_dir restores the exact same behaviour

Fixes #12303
2022-08-15 21:19:24 +01:00
sfan5
cae7ec1eb4 Cut back on Gitlab-ci & misc pipeline updates 2022-08-15 10:47:47 +02:00
Fábio Rodrigues Ribeiro
bce1078ced Remove resolution of appstream screenshots (#12652)
resolves Appdata not valid #12597
2022-08-15 10:47:09 +02:00
x2048
aa2fdc6ef6 Limit force shadow update to urgent blocks (#12692) 2022-08-14 20:29:20 +02:00
Lion
2690585e99 Add handling of environment variables to control terminal/logging colors (#12641) 2022-08-14 20:27:28 +02:00
Zughy
760242c076 Docs: add "flip moon texture" into breakage file (#12417) 2022-08-14 20:25:52 +02:00
sfan5
c7059c4981 Move some CI jobs to newer compiler versions 2022-08-14 00:18:15 +02:00
x2048
d1cbb4bd8a Reduce the use of porting::getTimeMs() when rendering frames (#12679)
* Avoid calling TimeTaker too frequently in renderMapXXX
* Calculate animation timer once per frame
* Remove code that breaks rendering frame at 2000ms

Co-authored-by: sfan5 <sfan5@live.de>

Co-authored-by: sfan5 <sfan5@live.de>
2022-08-13 22:33:26 +02:00
Lars Müller
0e439b2fa3 Check hp_max > 0 for entities (#12667) 2022-08-13 15:35:41 +01:00
Zughy
3132efcc01 Reassure previous nil behaviour for tiles and special_tiles (#12678)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2022-08-13 15:35:28 +01:00
Jude Melton-Houghton
ab8dfb45b4 Allow buffer argument to VoxelManip:get_light_data (#12682) 2022-08-13 08:53:47 +02:00
fluxionary
59601eb922 Remove default keybind for range select (#12632)
Reason: accidental key presses, few use-cases.
2022-08-13 08:53:30 +02:00
SmallJoker
023a1c2427 Textures: introduce world-align overrides (#12540)
Many games do not care about world align textures, however texture packs should have the capabilities to change that if they have suitable textures. This commmit now introduces a node property override for world-align in particular to force a certain scale on the selected override tiles.
2022-08-13 08:52:16 +02:00
Zughy
8bf1609ccc Fix crash when crafting callbacks return strings (#12685)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2022-08-12 10:17:37 +01:00
SmallJoker
c8ee755c05 Physics overrides: Move values to a common struct (#12591)
Co-authored-by: sfan5 <sfan5@live.de>
2022-08-12 10:17:02 +01:00
DS
df1d215f48 Node vertex shader: Properly use the waved world position (#12665) 2022-08-10 18:04:12 +02:00
Zughy
bcc56803d7 Fix crash when stars are reset 2022-08-10 18:03:57 +02:00
sfan5
4fbcc33ee0 Enable C++ stdlib assertions in debug flags 2022-08-05 13:04:01 +02:00
sfan5
f035fe9336 Merge remote-tracking branch 'origin/stable-5' into HEAD 2022-08-04 22:54:13 +02:00
sfan5
ec778508df Continue with 5.7.0-dev 2022-08-04 22:46:02 +02:00
sfan5
44c2e33c78 Bump version to 5.5.1 2022-05-15 21:53:21 +02:00
rubenwardy
2785dcbbbf Fix broken dependency enabling due to missing enabled field 2022-05-14 18:24:46 +01:00
sfan5
9b03bd3243 Fix Docker build
prometheus-cpp switched to C++14 in April (after we did) so this issue only affects older branches.
2022-05-14 18:51:48 +02:00
Jude Melton-Houghton
8f30456ee3 Fix cooking and fuel crafts with aliases 2022-05-14 18:33:42 +02:00
Octavian
38557ff635 Fix possible unreliable behavior due to uninitialized variables 2022-05-14 18:33:42 +02:00
Lars Müller
7bc2cde4dd HUD: Update selection mesh every frame (#12270)
Fixes outdated selection boxes after entity property changes.
2022-05-14 18:33:42 +02:00
Lars Müller
f065d3a06b Fix Minetest blaming the wrong mod for errors (#12241)
Covers the case where mods insert their callbacks manually into "minetest.registered_<callbacks>" (often to achieve a particular order of execution).
2022-05-14 18:33:42 +02:00
Jude Melton-Houghton
21f7e3a987 Enable dependencies when enabling modpacks (#12202) 2022-05-14 18:33:42 +02:00
Jude Melton-Houghton
9f688bc433 Fix enabling of dependencies with identical names (#12253) 2022-05-14 18:33:42 +02:00
rubenwardy
6e9d31d4fb Fix mods not being recursively enabled
Fixes #12290
2022-05-14 18:33:42 +02:00
sfan5
e81c48526b Declare all bundled libs as static
Otherwise it can happen that these are built as shared depending on the
options passed to CMake, which obviously isn't intended.
2022-05-14 18:33:42 +02:00
SmallJoker
b405985b80 guiScalingFilter: Fix most memory leaks (#12256)
Calls to the cache function ended up creating a new texture regardless whether
the texture is already cached.
2022-05-14 18:33:42 +02:00
rubenwardy
8b010c5a9f ContentDB: Fix ungraceful crash on aliases when list download fails
Fixes #12267 and fixes #12154
2022-05-14 18:33:42 +02:00
sfan5
1e7b5d6fdb Fix synchronization issue at thread start
If a newly started thread immediately exits then m_running would
immediately be set to false again and the caller would be stuck
waiting for m_running to become true forever.
Since a mutex for synchronizing startup already exists we can
simply move the while loop into it.

see also: #5134 which introduced m_start_finished_mutex
2022-05-14 18:33:42 +02:00
sfan5
a55982e7f0 Fix password changing getting stuck if wrong password is entered once 2022-05-14 18:33:42 +02:00
sfan5
1ac378063e Apply disallow_empty_password to password changes too 2022-05-14 18:33:42 +02:00
sfan5
d497c92684 Fix race condition in registration leading to duplicate create_auth calls 2022-05-14 18:33:42 +02:00
paradust7
677dc2c155 Remove HW_buffer_counter after IrrlichtMt fix to remove HWBufferMap (#12232)
Keep code and use version check instead, for backwards compatibility
2022-05-14 18:33:42 +02:00
Alex
beea8deeb5 Fix invalid queued package element and path (#12218) 2022-05-14 18:33:42 +02:00
Giuseppe Bilotta
0d0f1a2fb2 Fix some textures not being sent correctly to older clients
Since b2eb44afc5, a texture defined as
`[combine:16x512:0,0=some_file.png;etc`
will not be sent correctly from a 5.5 server to a 5.4 client due to the
overeager detection of unsupported base modifier `[` introducing a
spurious `blank.png^` before the modifier.

Fix this by whitelisting which base modifiers can be passed through
unchanged to the client, and prefix `blank.png` for the others
(which at the moment is just [png:, but the list may grow larger
as new base modifiers are added.)
2022-05-14 18:33:42 +02:00
paradust7
439701ed7a Fix '[combine' when EVDF_TEXTURE_NPOT is disabled. (#12187)
Stop scaling images to POT immediately when loaded. The 'combine'
modifier hardcodes X and Y coordinates, and so behaves incorrectly
if applied to a scaled image. Images emitted by generateImage()
are already scaled to POT before being used as a texture, so
nothing should break.
2022-05-14 18:33:42 +02:00
ShadowNinja
d945d0129c Fix OOB read in trim("") 2022-05-14 18:33:42 +02:00
Dmitry Kostenko
cc91477308 Avoid negation of comparison operator (luacheck warning) 2022-05-14 18:33:42 +02:00
Daroc Alden
ac139ec03d Fix memory leak in EmergeManager
EmergeManager keeps a copy of the BiomeGen that it creates, but
never deletes it.
2022-05-14 18:33:42 +02:00
Gregor Parzefall
b4f0e834bf Fix footsteps for players whose collision box min y != 0 (#12110) 2022-05-14 18:33:42 +02:00
Daroc Alden
6e6cdc834f Fix undefined behavior in TileLayer (#12125)
Initialize the values properly
2022-05-14 18:33:42 +02:00
Daroc Alden
4b81ae1b35 Fix memory leak from SpatialAreaStore (#12120) 2022-05-14 18:33:42 +02:00
sfan5
d569dc45a8 Fix segfault with autoscale_mode (again)
closes #12100
This time add some asserts so there is no misunderstanding about the NULL-ness of layer->texture.
2022-05-14 18:33:42 +02:00
sfan5
23d49fda29 Clean up ClientReady packet handling
fixes #12073
2022-05-14 18:33:42 +02:00
pecksin
62ad2c3bc1 Use absolute value for bouncy in collision (#11969)
[backport: removed devtest change and protocol_version comparison]
2022-05-14 18:33:42 +02:00
sfan5
25373ad294 Remove awful Mingw32 workarounds
Instead a warning is triggered if an affected compiler is detected.
closes #12022
2022-05-12 11:36:50 +02:00
sfan5
26d0c0fd8d Fix broken server startup if curl is disabled (#12046) 2022-05-12 11:36:39 +02:00
Lars Mueller
3afffcd36b Fix builtin statbar backgrounds
see #12000
2022-05-12 11:36:11 +02:00
sfan5
5440de1785 Merge remote-tracking branch 'origin/stable-5' into HEAD 2022-01-30 23:10:56 +01:00
rubenwardy
25a56f11c8 Bump version to 5.4.2 2021-10-22 23:06:51 +01:00
rubenwardy
8271c6481f Fix manifest and various things 2021-10-20 15:27:30 +01:00
sfan5
83e26f839d Reserve vectors before pushing and other code quality changes (#11161) 2021-10-20 14:25:39 +01:00
sfan5
c3f7905d82 Remove broken timeout behaviour
Code that relies on `resend_count` was added in 7ea4a03 and 247a1eb, but never worked.
This was fixed in #11607 which caused the problem to surface.
Hence undo the first commit entirely and change the logic of the second.
2021-10-19 19:23:00 +01:00
sfan5
05b54a8d18 Shave off buffer copies in networking code (#11607) 2021-10-19 19:22:46 +01:00
rubenwardy
e5cfdd369e Update deps ref 2021-10-18 18:33:25 +01:00
rubenwardy
c61d8cfb85 Use scoped app storage on Android (#11466)
From November 2021, the Play Store will no longer be accepting
apps which use the deprecated getExternalStorageDirectory() API.

Therefore, this commit replaces uses of deprecated API with the new
scoped API (`getExternalFilesDir()` and `getExternalCacheDir()`).
It also provides a temporary migration to move user data from the
shared external directory to new storage.

Fixes #2097,  #11417 and #11118
2021-10-18 18:12:03 +01:00
NeroBurner
27f4195471 Move build/android directory to root of project (#11283) 2021-10-18 18:11:33 +01:00
sfan5
b2596eda32 Bump version to 5.4.1 2021-04-10 18:41:12 +02:00
waxtatect
9379440fcb Translated using Weblate (French)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
Brian Gaucher
b7c502c8d1 Translated using Weblate (French)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
Markus Mikkonen
3c16d2d9b4 Translated using Weblate (Finnish)
Currently translated at 3.2% (44 of 1356 strings)
2021-04-10 17:51:40 +02:00
Tviljan
6cbc03a418 Translated using Weblate (Finnish)
Currently translated at 3.2% (44 of 1356 strings)
2021-04-10 17:51:40 +02:00
Edward
15ecc0fa65 Translated using Weblate (Russian)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
ssantos
7f2f8cdad1 Translated using Weblate (Portuguese)
Currently translated at 93.2% (1264 of 1356 strings)
2021-04-10 17:51:40 +02:00
waxtatect
a64646cb7b Translated using Weblate (French)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
David Leal
05f531c538 Translated using Weblate (Spanish)
Currently translated at 79.7% (1081 of 1356 strings)
2021-04-10 17:51:40 +02:00
François Delpierre
7ca335446b Translated using Weblate (French)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
waxtatect
99e96a6581 Translated using Weblate (French)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
BreadW
7200d8f90e Translated using Weblate (Japanese)
Currently translated at 99.8% (1354 of 1356 strings)
2021-04-10 17:51:40 +02:00
GnuPGを使うべきだ
7038837aca Translated using Weblate (Japanese)
Currently translated at 99.7% (1353 of 1356 strings)
2021-04-10 17:51:40 +02:00
ItsWidee
541dcc0e5a Translated using Weblate (French)
Currently translated at 98.0% (1330 of 1356 strings)
2021-04-10 17:51:40 +02:00
François Delpierre
1060b5aabf Translated using Weblate (French)
Currently translated at 96.6% (1311 of 1356 strings)
2021-04-10 17:51:40 +02:00
Dainis
6ea73c4982 Translated using Weblate (Latvian)
Currently translated at 28.6% (388 of 1356 strings)
2021-04-10 17:51:40 +02:00
Konstantin Yeliseyev
cff847273a Translated using Weblate (Russian)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
ResuUman
e669f8db9b Translated using Weblate (Polish)
Currently translated at 72.4% (982 of 1356 strings)
2021-04-10 17:51:40 +02:00
Mateusz Mendel
461cc30842 Translated using Weblate (Polish)
Currently translated at 72.4% (982 of 1356 strings)
2021-04-10 17:51:40 +02:00
gnu-ewm
13d7cb957c Translated using Weblate (Polish)
Currently translated at 71.6% (972 of 1356 strings)
2021-04-10 17:51:40 +02:00
Alessandro Mandelli
47a439a905 Translated using Weblate (Italian)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:40 +02:00
Hatlábú Farkas
053fb96694 Translated using Weblate (Hungarian)
Currently translated at 75.8% (1028 of 1356 strings)
2021-04-10 17:51:39 +02:00
ItsWidee
b72c1f7367 Translated using Weblate (French)
Currently translated at 96.5% (1309 of 1356 strings)
2021-04-10 17:51:39 +02:00
matiasC
e90738575f Translated using Weblate (Spanish)
Currently translated at 79.5% (1079 of 1356 strings)
2021-04-10 17:51:39 +02:00
Joaquín Villalba
35718eec9c Translated using Weblate (Spanish)
Currently translated at 79.5% (1079 of 1356 strings)
2021-04-10 17:51:39 +02:00
AnthonyDe
8285a53152 Translated using Weblate (Spanish)
Currently translated at 79.5% (1079 of 1356 strings)
2021-04-10 17:51:39 +02:00
Michalis
116fe7815b Translated using Weblate (Greek)
Currently translated at 8.8% (120 of 1356 strings)
2021-04-10 17:51:39 +02:00
Yangjun Wang
4c2efd7da3 Translated using Weblate (Chinese (Simplified))
Currently translated at 94.7% (1285 of 1356 strings)
2021-04-10 17:51:39 +02:00
Liu Tao
1a433e3185 Translated using Weblate (Chinese (Simplified))
Currently translated at 94.7% (1285 of 1356 strings)
2021-04-10 17:51:39 +02:00
Yangjun Wang
fa98a00916 Translated using Weblate (Chinese (Simplified))
Currently translated at 92.5% (1255 of 1356 strings)
2021-04-10 17:51:39 +02:00
David Leal
f4dd46ad60 Translated using Weblate (Spanish)
Currently translated at 79.0% (1072 of 1356 strings)
2021-04-10 17:51:39 +02:00
Joaquín Villalba
41825ccfbb Translated using Weblate (Spanish)
Currently translated at 78.0% (1059 of 1356 strings)
2021-04-10 17:51:39 +02:00
David Leal
4d1a5f12c0 Translated using Weblate (Spanish)
Currently translated at 78.0% (1059 of 1356 strings)
2021-04-10 17:51:39 +02:00
Agustin Calderon
cc58d56c6d Translated using Weblate (Spanish)
Currently translated at 78.0% (1059 of 1356 strings)
2021-04-10 17:51:39 +02:00
abidin toumi
683ef07312 Translated using Weblate (Arabic)
Currently translated at 25.7% (349 of 1356 strings)
2021-04-10 17:51:39 +02:00
Tirifto
c77c78cef5 Translated using Weblate (Esperanto)
Currently translated at 94.6% (1283 of 1356 strings)
2021-04-10 17:51:39 +02:00
Oğuz Ersen
88517030a4 Translated using Weblate (Turkish)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:39 +02:00
THANOS SIOURDAKIS
45471e8e63 Translated using Weblate (Greek)
Currently translated at 8.8% (120 of 1356 strings)
2021-04-10 17:51:39 +02:00
Yaya - Nurul Azeera Hidayah @ Muhammad Nur Hidayat Yasuyoshi
4e620beb75 Translated using Weblate (Malay)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:39 +02:00
winniepee
e7ab875b47 Translated using Weblate (Chinese (Simplified))
Currently translated at 92.4% (1254 of 1356 strings)
2021-04-10 17:51:39 +02:00
Ayes
be74ed9ab6 Translated using Weblate (Estonian)
Currently translated at 39.5% (536 of 1356 strings)
2021-04-10 17:51:39 +02:00
Wuzzy
52b2eacd37 Translated using Weblate (German)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:39 +02:00
Marian
6b4210a2ea Translated using Weblate (Slovak)
Currently translated at 100.0% (1356 of 1356 strings)
2021-04-10 17:51:39 +02:00
narrnika
740d0da5ee Translated using Weblate (Russian)
Currently translated at 99.3% (1347 of 1356 strings)
2021-04-10 17:51:07 +02:00
Mateusz Mendel
34883d356e Translated using Weblate (Polish)
Currently translated at 71.2% (966 of 1356 strings)
2021-04-10 17:51:07 +02:00
Giov4
aeafcce314 Translated using Weblate (Italian)
Currently translated at 99.7% (1352 of 1356 strings)
2021-04-10 17:51:07 +02:00
savilli
ae1d82c325 Fix hud_change and hud_remove after hud_add (#10997) 2021-04-09 22:05:22 +02:00
Vitaliy
1c89a07226 Restore minimal normal texture support (for minimap shading) 2021-04-09 22:04:51 +02:00
sfan5
43e262f13e Don't apply connection timeout limit to locally hosted servers
fixes #11085
2021-04-05 16:02:47 +02:00
sfan5
e5f802ab5c Fix server favorites not saving when client/serverlist/ doesn't exist already (#11152) 2021-04-05 16:02:32 +02:00
Lars Müller
847860fc5c Block & report player self-interaction (#11137) 2021-04-05 16:01:27 +02:00
SmallJoker
77e936445f Protect dropping from far node inventories
Also changes if/if to switch/case
2021-04-05 16:01:21 +02:00
SmallJoker
41beb74ef7 Protect per-player detached inventory actions 2021-04-05 16:01:15 +02:00
Elias Fleckenstein
67be50b706 Make pkgmgr handle modpacks containing modpacks properly
fixes #10550
2021-04-05 16:01:10 +02:00
rubenwardy
cd840b7c9d pkgmgr: Fix crash when .conf release field is invalid
Fixes #10942
2021-04-05 16:01:03 +02:00
sfan5
07903949ec Merge remote-tracking branch 'origin/stable-5' into HEAD 2021-02-23 20:18:23 +01:00
sfan5
d2156ddaad Merge remote-tracking branch 'origin/stable-5' into HEAD 2020-07-09 22:21:48 +02:00
sfan5
a84ff4b3ff Merge remote-tracking branch 'origin/stable-5' into HEAD 2020-04-05 18:44:51 +02:00
rubenwardy
c02f13d33f Release 5.1.1 2020-01-11 18:29:02 +00:00
rubenwardy
f6490859fd Translated using Weblate (Japanese (Kansai))
Currently translated at 0.2% (2 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
4b7816dbf4 Translated using Weblate (Burmese)
Currently translated at 0.2% (2 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
86ffbc3ec5 Translated using Weblate (Kazakh)
Currently translated at 0.2% (2 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
67257f44a5 Translated using Weblate (Arabic)
Currently translated at 6.1% (78 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
3086f5567a Translated using Weblate (Vietnamese)
Currently translated at 2.5% (32 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
bb8acb095d Translated using Weblate (Portuguese)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
24be3cbb5f Translated using Weblate (Basque)
Currently translated at 15.1% (193 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
9773191103 Translated using Weblate (Greek)
Currently translated at 1.4% (18 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
ddc703c3ec Translated using Weblate (Filipino)
Currently translated at 0.2% (2 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
09ec204e4b Translated using Weblate (Thai)
Currently translated at 66.9% (852 of 1274 strings)
2020-01-11 18:29:02 +00:00
rubenwardy
8b6cafa0e0 Translated using Weblate (Lao)
Currently translated at 0.2% (2 of 1274 strings)
2020-01-11 18:29:02 +00:00
Osoitz
1ee8be9d43 Translated using Weblate (Basque)
Currently translated at 15.1% (192 of 1274 strings)
2020-01-10 18:57:47 +00:00
Dhimas Wnz
91bc190d21 Translated using Weblate (Indonesian)
Currently translated at 96.9% (1234 of 1274 strings)
2020-01-10 18:57:47 +00:00
THANOS SIOURDAKIS
4dc833b642 Translated using Weblate (Greek)
Currently translated at 1.3% (17 of 1274 strings)
2020-01-10 18:57:47 +00:00
universales
895e9f8d5c Translated using Weblate (Spanish)
Currently translated at 61.9% (789 of 1274 strings)
2020-01-10 18:57:47 +00:00
Osoitz
12906ff631 Translated using Weblate (Basque)
Currently translated at 9.7% (123 of 1274 strings)
2020-01-10 18:57:47 +00:00
Osoitz
9c9bcff107 Added translation using Weblate (Basque) 2020-01-10 18:57:47 +00:00
Hotower
443ca5c63b Translated using Weblate (Chinese (Simplified))
Currently translated at 65.1% (830 of 1274 strings)
2020-01-10 18:57:47 +00:00
Stas Kies
1102b1fc4c Translated using Weblate (German)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:47 +00:00
abidin toumi
0d089eab21 Translated using Weblate (Arabic)
Currently translated at 6.0% (77 of 1274 strings)
2020-01-10 18:57:47 +00:00
zaoqi
b44fada29e Translated using Weblate (Chinese (Simplified))
Currently translated at 65.1% (830 of 1274 strings)
2020-01-10 18:57:47 +00:00
Yangjun Wang
859ea160e6 Translated using Weblate (Chinese (Simplified))
Currently translated at 63.2% (805 of 1274 strings)
2020-01-10 18:57:47 +00:00
Ács Zoltán
1c49e2ffc0 Translated using Weblate (Hungarian)
Currently translated at 61.9% (789 of 1274 strings)
2020-01-10 18:57:47 +00:00
Tirifto
140245c58d Translated using Weblate (Esperanto)
Currently translated at 97.2% (1238 of 1274 strings)
2020-01-10 18:57:47 +00:00
Petter Reinholdtsen
47adcced60 Translated using Weblate (Norwegian Bokmål)
Currently translated at 43.3% (552 of 1274 strings)
2020-01-10 18:57:47 +00:00
Luboš Nečas
a2054deb12 Translated using Weblate (Czech)
Currently translated at 48.8% (622 of 1274 strings)
2020-01-10 18:57:47 +00:00
Tirifto
30fdfd9ded Translated using Weblate (Esperanto)
Currently translated at 94.9% (1209 of 1274 strings)
2020-01-10 18:57:47 +00:00
ramon.venson
a87a86eb92 Translated using Weblate (Portuguese (Brazil))
Currently translated at 96.9% (1235 of 1274 strings)
2020-01-10 18:57:47 +00:00
Daniel Mancini
49dfbcfbc8 Translated using Weblate (Portuguese (Brazil))
Currently translated at 96.9% (1235 of 1274 strings)
2020-01-10 18:57:47 +00:00
Andrei Stepanov
c558a4f4f6 Translated using Weblate (Russian)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:46 +00:00
Andrei Stepanov
4f49a2248f Translated using Weblate (Russian)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:46 +00:00
Andrei Stepanov
4e57da42c1 Translated using Weblate (Russian)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:46 +00:00
Andrei Stepanov
4f6c9e206c Translated using Weblate (Russian)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:46 +00:00
Andrei Stepanov
699e1d4b77 Translated using Weblate (Russian)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:46 +00:00
Matej Mlinar
fa2978b3b9 Translated using Weblate (Slovenian)
Currently translated at 43.9% (559 of 1274 strings)
2020-01-10 18:57:46 +00:00
abidin toumi
ffcdf741fc Translated using Weblate (Arabic)
Currently translated at 5.7% (73 of 1274 strings)
2020-01-10 18:57:46 +00:00
Fixer
429d7f33d4 Translated using Weblate (Ukrainian)
Currently translated at 42.1% (536 of 1274 strings)
2020-01-10 18:57:46 +00:00
Andrei Stepanov
b6a229775e Translated using Weblate (Russian)
Currently translated at 81.9% (1044 of 1274 strings)
2020-01-10 18:57:46 +00:00
abidin toumi
0a4580368a Translated using Weblate (Arabic)
Currently translated at 5.6% (71 of 1274 strings)
2020-01-10 18:57:46 +00:00
abidin toumi
e5b191e1f1 Translated using Weblate (Arabic)
Currently translated at 4.2% (53 of 1274 strings)
2020-01-10 18:57:46 +00:00
Andrei Stepanov
a07acc067b Translated using Weblate (Russian)
Currently translated at 81.7% (1041 of 1274 strings)
2020-01-10 18:57:46 +00:00
abidin toumi
01e763f879 Added translation using Weblate (Arabic) 2020-01-10 18:57:46 +00:00
Viktar Vauchkevich
a95e75261a Translated using Weblate (Belarusian)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:46 +00:00
Julien Maulny
dcaa7ac609 Translated using Weblate (French)
Currently translated at 97.0% (1236 of 1274 strings)
2020-01-10 18:57:46 +00:00
Jacques Lagrange
7d2ae10849 Translated using Weblate (Italian)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
642cac3759 Translated using Weblate (Japanese (Kansai))
Currently translated at 0.1% (1 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
662af2edba Translated using Weblate (Dhivehi)
Currently translated at 8.2% (105 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
6f97e15a8f Translated using Weblate (Chinese (Simplified))
Currently translated at 63.0% (803 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
ab2fa2ca9d Translated using Weblate (Burmese)
Currently translated at 0.1% (1 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
4666c99b27 Translated using Weblate (Kyrgyz)
Currently translated at 8.6% (110 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
e38415c56d Translated using Weblate (Slovenian)
Currently translated at 42.0% (535 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
3f3fce4664 Translated using Weblate (Kannada)
Currently translated at 3.0% (38 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
1407a7bc8a Translated using Weblate (Kazakh)
Currently translated at 0.1% (1 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
1d268f4b83 Translated using Weblate (Norwegian Nynorsk)
Currently translated at 31.2% (398 of 1274 strings)
2020-01-10 18:57:46 +00:00
Krock
92aab79d27 Translated using Weblate (Italian)
Currently translated at 96.9% (1234 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
0823bb1276 Translated using Weblate (Hebrew)
Currently translated at 4.3% (55 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
18e42efa01 Translated using Weblate (Hungarian)
Currently translated at 61.9% (788 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
0ea16328df Translated using Weblate (Estonian)
Currently translated at 14.4% (183 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
b037efc5c6 Translated using Weblate (Esperanto)
Currently translated at 79.6% (1014 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
839bb71389 Translated using Weblate (Greek)
Currently translated at 1.1% (14 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
2ef7df5cfe Translated using Weblate (Danish)
Currently translated at 49.5% (631 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
f5d2d79f75 Translated using Weblate (Portuguese (Brazil))
Currently translated at 96.4% (1228 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
8e5fa96ffc Translated using Weblate (Filipino)
Currently translated at 0.1% (1 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
6dbbe07d50 Translated using Weblate (Thai)
Currently translated at 66.8% (851 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
3c23410753 Translated using Weblate (Lithuanian)
Currently translated at 15.4% (196 of 1274 strings)
2020-01-10 18:57:45 +00:00
Krock
8e35ab78b4 Translated using Weblate (Lao)
Currently translated at 0.1% (1 of 1274 strings)
2020-01-10 18:57:45 +00:00
Allan Nordhøy
7f2911b7f0 Translated using Weblate (Italian)
Currently translated at 96.9% (1234 of 1274 strings)
2020-01-10 18:57:45 +00:00
Mateusz Mendel
d877e90301 Translated using Weblate (Polish)
Currently translated at 81.1% (1033 of 1274 strings)
2020-01-10 18:57:45 +00:00
Vicente Carrasco Alvarez
93db4be726 Translated using Weblate (Spanish)
Currently translated at 61.5% (783 of 1274 strings)
2020-01-10 18:57:45 +00:00
Mateusz Mendel
1f419ad19f Translated using Weblate (Polish)
Currently translated at 81.1% (1033 of 1274 strings)
2020-01-10 18:57:45 +00:00
Muhammad Nur Hidayat Yasuyoshi
3c7f6508ad Translated using Weblate (Malay)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:45 +00:00
Mattias Münster
39449d4b63 Translated using Weblate (Swedish)
Currently translated at 32.7% (417 of 1274 strings)
2020-01-10 18:57:45 +00:00
Jacques Lagrange
28e05295fa Translated using Weblate (Italian)
Currently translated at 96.9% (1234 of 1274 strings)
2020-01-10 18:57:45 +00:00
Ács Zoltán
60c18d3550 Translated using Weblate (Hungarian)
Currently translated at 61.9% (788 of 1274 strings)
2020-01-10 18:57:45 +00:00
ssantos
482ab186a2 Translated using Weblate (Portuguese)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:45 +00:00
BreadW
4814195dc4 Translated using Weblate (Japanese)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:45 +00:00
Wuzzy
d215b7a10e Translated using Weblate (German)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:45 +00:00
nautilusx
0e52b78590 Translated using Weblate (German)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:45 +00:00
monolifed
b3a9d607c4 Translated using Weblate (Turkish)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:45 +00:00
Oguz Ersen
c00081b62c Translated using Weblate (Turkish)
Currently translated at 100.0% (1274 of 1274 strings)
2020-01-10 18:57:44 +00:00
William Breathitt Gray
5e4739b460 Fix find_path for newer jsoncpp installations
The upstream JsonCpp project has renamed the `json/features.h` file to
`json/json_features.h`. This patch fixes the JsonCpp installation search
by looking for `json/allocator.h` which has not been renamed on newer
versions of JsonCpp.

Fixes: https://github.com/minetest/minetest/issues/9119
2019-12-31 21:39:16 +00:00
SmallJoker
0d8f598df2 Fix LocalPlayer-bound sound playback broken by 81c2370 2019-12-31 21:31:53 +00:00
Wuzzy
2ef04cc308 Fix item eat sound not played if last item (#9239) 2019-12-31 21:31:53 +00:00
rubenwardy
7a0884e2cd Fix spaces breaking formspec_version[] tag 2019-12-31 21:31:53 +00:00
ANAND
fa858530cc Use a safer implementation of gsub in core.chat_format_message (#9133)
This search-and-replace implementation does not use Lua pattern-matching
2019-12-31 21:31:53 +00:00
sfan5
1c61fe5ed9 Rework packet receiving in ServerThread
Notably it tries to receive all queued packets
between server steps, not just one.
2019-12-31 21:31:53 +00:00
Dmitry Marakasov
57409ef382 Fix build issue due to conflicting s64 type definitions (#9064)
See comment in irrlichttypes.h and https://sourceforge.net/p/irrlicht/bugs/433/
2019-12-31 21:31:52 +00:00
SmallJoker
06ba826803 Formspecs: Reset version number on rebuild 2019-12-26 17:24:27 +00:00
rubenwardy
6e6ef9489f Continue with 5.1.1-dev 2019-12-26 17:24:23 +00:00
Loic Blot
45bbe39d1f Add arm64-v8a but it's not sufficient for 64bit build 2019-11-09 12:50:53 +01:00
Loic Blot
6c9fc13083 Bump to version code 25 2019-11-09 11:37:46 +01:00
MoNTE48
4c8a642388 Android: build fixes & compat fixes 2019-11-09 11:23:31 +01:00
sfan5
6208c9d64f Merge remote-tracking branch 'origin/stable-5' into HEAD 2019-10-12 15:59:36 +02:00
sfan5
76325d0ba9 Bump version to 5.0.1 2019-03-31 22:57:45 +02:00
rubenwardy
cf1802a6de Prevent multi-line chat messages server-side (#8420) 2019-03-28 21:49:03 +00:00
sfan5
538a7b12bd Fix texture rotation for wallmounted nodeboxes
fixes #8358
2019-03-19 22:37:11 +01:00
sfan5
57e0f52aaa httpfetch: Disable IPv6 here too if requested by settings (#8399) 2019-03-19 02:18:34 +00:00
Paramat
1ae0335b62 num_emerge_threads: Initialise value to cope with setting syntax error (#8396) 2019-03-19 02:18:26 +00:00
paramat
ca1bff6b66 num_emerge_threads: Fix documentation of automatic selection 2019-03-19 02:18:17 +00:00
Paramat
10cc62d2ca num_emerge_threads: Warn of crashes when > 1 (#8357) 2019-03-14 17:58:19 +00:00
rubenwardy
dd451a8a00 Fix cast from const by accessing string data directly (#8354)
Fixes #8327
2019-03-12 20:25:55 +00:00
rubenwardy
444ec1e412 HPChange Reason: Fix push after free, and type being overwritten (#8359)
* HPChange Reason: Fix push after free, and type being overwritten

Fixes #8227 and #8344
2019-03-12 20:25:48 +00:00
Paramat
82739f4d7d Change 'num_emerge_threads' default to 1 (#8303) 2019-03-11 22:07:19 +00:00
sofar
19825d853e getS16NoEx() returns true unless syntactical error in conf. (#8304)
The getS16NoEx() handler will return true unless there is a
`[num_emerge_threads]` line in the `minetest.conf` at which
point the excption handler part is reached. Due to the fact that
`defaultsettings.cpp` has a default value set for this setting,
that never will happen.

Because of this, the code will never check the number of threads on
the system, and keep `nthreads = 0`. If that happens, the value is
changed to `1` and only 1 emerge thread will be used.

The default should be set to `1` instead, due to the potential unsafe
consequences for the standard sqlite map files, but that should be a
separate commit that also adds documentation for that setting. This
commit focuses on removing this `hiding` bug instead.
2019-03-11 22:07:19 +00:00
rubenwardy
d8ece2e3e9 Fix serialization of std::time_t by casting to u64 first (#8353)
Fixes #8332
2019-03-11 22:07:19 +00:00
Paramat
bf4deb0ce6 Confirm registration GUI: Remove positional strings to fix Windows bug (#8258)
Positional strings don't work on some Windows builds.
Remove server address string, leave player name string present.
2019-03-11 22:07:19 +00:00
rubenwardy
da4739a26c Fix detach inventory serialisation (#8331) 2019-03-11 22:07:19 +00:00
rubenwardy
fc24bf0915 Fix incorrect string length check after cast 2019-03-11 22:07:19 +00:00
rubenwardy
9329b99cba Continue with 5.0.1-dev 2019-03-11 22:07:12 +00:00
931 changed files with 196891 additions and 144686 deletions

View File

@@ -3,10 +3,10 @@ IndentWidth: 4
UseTab: Always
TabWidth: 4
BreakBeforeBraces: Custom
Standard: Cpp11
Standard: c++17
BraceWrapping:
AfterClass: true
AfterControlStatement: false
AfterControlStatement: Never
AfterEnum: true
AfterFunction: true
AfterNamespace: true
@@ -20,7 +20,7 @@ IndentCaseLabels: false
AccessModifierOffset: -4
ColumnLimit: 90
AllowShortFunctionsOnASingleLine: InlineOnly
SortIncludes: false
SortIncludes: Never
IncludeCategories:
- Regex: '^".*'
Priority: 2

View File

@@ -2,7 +2,7 @@
end_of_line = lf
[*.{cpp,h,lua,txt,glsl,md,c,cmake,java,gradle}]
charset = utf8
charset = utf-8
indent_size = 4
indent_style = tab
insert_final_newline = true

View File

@@ -19,7 +19,7 @@ Contributions are welcome! Here's how you can help:
developers.
Any Pull Request that isn't a bug fix and isn't covered by
[the roadmap](../doc/direction.md) will be closed within a week unless it
[the roadmap](../doc/direction.md) will be closed within a month unless it
receives a concept approval from a Core Developer. For this reason, it is
recommended that you open an issue for any such pull requests before doing
the work, to avoid disappointment.
@@ -30,7 +30,7 @@ Contributions are welcome! Here's how you can help:
3. Start coding!
- Refer to the
[Lua API](https://github.com/minetest/minetest/blob/master/doc/lua_api.txt),
[Lua API](https://github.com/minetest/minetest/blob/master/doc/lua_api.md),
[Developer Wiki](http://dev.minetest.net/Main_Page) and other
[documentation](https://github.com/minetest/minetest/tree/master/doc).
- Follow the [C/C++](http://dev.minetest.net/Code_style_guidelines) and
@@ -138,7 +138,7 @@ These notes are for those who have push access Minetest (core developers / maint
If a Pull Request is not a bug fix:
* If it matches a goal in [the roadmap](../doc/direction.md), then the PR should
be labelled as "Roadmap" and the goal stated by number in the description.
be labeled as "Roadmap" and the goal stated by number in the description.
* If it doesn't match a goal, then it needs to receive a concept approval within
a week of being opened to remain open. This 1 week deadline does not apply to
PRs opened before the roadmap was adopted; instead, they may remain open or be

View File

@@ -1,32 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: Unconfirmed bug
assignees: ''
---
##### Minetest version
<!--
Paste Minetest version between quotes below.
If you are on a devel version, please add git commit hash.
You can use `minetest --version` to find it.
-->
```
```
##### OS / Hardware
<!-- General information about your hardware and operating system -->
Operating system:
CPU:
<!-- For graphical issues only -->
GPU model:
OpenGL version:
##### Summary
<!-- Describe your problem here -->
##### Steps to reproduce
<!-- Explain how the problem has happened, providing a minimal test (i.e. a code snippet reduced to the bone) where possible -->

91
.github/ISSUE_TEMPLATE/bug_report.yaml vendored Normal file
View File

@@ -0,0 +1,91 @@
name: Bug report
description: Create a report to help us improve
labels: ["Unconfirmed bug"]
body:
- type: markdown
attributes:
value: |
Please note the following:
1. **Please update your Minetest Engine to the latest stable or dev version** before submitting bug reports. Make sure the bug is still reproducible on the latest version.
2. This page is for reporting the bugs of **the engine itself**. For bugs in a particular game, please [search for the game in the ContentDB](https://content.minetest.net/packages/?type=game) and submit a bug report in their issue trackers.
* For example, you can submit issues about the Minetest Game (the official game of Minetest) [in its own repository](https://github.com/minetest/minetest_game/issues).
3. Please provide as many details as possible for us to spot the problem quicker.
- type: textarea
attributes:
label: Minetest version
description: |
Paste the Minetest version below.
If you are on a devel version, please add a git commit hash.
You can use `minetest --version` to find it.
You can also refer to the "About" tab of the menu.
placeholder: |
Example:
Minetest 5.7.0-dev-ca13c51 (Linux)
Using Irrlicht 1.9.0mt9
Using LuaJIT 2.1.0-beta3
BUILD_TYPE=Release
RUN_IN_PLACE=1
USE_CURL=1
USE_GETTEXT=1
USE_SOUND=1
STATIC_SHAREDIR="."
STATIC_LOCALEDIR="locale"
render: "true"
validations:
required: true
- type: input
attributes:
label: Active renderer
description: For graphical and input-related issues. You can find these in the About tab in the mainmenu.
placeholder: "Example: OpenGL 4.6.0"
validations:
required: false
- type: input
attributes:
label: Irrlicht device
description:
placeholder: "Example: X11"
validations:
required: false
- type: input
attributes:
label: Operating system and version
description: It is recommended to upgrade your operating system to see if the problem still exists.
placeholder: "Example: Ubuntu 22.04"
validations:
required: true
- type: input
attributes:
label: CPU model
description: Usually found in system settings.
placeholder: "Example: Intel i5-2410M (4) @ 2.900GHz"
validations:
required: false
- type: markdown
attributes:
value: The GPU model and OpenGL version can be omitted if the bug is not a graphical issue.
- type: input
attributes:
label: GPU model
description: Usually found in system settings.
placeholder: "Example: NVIDA GeForce RTX 4090"
validations:
required: false
- type: input
attributes:
label: OpenGL version
placeholder: "Example: 4.6"
validations:
required: false
- type: textarea
attributes:
label: Summary
description: Describe your problem here.
validations:
required: true
- type: textarea
attributes:
label: Steps to reproduce
description: Explain how the problem has happened, providing a minimal test (i.e. a code snippet reduced to the bone) where possible.
validations:
required: true

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Submit issues about Minetest Game
url: https://github.com/minetest/minetest_game/issues/new/choose
about: Only submit issues of the engine in this repository's issue tracker. Submit those of Minetest Game in its own issue tracker.
- name: Search for issue trackers of third-party games
url: https://content.minetest.net/packages/?type=game
about: For issues of third-party games, search for the game in the ContentDB and then submit an issue in their issue tracker.

View File

@@ -1,25 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: Feature request
assignees: ''
---
## Problem
A clear and concise description of what the problem is.
ie: Why is this needed?
Ex. I'm always frustrated when [...]
## Solutions
A clear and concise description of what you want to happen.
## Alternatives
A clear and concise description of any alternative solutions or features you've considered.
## Additional context
Add any other context or screenshots about the feature request here.

View File

@@ -0,0 +1,39 @@
name: Feature request
description: Suggest an idea for this project
labels: ["Feature request"]
body:
- type: markdown
attributes:
value: |
Please note the following:
1. Only submit a feature request if the feature does not exist on the latest dev version.
2. This page is for suggesting changes to **the engine itself**. To suggest changes to games, please [search for the game in the ContentDB](https://content.minetest.net/packages/?type=game) and submit a feature request in their issue trackers.
- type: textarea
attributes:
label: Problem
description: |
A clear and concise description of the problem, i.e. "Why is this needed?"
Example: I'm always frustrated when [...]
validations:
required: true
- type: textarea
attributes:
label: Solutions
description: |
A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
attributes:
label: Alternatives
description: |
A clear and concise description of any alternative solutions or features you've considered.
validations:
required: true
- type: textarea
attributes:
label: Additional context
description: |
Add any other context or screenshots about the feature request here.
validations:
required: false

View File

@@ -3,7 +3,7 @@ Add compact, short information about your PR for easier understanding:
- Goal of the PR
- How does the PR work?
- Does it resolve any reported issue?
- Does this relate to a goal in [the roadmap](../doc/direction.md)?
- Does this relate to a goal in [the roadmap](https://github.com/minetest/minetest/blob/master/doc/direction.md)?
- If not a bug fix, why is this PR needed? What usecases does it solve?
## To do

View File

@@ -28,8 +28,17 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends gettext openjdk-11-jdk-headless
- name: Build with Gradle
- name: Build AAB with Gradle
# We build an AAB as well for uploading to the the Play Store.
run: cd android; ./gradlew bundlerelease
- name: Build APKs with Gradle
# "assemblerelease" is very fast after "bundlerelease".
run: cd android; ./gradlew assemblerelease
- name: Save AAB artifact
uses: actions/upload-artifact@v4
with:
name: Minetest-release.aab
path: android/app/build/outputs/bundle/release/app-release.aab
- name: Save armeabi artifact
uses: actions/upload-artifact@v3
with:
@@ -40,3 +49,13 @@ jobs:
with:
name: Minetest-arm64-v8a.apk
path: android/app/build/outputs/apk/release/app-arm64-v8a-release-unsigned.apk
- name: Save x86 artifact
uses: actions/upload-artifact@v3
with:
name: Minetest-x86.apk
path: android/app/build/outputs/apk/release/app-x86-release-unsigned.apk
- name: Save x86_64 artifact
uses: actions/upload-artifact@v3
with:
name: Minetest-x86_64.apk
path: android/app/build/outputs/apk/release/app-x86_64-release-unsigned.apk

View File

@@ -29,99 +29,98 @@ on:
- 'Dockerfile'
- '.dockerignore'
env:
MINETEST_POSTGRESQL_CONNECT_STRING: 'host=localhost user=minetest password=minetest dbname=minetest'
jobs:
# Older gcc version (should be close to our minimum supported version)
gcc_5:
runs-on: ubuntu-18.04
gcc_7:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps g++-5
install_linux_deps g++-7
- name: Build
run: |
./util/ci/build.sh
env:
CC: gcc-5
CXX: g++-5
CC: gcc-7
CXX: g++-7
- name: Test
run: |
./bin/minetest --run-unittests
# Current gcc version
gcc_10:
runs-on: ubuntu-20.04
gcc_12:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps g++-10
install_linux_deps g++-12 libluajit-5.1-dev
- name: Build
run: |
./util/ci/build.sh
env:
CC: gcc-10
CXX: g++-10
CC: gcc-12
CXX: g++-12
- name: Test
run: |
./bin/minetest --run-unittests
# Older clang version (should be close to our minimum supported version)
clang_3_9:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-3.9 gdb
- name: Build
run: |
./util/ci/build.sh
env:
CC: clang-3.9
CXX: clang++-3.9
- name: Unittest
run: |
./bin/minetest --run-unittests
- name: Integration test + devtest
run: |
./util/test_multiplayer.sh
# Current clang version
clang_10:
clang_7:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-10 valgrind libluajit-5.1-dev
install_linux_deps clang-7 llvm
- name: Build
run: |
./util/ci/build.sh
env:
CC: clang-10
CXX: clang++-10
CMAKE_FLAGS: "-DREQUIRE_LUAJIT=1"
CC: clang-7
CXX: clang++-7
CMAKE_FLAGS: '-DCMAKE_C_FLAGS="-fsanitize=address" -DCMAKE_CXX_FLAGS="-fsanitize=address"'
- name: Unittest
run: |
./bin/minetest --run-unittests
# Current clang version
clang_14:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
source ./util/ci/common.sh
install_linux_deps clang-14 gdb
- name: Build
run: |
./util/ci/build.sh
env:
CC: clang-14
CXX: clang++-14
- name: Test
run: |
./bin/minetest --run-unittests
- name: Valgrind
- name: Integration test + devtest
run: |
valgrind --leak-check=full --leak-check-heuristics=all --undef-value-errors=no --error-exitcode=9 ./bin/minetest --run-unittests
./util/test_multiplayer.sh
# Build with prometheus-cpp (server-only)
clang_9_prometheus:
@@ -175,7 +174,6 @@ jobs:
run: |
EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin32.sh winbuild
env:
NO_MINETEST_GAME: 1
NO_PACKAGE: 1
win64:
@@ -193,15 +191,14 @@ jobs:
run: |
EXISTING_MINETEST_DIR=$PWD ./util/buildbot/buildwin64.sh winbuild
env:
NO_MINETEST_GAME: 1
NO_PACKAGE: 1
msvc:
name: VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }}
runs-on: windows-2019
env:
VCPKG_VERSION: 5cf60186a241e84e8232641ee973395d4fde90e1
# 2022.02
VCPKG_VERSION: 8eb57355a4ffb410a2e94c07b4dca2dffbee8e50
# 2023.10.19
vcpkg_packages: zlib zstd curl[winssl] openal-soft libvorbis libogg libjpeg-turbo sqlite3 freetype luajit gmp jsoncpp opengl-registry
strategy:
fail-fast: false
@@ -245,6 +242,8 @@ jobs:
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" `
-DCMAKE_BUILD_TYPE=Release `
-DENABLE_POSTGRESQL=OFF `
-DENABLE_LUAJIT=TRUE `
-DREQUIRE_LUAJIT=TRUE `
-DRUN_IN_PLACE=${{ contains(matrix.type, 'portable') }} .
- name: Build Minetest

48
.github/workflows/lua_api_deploy.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: lua_api_deploy
permissions:
contents: read
pages: write
id-token: write
on:
push:
paths:
- '.github/workflows/lua_api_deploy.yml'
- 'doc/lua_api.md'
- 'doc/mkdocs/'
branches:
- master
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install mkdocs
run: |
pip install -U -r doc/mkdocs/requirements.txt
- name: Build documentation
run: |
cd doc/mkdocs/
./build.sh
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: 'public/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

View File

@@ -21,27 +21,18 @@ on:
- 'cmake/Modules/**'
- '.github/workflows/macos.yml'
env:
MINETEST_GAME_REPO: https://github.com/minetest/minetest_game.git
MINETEST_GAME_BRANCH: master
MINETEST_GAME_NAME: minetest_game
jobs:
build:
runs-on: macos-10.15
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install deps
run: |
pkgs=(cmake freetype gettext gmp hiredis jpeg jsoncpp leveldb libogg libpng libvorbis luajit zstd)
brew update
brew install ${pkgs[@]}
brew unlink $(brew ls --formula)
brew link ${pkgs[@]}
source ./util/ci/common.sh
install_macos_deps
- name: Build
run: |
git clone -b $MINETEST_GAME_BRANCH $MINETEST_GAME_REPO games/$MINETEST_GAME_NAME
git clone https://github.com/minetest/irrlicht lib/irrlichtmt --depth 1 -b $(cat misc/irrlichtmt_tag.txt)
mkdir build
cd build
@@ -49,9 +40,9 @@ jobs:
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DCMAKE_INSTALL_PREFIX=../build/macos/ \
-DRUN_IN_PLACE=FALSE \
-DENABLE_FREETYPE=TRUE -DENABLE_GETTEXT=TRUE
make -j2
-DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE \
-DINSTALL_DEVTEST=TRUE
cmake --build . -j$(sysctl -n hw.logicalcpu)
make install
- name: Test

19
.gitignore vendored
View File

@@ -28,8 +28,17 @@ gtags.files
# Visual Studio Code & plugins
.vscode/
build/.cmake/
# Fleet
.fleet
# Gradle
.gradle
# Clang
.cache
# AppImage
*.AppImage
*.zsync
appimage-build
AppDir
## Files related to Minetest development cycle
/*.patch
@@ -41,17 +50,17 @@ build/.cmake/
/bin/
/games/*
!/games/devtest/
/games/devtest/mods/soundstuff/sounds/gitignored_sounds/*
!/games/devtest/mods/soundstuff/sounds/gitignored_sounds/custom_sounds_here.txt
/cache
/textures/*
!/textures/base/
/screenshots
/sounds
/mods/*
!/mods/minetest/
/mods/minetest/*
!/mods/minetest/mods_here.txt
/worlds
/world/
!/mods/mods_here.txt
/worlds/*
!/worlds/worlds_here.txt
/clientmods/*
!/clientmods/preview/
/client/mod_storage/

View File

@@ -9,18 +9,17 @@ stages:
- deploy
variables:
MINETEST_GAME_REPO: "https://github.com/minetest/minetest_game.git"
CONTAINER_IMAGE: registry.gitlab.com/$CI_PROJECT_PATH
.build_template:
stage: build
before_script:
- apt-get update
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential git cmake libpng-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev libleveldb-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libzstd-dev
- DEBIAN_FRONTEND=noninteractive apt-get -y install build-essential gettext git cmake libpng-dev libjpeg-dev libxi-dev libgl1-mesa-dev libsqlite3-dev libleveldb-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libzstd-dev libluajit-5.1-dev
script:
- git clone https://github.com/minetest/irrlicht lib/irrlichtmt --depth 1 -b $(cat misc/irrlichtmt_tag.txt)
- mkdir build && cd build
- cmake -DCMAKE_INSTALL_PREFIX=../artifact/minetest/usr/ -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE -DBUILD_SERVER=TRUE ..
- cmake -DCMAKE_INSTALL_PREFIX=../artifact/minetest/usr/ -DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE ..
- make -j $(($(nproc) + 1))
- make install
artifacts:
@@ -29,164 +28,14 @@ variables:
paths:
- artifact/*
.debpkg_template:
stage: package
before_script:
- apt-get update
- apt-get install -y git
- mkdir -p build/deb/minetest/DEBIAN/
- cp misc/debpkg-control build/deb/minetest/DEBIAN/control
- cp -a artifact/minetest/usr build/deb/minetest/
script:
- git clone $MINETEST_GAME_REPO build/deb/minetest/usr/share/minetest/games/minetest_game
- rm -rf build/deb/minetest/usr/share/minetest/games/minetest/.git
- sed -i 's/DATEPLACEHOLDER/'$(date +%y.%m.%d)'/g' build/deb/minetest/DEBIAN/control
- sed -i 's/JPEG_PLACEHOLDER/'$JPEG_PKG'/g' build/deb/minetest/DEBIAN/control
- sed -i 's/LEVELDB_PLACEHOLDER/'$LEVELDB_PKG'/g' build/deb/minetest/DEBIAN/control
- sed -i 's/JSONCPP_PLACEHOLDER/'$JSONCPP_PKG'/g' build/deb/minetest/DEBIAN/control
- cd build/deb/ && dpkg-deb -b minetest/ && mv minetest.deb ../../
artifacts:
expire_in: 90 day
paths:
- ./*.deb
.debpkg_install:
stage: deploy
before_script:
- apt-get update -qy
script:
- apt-get install -y ./*.deb
- minetest --version
##
## Debian
## Ubuntu (prerequisite for AppImage build)
##
# Stretch
build:debian-9:
extends: .build_template
image: debian:9
package:debian-9:
extends: .debpkg_template
image: debian:9
needs:
- build:debian-9
variables:
JSONCPP_PKG: libjsoncpp1
LEVELDB_PKG: libleveldb1v5
JPEG_PKG: libjpeg62-turbo
deploy:debian-9:
extends: .debpkg_install
image: debian:9
needs:
- package:debian-9
# Buster
build:debian-10:
extends: .build_template
image: debian:10
package:debian-10:
extends: .debpkg_template
image: debian:10
needs:
- build:debian-10
variables:
JSONCPP_PKG: libjsoncpp1
LEVELDB_PKG: libleveldb1d
JPEG_PKG: libjpeg62-turbo
deploy:debian-10:
extends: .debpkg_install
image: debian:10
needs:
- package:debian-10
# Bullseye
build:debian-11:
extends: .build_template
image: debian:11
package:debian-11:
extends: .debpkg_template
image: debian:11
needs:
- build:debian-11
variables:
JSONCPP_PKG: libjsoncpp24
LEVELDB_PKG: libleveldb1d
JPEG_PKG: libjpeg62-turbo
deploy:debian-11:
extends: .debpkg_install
image: debian:11
needs:
- package:debian-11
##
## Ubuntu
##
# Bionic
build:ubuntu-18.04:
extends: .build_template
image: ubuntu:bionic
package:ubuntu-18.04:
extends: .debpkg_template
image: ubuntu:bionic
needs:
- build:ubuntu-18.04
variables:
JSONCPP_PKG: libjsoncpp1
LEVELDB_PKG: libleveldb1v5
JPEG_PKG: libjpeg-turbo8
deploy:ubuntu-18.04:
extends: .debpkg_install
image: ubuntu:bionic
needs:
- package:ubuntu-18.04
# Focal
build:ubuntu-20.04:
extends: .build_template
image: ubuntu:focal
package:ubuntu-20.04:
extends: .debpkg_template
image: ubuntu:focal
needs:
- build:ubuntu-20.04
variables:
JSONCPP_PKG: libjsoncpp1
LEVELDB_PKG: libleveldb1d
JPEG_PKG: libjpeg-turbo8
deploy:ubuntu-20.04:
extends: .debpkg_install
image: ubuntu:focal
needs:
- package:ubuntu-20.04
##
## Fedora
##
# Fedora 28 <-> RHEL 8
build:fedora-28:
extends: .build_template
image: fedora:28
before_script:
- dnf -y install make git gcc gcc-c++ kernel-devel cmake libjpeg-devel libpng-devel libcurl-devel openal-soft-devel libvorbis-devel libXxf86vm-devel libogg-devel freetype-devel mesa-libGL-devel zlib-devel jsoncpp-devel gmp-devel sqlite-devel luajit-devel leveldb-devel ncurses-devel spatialindex-devel libzstd-devel
##
## MinGW for Windows
##
@@ -235,10 +84,7 @@ package:docker:
before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
script:
- docker build . -t ${CONTAINER_IMAGE}/server:$CI_COMMIT_SHA -t ${CONTAINER_IMAGE}/server:$CI_COMMIT_REF_NAME -t ${CONTAINER_IMAGE}/server:latest
- docker push ${CONTAINER_IMAGE}/server:$CI_COMMIT_SHA
- docker push ${CONTAINER_IMAGE}/server:$CI_COMMIT_REF_NAME
- docker push ${CONTAINER_IMAGE}/server:latest
- ./util/ci/docker.sh
##
## Gitlab Pages (Lua API documentation)
@@ -248,9 +94,7 @@ pages:
stage: deploy
image: python:3.8
before_script:
- pip install git+https://github.com/Python-Markdown/markdown.git
- pip install git+https://github.com/mkdocs/mkdocs.git
- pip install pygments
- pip install -U -r doc/mkdocs/requirements.txt
script:
- cd doc/mkdocs && ./build.sh
artifacts:
@@ -267,22 +111,19 @@ package:appimage-client:
stage: package
image: appimagecrafters/appimage-builder
needs:
- build:ubuntu-18.04
- build:ubuntu-20.04
before_script:
- apt-get update -y
- apt-get update
- apt-get install -y git
# Collect files
- mkdir AppDir
- cp -a artifact/minetest/usr/ AppDir/usr/
- rm AppDir/usr/bin/minetestserver
- cp -a clientmods AppDir/usr/share/minetest
script:
- git clone $MINETEST_GAME_REPO AppDir/usr/share/minetest/games/minetest_game
- rm -rf AppDir/usr/share/minetest/games/minetest/.git
- export VERSION=$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA
# Remove PrefersNonDefaultGPU property due to validation errors
- sed -i '/PrefersNonDefaultGPU/d' AppDir/usr/share/applications/net.minetest.minetest.desktop
- appimage-builder --skip-test
script:
- export VERSION=$CI_COMMIT_REF_NAME-$CI_COMMIT_SHORT_SHA
- appimage-builder --skip-test --recipe misc/AppImageBuilder.yml
artifacts:
expire_in: 90 day
paths:

View File

@@ -70,6 +70,7 @@ files["builtin/mainmenu"] = {
read_globals = {
"PLATFORM",
"TOUCHSCREEN_GUI",
},
}
@@ -80,3 +81,9 @@ files["builtin/common/tests"] = {
"assert",
},
}
files["builtin/fstk"] = {
read_globals = {
"TOUCHSCREEN_GUI",
},
}

View File

@@ -37,7 +37,7 @@ numzero <numzer0@yandex.ru> <silverunicorn2011@yandex.ru>
Jean-Patrick Guerrero <kilbith@users.noreply.github.com>
Jean-Patrick Guerrero <kilbith@users.noreply.github.com> <jeanpatrick.guerrero@gmail.com>
HybridDog <3192173+HybridDog@users.noreply.github.com> <ovvv@web.de>
srfqi <muhammadrifqipriyosusanto@gmail.com>
srifqi <muhammadrifqipriyosusanto@gmail.com>
Dániel Juhász <juhdanad@gmail.com>
rubenwardy <rw@rubenwardy.com>
rubenwardy <rw@rubenwardy.com> <rubenwardy@gmail.com>
@@ -48,7 +48,8 @@ ClobberXD <ClobberXD@gmail.com> <ClobberXD@protonmail.com>
ClobberXD <ClobberXD@gmail.com> <36130650+ClobberXD@users.noreply.github.com>
Auke Kok <sofar+github@foo-projects.org>
Auke Kok <sofar+github@foo-projects.org> <sofar@foo-projects.org>
Desour <vorunbekannt75@web.de>
DS <ds.desour@proton.me>
DS <ds.desour@proton.me> <vorunbekannt75@web.de>
Nathanaëlle Courant <Ekdohibs@users.noreply.github.com> <nathanael.courant@laposte.net>
Ezhh <owlecho@live.com>
paramat <paramat@users.noreply.github.com>
@@ -67,3 +68,7 @@ gregorycu <gregory.currie@gmail.com>
Rogier <rogier777@gmail.com>
Rogier <rogier777@gmail.com> <Rogier-5@users.noreply.github.com>
x2048 <codeforsmile@gmail.com>
Lars Müller <appgurulars@gmx.de>
Lars Müller <appgurulars@gmx.de> <34514239+appgurueu@users.noreply.github.com>
ROllerozxa <rollerozxa@voxelmanip.se>
ROllerozxa <rollerozxa@voxelmanip.se> <temporaryemail4meh+github@gmail.com>

View File

@@ -1,54 +0,0 @@
version: 1
AppDir:
path: ./AppDir
app_info:
id: minetest
name: Minetest
icon: minetest
version: !ENV ${VERSION}
exec: usr/bin/minetest
exec_args: $@
runtime:
env:
APPDIR_LIBRARY_PATH: $APPDIR/usr/lib/x86_64-linux-gnu
apt:
arch: amd64
sources:
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic main universe
key_url: 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3b4fe6acc0b21f32'
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic-updates main universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic-backports main universe
- sourceline: deb http://archive.ubuntu.com/ubuntu/ bionic-security main universe
include:
- libc6
- libcurl3-gnutls
- libfreetype6
- libgl1
- libjpeg-turbo8
- libjsoncpp1
- libleveldb1v5
- libopenal1
- libpng16-16
- libsqlite3-0
- libstdc++6
- libvorbisfile3
- libx11-6
- libxxf86vm1
- zlib1g
files:
exclude:
- usr/share/man
- usr/share/doc/*/README.*
- usr/share/doc/*/changelog.*
- usr/share/doc/*/NEWS.*
- usr/share/doc/*/TODO.*
AppImage:
update-information: None
sign-key: None
arch: x86_64

View File

@@ -1,25 +1,18 @@
cmake_minimum_required(VERSION 3.5)
# Set policies up to 3.9 since we want to enable the IPO option
if(${CMAKE_VERSION} VERSION_LESS 3.9)
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
else()
cmake_policy(VERSION 3.9)
endif()
cmake_minimum_required(VERSION 3.12)
# This can be read from ${PROJECT_NAME} after project() is called
project(minetest)
set(PROJECT_NAME_CAPITALIZED "Minetest")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
set(GCC_MINIMUM_VERSION "5.1")
set(CLANG_MINIMUM_VERSION "3.5")
set(GCC_MINIMUM_VERSION "7.5")
set(CLANG_MINIMUM_VERSION "7.0.1")
# Also remember to set PROTOCOL_VERSION in network/networkprotocol.h when releasing
# You should not need to edit these manually, use util/bump_version.sh
set(VERSION_MAJOR 5)
set(VERSION_MINOR 6)
set(VERSION_PATCH 0)
set(VERSION_MINOR 8)
set(VERSION_PATCH 1)
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
# Change to false for releases
@@ -37,10 +30,20 @@ if (CMAKE_BUILD_TYPE STREQUAL Debug)
set(VERSION_STRING "${VERSION_STRING}-debug")
endif()
message(STATUS "*** Will build version ${VERSION_STRING} ***")
# Configuration options
set(BUILD_CLIENT TRUE CACHE BOOL "Build client")
set(BUILD_SERVER FALSE CACHE BOOL "Build server")
set(BUILD_UNITTESTS TRUE CACHE BOOL "Build unittests")
set(BUILD_BENCHMARKS FALSE CACHE BOOL "Build benchmarks")
set(BUILD_DOCUMENTATION TRUE CACHE BOOL "Build documentation")
set(DEFAULT_ENABLE_LTO TRUE)
# by default don't enable on Debug builds to get faster builds
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(DEFAULT_ENABLE_LTO FALSE)
endif()
set(ENABLE_LTO ${DEFAULT_ENABLE_LTO} CACHE BOOL "Use Link Time Optimization")
set(DEFAULT_RUN_IN_PLACE FALSE)
if(WIN32)
set(DEFAULT_RUN_IN_PLACE TRUE)
@@ -48,11 +51,13 @@ endif()
set(RUN_IN_PLACE ${DEFAULT_RUN_IN_PLACE} CACHE BOOL
"Run directly in source directory structure")
set(BUILD_CLIENT TRUE CACHE BOOL "Build client")
set(BUILD_SERVER FALSE CACHE BOOL "Build server")
set(BUILD_UNITTESTS TRUE CACHE BOOL "Build unittests")
set(BUILD_BENCHMARKS FALSE CACHE BOOL "Build benchmarks")
message(STATUS "*** Will build version ${VERSION_STRING} ***")
message(STATUS "BUILD_CLIENT: " ${BUILD_CLIENT})
message(STATUS "BUILD_SERVER: " ${BUILD_SERVER})
message(STATUS "BUILD_UNITTESTS: " ${BUILD_UNITTESTS})
message(STATUS "BUILD_BENCHMARKS: " ${BUILD_BENCHMARKS})
message(STATUS "BUILD_DOCUMENTATION: " ${BUILD_DOCUMENTATION})
message(STATUS "RUN_IN_PLACE: " ${RUN_IN_PLACE})
set(WARN_ALL TRUE CACHE BOOL "Enable -Wall for Release build")
@@ -61,15 +66,37 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type: Debug or Release" FORCE)
endif()
# FIXME: Windows build fails in multiple places to link, needs to be investigated.
if (ENABLE_LTO AND NOT WIN32)
include(CheckIPOSupported)
check_ipo_supported(RESULT lto_supported OUTPUT lto_output)
if(lto_supported)
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
message(STATUS "LTO/IPO is enabled")
else()
message(STATUS "LTO/IPO requested but it is not supported by the compiler: ${lto_output}")
endif()
else()
message(STATUS "LTO/IPO is not enabled")
endif()
set(ENABLE_UPDATE_CHECKER (NOT ${DEVELOPMENT_BUILD}) CACHE BOOL
"Whether to enable update checks by default")
# Included stuff
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
# Load default options for Android
if(ANDROID)
cmake_minimum_required(VERSION 3.20)
include(MinetestAndroidLibs)
endif()
set(IRRLICHTMT_BUILD_DIR "" CACHE PATH "Path to IrrlichtMt build directory.")
if(NOT "${IRRLICHTMT_BUILD_DIR}" STREQUAL "")
if(ANDROID)
# currently manually provided
elseif(NOT "${IRRLICHTMT_BUILD_DIR}" STREQUAL "")
find_package(IrrlichtMt QUIET
PATHS "${IRRLICHTMT_BUILD_DIR}"
NO_DEFAULT_PATH
@@ -120,14 +147,16 @@ else()
endif()
endif()
if(BUILD_CLIENT AND TARGET IrrlichtMt::IrrlichtMt)
if(ANDROID)
# skipped for now
elseif(BUILD_CLIENT AND TARGET IrrlichtMt::IrrlichtMt)
# retrieve version somehow
if(NOT IrrlichtMt_VERSION)
get_target_property(IrrlichtMt_VERSION IrrlichtMt VERSION)
endif()
message(STATUS "Found IrrlichtMt ${IrrlichtMt_VERSION}")
set(TARGET_VER_S 1.9.0mt7)
set(TARGET_VER_S 1.9.0mt13)
string(REPLACE "mt" "." TARGET_VER ${TARGET_VER_S})
if(IrrlichtMt_VERSION VERSION_LESS ${TARGET_VER})
message(FATAL_ERROR "At least IrrlichtMt ${TARGET_VER_S} is required to build")
@@ -136,6 +165,17 @@ if(BUILD_CLIENT AND TARGET IrrlichtMt::IrrlichtMt)
endif()
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "${GCC_MINIMUM_VERSION}")
message(FATAL_ERROR "Insufficient gcc version, found ${CMAKE_CXX_COMPILER_VERSION}. "
"Version ${GCC_MINIMUM_VERSION} or higher is required.")
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "${CLANG_MINIMUM_VERSION}")
message(FATAL_ERROR "Insufficient clang version, found ${CMAKE_CXX_COMPILER_VERSION}. "
"Version ${CLANG_MINIMUM_VERSION} or higher is required.")
endif()
endif()
# Installation
@@ -236,10 +276,12 @@ if(RUN_IN_PLACE)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/textures/texture_packs_here.txt" DESTINATION "${SHAREDIR}/textures")
endif()
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/minetest_game" DESTINATION "${SHAREDIR}/games/"
COMPONENT "SUBGAME_MINETEST_GAME" OPTIONAL PATTERN ".git*" EXCLUDE )
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/devtest" DESTINATION "${SHAREDIR}/games/"
COMPONENT "SUBGAME_MINIMAL" OPTIONAL PATTERN ".git*" EXCLUDE )
set(INSTALL_DEVTEST FALSE CACHE BOOL "Install Development Test")
if(INSTALL_DEVTEST)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/games/devtest" DESTINATION "${SHAREDIR}/games/"
PATTERN ".git*" EXCLUDE )
endif()
if(BUILD_CLIENT)
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/client/shaders" DESTINATION "${SHAREDIR}/client")
@@ -251,11 +293,11 @@ if(BUILD_CLIENT)
endif()
install(FILES "README.md" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/lua_api.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/client_lua_api.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/menu_lua_api.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/texture_packs.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/world_format.txt" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/lua_api.md" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/client_lua_api.md" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/menu_lua_api.md" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/texture_packs.md" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "doc/world_format.md" DESTINATION "${DOCDIR}" COMPONENT "Docs")
install(FILES "minetest.conf.example" DESTINATION "${EXAMPLE_CONF_DIR}")
if(UNIX AND NOT APPLE)
@@ -278,23 +320,9 @@ find_package(GMP REQUIRED)
find_package(Json REQUIRED)
find_package(Lua REQUIRED)
if(NOT USE_LUAJIT)
set(LUA_BIT_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/bitop)
set(LUA_BIT_LIBRARY bitop)
add_subdirectory(lib/bitop)
endif()
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "${GCC_MINIMUM_VERSION}")
message(FATAL_ERROR "Insufficient gcc version, found ${CMAKE_CXX_COMPILER_VERSION}. "
"Version ${GCC_MINIMUM_VERSION} or higher is required.")
endif()
elseif(CMAKE_CXX_COMPILER_ID MATCHES "(Apple)?Clang")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "${CLANG_MINIMUM_VERSION}")
message(FATAL_ERROR "Insufficient clang version, found ${CMAKE_CXX_COMPILER_VERSION}. "
"Version ${CLANG_MINIMUM_VERSION} or higher is required.")
endif()
endif()
if(BUILD_BENCHMARKS)
add_subdirectory(lib/catch2)
endif()
@@ -303,7 +331,6 @@ endif()
# Be sure to add all relevant definitions above this
add_subdirectory(src)
# CPack
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A free open-source voxel game engine with easy modding and game creation.")
@@ -320,25 +347,8 @@ cpack_add_component(Docs
DESCRIPTION "Documentation about Minetest and Minetest modding"
)
cpack_add_component(SUBGAME_MINETEST_GAME
DISPLAY_NAME "Minetest Game"
DESCRIPTION "The default game bundled in the Minetest engine. Mainly used as a modding base."
GROUP "Games"
)
cpack_add_component(SUBGAME_MINIMAL
DISPLAY_NAME "Development Test"
DESCRIPTION "A basic testing environment used for engine development and sometimes for testing mods."
DISABLED #DISABLED does not mean it is disabled, and is just not selected by default.
GROUP "Games"
)
cpack_add_component_group(Subgames
DESCRIPTION "Games for the Minetest engine."
)
if(WIN32)
# Include all dynamically linked runtime libaries such as MSVCRxxx.dll
# Include all dynamically linked runtime libraries such as MSVCRxxx.dll
include(InstallRequiredSystemLibraries)
if(RUN_IN_PLACE)
@@ -390,13 +400,15 @@ include(CPack)
# Add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
if(BUILD_DOCUMENTATION)
find_package(Doxygen)
if(DOXYGEN_FOUND)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile @ONLY)
add_custom_target(doc
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/doc/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
endif()
endif()

1
CNAME Normal file
View File

@@ -0,0 +1 @@
api.minetest.net

502
COPYING.LESSER Normal file
View File

@@ -0,0 +1,502 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 2.1, February 1999
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
[This is the first released version of the Lesser GPL. It also counts
as the successor of the GNU Library Public License, version 2, hence
the version number 2.1.]
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.
This license, the Lesser General Public License, applies to some
specially designated software packages--typically libraries--of the
Free Software Foundation and other authors who decide to use it. You
can use it too, but we suggest you first think carefully about whether
this license or the ordinary General Public License is the better
strategy to use in any particular case, based on the explanations below.
When we speak of free software, we are referring to freedom of use,
not price. Our General Public Licenses are designed to make sure that
you have the freedom to distribute copies of free software (and charge
for this service if you wish); that you receive source code or can get
it if you want it; that you can change the software and use pieces of
it in new free programs; and that you are informed that you can do
these things.
To protect your rights, we need to make restrictions that forbid
distributors to deny you these rights or to ask you to surrender these
rights. These restrictions translate to certain responsibilities for
you if you distribute copies of the library or if you modify it.
For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you. You must make sure that they, too, receive or can get the source
code. If you link other code with the library, you must provide
complete object files to the recipients, so that they can relink them
with the library after making changes to the library and recompiling
it. And you must show them these terms so they know their rights.
We protect your rights with a two-step method: (1) we copyright the
library, and (2) we offer you this license, which gives you legal
permission to copy, distribute and/or modify the library.
To protect each distributor, we want to make it very clear that
there is no warranty for the free library. Also, if the library is
modified by someone else and passed on, the recipients should know
that what they have is not the original version, so that the original
author's reputation will not be affected by problems that might be
introduced by others.
Finally, software patents pose a constant threat to the existence of
any free program. We wish to make sure that a company cannot
effectively restrict the users of a free program by obtaining a
restrictive license from a patent holder. Therefore, we insist that
any patent license obtained for a version of the library must be
consistent with the full freedom of use specified in this license.
Most GNU software, including some libraries, is covered by the
ordinary GNU General Public License. This license, the GNU Lesser
General Public License, applies to certain designated libraries, and
is quite different from the ordinary General Public License. We use
this license for certain libraries in order to permit linking those
libraries into non-free programs.
When a program is linked with a library, whether statically or using
a shared library, the combination of the two is legally speaking a
combined work, a derivative of the original library. The ordinary
General Public License therefore permits such linking only if the
entire combination fits its criteria of freedom. The Lesser General
Public License permits more lax criteria for linking other code with
the library.
We call this license the "Lesser" General Public License because it
does Less to protect the user's freedom than the ordinary General
Public License. It also provides other free software developers Less
of an advantage over competing non-free programs. These disadvantages
are the reason we use the ordinary General Public License for many
libraries. However, the Lesser license provides advantages in certain
special circumstances.
For example, on rare occasions, there may be a special need to
encourage the widest possible use of a certain library, so that it becomes
a de-facto standard. To achieve this, non-free programs must be
allowed to use the library. A more frequent case is that a free
library does the same job as widely used non-free libraries. In this
case, there is little to gain by limiting the free library to free
software only, so we use the Lesser General Public License.
In other cases, permission to use a particular library in non-free
programs enables a greater number of people to use a large body of
free software. For example, permission to use the GNU C Library in
non-free programs enables many more people to use the whole GNU
operating system, as well as its variant, the GNU/Linux operating
system.
Although the Lesser General Public License is Less protective of the
users' freedom, it does ensure that the user of a program that is
linked with the Library has the freedom and the wherewithal to run
that program using a modified version of the Library.
The precise terms and conditions for copying, distribution and
modification follow. Pay close attention to the difference between a
"work based on the library" and a "work that uses the library". The
former contains code derived from the library, whereas the latter must
be combined with the library in order to run.
GNU LESSER GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any software library or other
program which contains a notice placed by the copyright holder or
other authorized party saying it may be distributed under the terms of
this Lesser General Public License (also called "this License").
Each licensee is addressed as "you".
A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.
The "Library", below, refers to any such software library or work
which has been distributed under these terms. A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language. (Hereinafter, translation is
included without limitation in the term "modification".)
"Source code" for a work means the preferred form of the work for
making modifications to it. For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it). Whether that is true depends on what the Library does
and what the program that uses the Library does.
1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.
You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) The modified work must itself be a software library.
b) You must cause the files modified to carry prominent notices
stating that you changed the files and the date of any change.
c) You must cause the whole of the work to be licensed at no
charge to all third parties under the terms of this License.
d) If a facility in the modified Library refers to a function or a
table of data to be supplied by an application program that uses
the facility, other than as an argument passed when the facility
is invoked, then you must make a good faith effort to ensure that,
in the event an application does not supply such function or
table, the facility still operates, and performs whatever part of
its purpose remains meaningful.
(For example, a function in a library to compute square roots has
a purpose that is entirely well-defined independent of the
application. Therefore, Subsection 2d requires that any
application-supplied function or table used by this function must
be optional: if the application does not supply it, the square
root function must still compute square roots.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.
In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library. To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License. (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.) Do not make any other change in
these notices.
Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.
This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.
4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.
If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.
5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library". Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.
However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library". The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.
When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library. The
threshold for this to be true is not precisely defined by law.
If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work. (Executables containing this object code plus portions of the
Library will still fall under Section 6.)
Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
6. As an exception to the Sections above, you may also combine or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.
You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License. You must supply a copy of this License. If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License. Also, you must do one
of these things:
a) Accompany the work with the complete corresponding
machine-readable source code for the Library including whatever
changes were used in the work (which must be distributed under
Sections 1 and 2 above); and, if the work is an executable linked
with the Library, with the complete machine-readable "work that
uses the Library", as object code and/or source code, so that the
user can modify the Library and then relink to produce a modified
executable containing the modified Library. (It is understood
that the user who changes the contents of definitions files in the
Library will not necessarily be able to recompile the application
to use the modified definitions.)
b) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (1) uses at run time a
copy of the library already present on the user's computer system,
rather than copying library functions into the executable, and (2)
will operate properly with a modified version of the library, if
the user installs one, as long as the modified version is
interface-compatible with the version that the work was made with.
c) Accompany the work with a written offer, valid for at
least three years, to give the same user the materials
specified in Subsection 6a, above, for a charge no more
than the cost of performing this distribution.
d) If distribution of the work is made by offering access to copy
from a designated place, offer equivalent access to copy the above
specified materials from the same place.
e) Verify that the user has already received a copy of these
materials or that you have already sent this user a copy.
For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it. However, as a special exception,
the materials to be distributed need not include anything that is
normally distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.
It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system. Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:
a) Accompany the combined library with a copy of the same work
based on the Library, uncombined with any other library
facilities. This must be distributed under the terms of the
Sections above.
b) Give prominent notice with the combined library of the fact
that part of it is a work based on the Library, and explaining
where to find the accompanying uncombined form of the same work.
8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License. Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License. However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.
9. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Library or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.
10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties with
this License.
11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all. For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.
If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded. In such case, this License incorporates the limitation as if
written in the body of this License.
13. The Free Software Foundation may publish revised and/or new
versions of the Lesser General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation. If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission. For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this. Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.
NO WARRANTY
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Libraries
If you develop a new library, and you want it to be of the greatest
possible use to the public, we recommend making it free software that
everyone can redistribute and change. You can do so by permitting
redistribution under these terms (or, alternatively, under the terms of the
ordinary General Public License).
To apply these terms, attach the following notices to the library. It is
safest to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
<one line to give the library's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the library, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
<signature of Ty Coon>, 1 April 1990
Ty Coon, President of Vice
That's all there is to it!

View File

@@ -1,8 +1,40 @@
ARG DOCKER_IMAGE=alpine:3.14
FROM $DOCKER_IMAGE AS builder
ARG DOCKER_IMAGE=alpine:3.16
FROM $DOCKER_IMAGE AS dev
ENV MINETEST_GAME_VERSION master
ENV IRRLICHT_VERSION master
ENV SPATIALINDEX_VERSION 1.9.3
ENV LUAJIT_VERSION v2.1
RUN apk add --no-cache git build-base cmake curl-dev zlib-dev zstd-dev \
sqlite-dev postgresql-dev hiredis-dev leveldb-dev \
gmp-dev jsoncpp-dev ninja ca-certificates
WORKDIR /usr/src/
RUN git clone --recursive https://github.com/jupp0r/prometheus-cpp/ && \
cd prometheus-cpp && \
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_TESTING=0 \
-GNinja && \
cmake --build build && \
cmake --install build && \
cd /usr/src/ && \
git clone --recursive https://github.com/libspatialindex/libspatialindex -b ${SPATIALINDEX_VERSION} && \
cd libspatialindex && \
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr/local && \
cmake --build build && \
cmake --install build && \
cd /usr/src/ && \
git clone --recursive https://luajit.org/git/luajit.git -b ${LUAJIT_VERSION} && \
cd luajit && \
make && make install && \
cd /usr/src/ && \
git clone --depth=1 https://github.com/minetest/irrlicht/ -b ${IRRLICHT_VERSION} && \
cp -r irrlicht/include /usr/include/irrlichtmt
FROM dev as builder
COPY .git /usr/src/minetest/.git
COPY CMakeLists.txt /usr/src/minetest/CMakeLists.txt
@@ -18,27 +50,6 @@ COPY po /usr/src/minetest/po
COPY src /usr/src/minetest/src
COPY textures /usr/src/minetest/textures
WORKDIR /usr/src/minetest
RUN apk add --no-cache git build-base cmake sqlite-dev curl-dev zlib-dev zstd-dev \
gmp-dev jsoncpp-dev postgresql-dev ninja luajit-dev ca-certificates && \
git clone --depth=1 -b ${MINETEST_GAME_VERSION} https://github.com/minetest/minetest_game.git ./games/minetest_game && \
rm -fr ./games/minetest_game/.git
WORKDIR /usr/src/
RUN git clone --recursive https://github.com/jupp0r/prometheus-cpp/ && \
cd prometheus-cpp && \
cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_TESTING=0 \
-GNinja && \
cmake --build build && \
cmake --install build
RUN git clone --depth=1 https://github.com/minetest/irrlicht/ -b ${IRRLICHT_VERSION} && \
cp -r irrlicht/include /usr/include/irrlichtmt
WORKDIR /usr/src/minetest
RUN cmake -B build \
-DCMAKE_INSTALL_PREFIX=/usr/local \
@@ -51,10 +62,11 @@ RUN cmake -B build \
cmake --build build && \
cmake --install build
ARG DOCKER_IMAGE=alpine:3.14
ARG DOCKER_IMAGE=alpine:3.16
FROM $DOCKER_IMAGE AS runtime
RUN apk add --no-cache sqlite-libs curl gmp libstdc++ libgcc libpq luajit jsoncpp zstd-libs && \
RUN apk add --no-cache curl gmp libstdc++ libgcc libpq jsoncpp zstd-libs \
sqlite-libs postgresql hiredis leveldb && \
adduser -D minetest --uid 30000 -h /var/lib/minetest && \
chown -R minetest:minetest /var/lib/minetest
@@ -63,9 +75,12 @@ WORKDIR /var/lib/minetest
COPY --from=builder /usr/local/share/minetest /usr/local/share/minetest
COPY --from=builder /usr/local/bin/minetestserver /usr/local/bin/minetestserver
COPY --from=builder /usr/local/share/doc/minetest/minetest.conf.example /etc/minetest/minetest.conf
COPY --from=builder /usr/local/lib/libspatialindex* /usr/local/lib/
COPY --from=builder /usr/local/lib/libluajit* /usr/local/lib/
USER minetest:minetest
EXPOSE 30000/udp 30000/tcp
VOLUME /var/lib/minetest/ /etc/minetest/
CMD ["/usr/local/bin/minetestserver", "--config", "/etc/minetest/minetest.conf"]
ENTRYPOINT ["/usr/local/bin/minetestserver"]
CMD ["--config", "/etc/minetest/minetest.conf"]

View File

@@ -14,6 +14,9 @@ https://www.apache.org/licenses/LICENSE-2.0.html
Textures by Zughy are under CC BY-SA 4.0
https://creativecommons.org/licenses/by-sa/4.0/
Media files by DS are under CC BY-SA 4.0
https://creativecommons.org/licenses/by-sa/4.0/
textures/base/pack/server_public.png is under CC-BY 4.0, taken from Twitter's Twemoji set
https://creativecommons.org/licenses/by/4.0/
@@ -55,24 +58,40 @@ srifqi:
Zughy:
textures/base/pack/cdb_add.png
textures/base/pack/cdb_clear.png
textures/base/pack/cdb_downloading.png
textures/base/pack/cdb_queued.png
textures/base/pack/cdb_update.png
textures/base/pack/cdb_update_cropped.png
textures/base/pack/cdb_viewonline.png
textures/base/pack/settings_btn.png
textures/base/pack/settings_info.png
textures/base/pack/settings_reset.png
appgurueu:
textures/base/pack/server_incompatible.png
erlehmann, Warr1024, rollerozxa:
textures/base/pack/no_screenshot.png
kilbith:
textures/base/pack/server_favorite.png
textures/base/pack/progress_bar.png
textures/base/pack/progress_bar_bg.png
SmallJoker
SmallJoker:
textures/base/pack/cdb_clear.png
textures/base/pack/server_favorite_delete.png (based on server_favorite.png)
DS:
games/devtest/mods/soundstuff/textures/soundstuff_bigfoot.png
games/devtest/mods/soundstuff/textures/soundstuff_jukebox.png
games/devtest/mods/soundstuff/textures/soundstuff_racecar.png
games/devtest/mods/soundstuff/sounds/soundstuff_sinus.ogg
games/devtest/mods/testtools/textures/testtools_branding_iron.png
grorp:
textures/base/pack/exit_btn.png
License of Minetest source code
-------------------------------

332
README.md
View File

@@ -10,12 +10,6 @@ Minetest is a free open-source voxel game engine with easy modding and game crea
Copyright (C) 2010-2022 Perttu Ahola <celeron55@gmail.com>
and contributors (see source file comments and the version control log)
In case you downloaded the source code
--------------------------------------
If you downloaded the Minetest Engine source code in which this file is
contained, you probably want to download the [Minetest Game](https://github.com/minetest/minetest_game/)
project too. See its README.txt for more information.
Table of Contents
------------------
@@ -51,7 +45,7 @@ Some can be changed in the key config dialog in the settings tab.
| Shift | Sneak/move down |
| Q | Drop itemstack |
| Shift + Q | Drop single item |
| Left mouse button | Dig/punch/take item |
| Left mouse button | Dig/punch/use |
| Right mouse button | Place/use |
| Shift + right mouse button | Build (without using) |
| I | Inventory menu |
@@ -61,11 +55,9 @@ Some can be changed in the key config dialog in the settings tab.
| T | Chat |
| / | Command |
| Esc | Pause menu/abort/exit (pauses only singleplayer game) |
| R | Enable/disable full range view |
| + | Increase view range |
| - | Decrease view range |
| K | Enable/disable fly mode (needs fly privilege) |
| P | Enable/disable pitch move mode |
| J | Enable/disable fast mode (needs fast privilege) |
| H | Enable/disable noclip mode (needs noclip privilege) |
| E | Aux1 (Move fast in fast mode. Games may add special features) |
@@ -98,15 +90,15 @@ Where each location is on each platform:
* Windows installed:
* `bin` = `C:\Program Files\Minetest\bin (Depends on the install location)`
* `share` = `C:\Program Files\Minetest (Depends on the install location)`
* `user` = `%APPDATA%\Minetest`
* `user` = `%APPDATA%\Minetest` or `%MINETEST_USER_PATH%`
* Linux installed:
* `bin` = `/usr/bin`
* `share` = `/usr/share/minetest`
* `user` = `~/.minetest`
* `user` = `~/.minetest` or `$MINETEST_USER_PATH`
* macOS:
* `bin` = `Contents/MacOS`
* `share` = `Contents/Resources`
* `user` = `Contents/User OR ~/Library/Application Support/minetest`
* `user` = `Contents/User` or `~/Library/Application Support/minetest` or `$MINETEST_USER_PATH`
Worlds can be found as separate folders in: `user/worlds/`
@@ -126,320 +118,16 @@ Command-line options
Compiling
---------
### Compiling on GNU/Linux
#### Dependencies
| Dependency | Version | Commentary |
|------------|---------|------------|
| GCC | 5.1+ | or Clang 3.5+ |
| CMake | 3.5+ | |
| IrrlichtMt | - | Custom version of Irrlicht, see https://github.com/minetest/irrlicht |
| Freetype | 2.0+ | |
| SQLite3 | 3+ | |
| Zstd | 1.0+ | |
| LuaJIT | 2.0+ | Bundled Lua 5.1 is used if not present |
| GMP | 5.0.0+ | Bundled mini-GMP is used if not present |
| JsonCPP | 1.0.0+ | Bundled JsonCPP is used if not present |
For Debian/Ubuntu users:
sudo apt install g++ make libc6-dev cmake libpng-dev libjpeg-dev libxi-dev libgl1-mesa-dev libsqlite3-dev libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev libzstd-dev libluajit-5.1-dev
For Fedora users:
sudo dnf install make automake gcc gcc-c++ kernel-devel cmake libcurl-devel openal-soft-devel libvorbis-devel libXi-devel libogg-devel freetype-devel mesa-libGL-devel zlib-devel jsoncpp-devel gmp-devel sqlite-devel luajit-devel leveldb-devel ncurses-devel spatialindex-devel libzstd-devel
For Arch users:
sudo pacman -S base-devel libcurl-gnutls cmake libxi libpng sqlite libogg libvorbis openal freetype2 jsoncpp gmp luajit leveldb ncurses zstd
For Alpine users:
sudo apk add build-base cmake libpng-dev jpeg-dev libxi-dev mesa-dev sqlite-dev libogg-dev libvorbis-dev openal-soft-dev curl-dev freetype-dev zlib-dev gmp-dev jsoncpp-dev luajit-dev zstd-dev
#### Download
You can install Git for easily keeping your copy up to date.
If you dont want Git, read below on how to get the source without Git.
This is an example for installing Git on Debian/Ubuntu:
sudo apt install git
For Fedora users:
sudo dnf install git
Download source (this is the URL to the latest of source repository, which might not work at all times) using Git:
git clone --depth 1 https://github.com/minetest/minetest.git
cd minetest
Download minetest_game (otherwise only the "Development Test" game is available) using Git:
git clone --depth 1 https://github.com/minetest/minetest_game.git games/minetest_game
Download IrrlichtMt to `lib/irrlichtmt`, it will be used to satisfy the IrrlichtMt dependency that way:
git clone --depth 1 https://github.com/minetest/irrlicht.git lib/irrlichtmt
Download source, without using Git:
wget https://github.com/minetest/minetest/archive/master.tar.gz
tar xf master.tar.gz
cd minetest-master
Download minetest_game, without using Git:
cd games/
wget https://github.com/minetest/minetest_game/archive/master.tar.gz
tar xf master.tar.gz
mv minetest_game-master minetest_game
cd ..
Download IrrlichtMt, without using Git:
cd lib/
wget https://github.com/minetest/irrlicht/archive/master.tar.gz
tar xf master.tar.gz
mv irrlicht-master irrlichtmt
cd ..
#### Build
Build a version that runs directly from the source directory:
cmake . -DRUN_IN_PLACE=TRUE
make -j$(nproc)
Run it:
./bin/minetest
- Use `cmake . -LH` to see all CMake options and their current state.
- If you want to install it system-wide (or are making a distribution package),
you will want to use `-DRUN_IN_PLACE=FALSE`.
- You can build a bare server by specifying `-DBUILD_SERVER=TRUE`.
- You can disable the client build by specifying `-DBUILD_CLIENT=FALSE`.
- You can select between Release and Debug build by `-DCMAKE_BUILD_TYPE=<Debug or Release>`.
- Debug build is slower, but gives much more useful output in a debugger.
- If you build a bare server you don't need to compile IrrlichtMt, just the headers suffice.
- In that case use `-DIRRLICHT_INCLUDE_DIR=/some/where/irrlichtmt/include`.
- Minetest will use the IrrlichtMt package that is found first, given by the following order:
1. Specified `IRRLICHTMT_BUILD_DIR` CMake variable
2. `${PROJECT_SOURCE_DIR}/lib/irrlichtmt` (if existent)
3. Installation of IrrlichtMt in the system-specific library paths
4. For server builds with disabled `BUILD_CLIENT` variable, the headers from `IRRLICHT_INCLUDE_DIR` will be used.
- NOTE: Changing the IrrlichtMt build directory (includes system installs) requires regenerating the CMake cache (`rm CMakeCache.txt`)
### CMake options
General options and their default values:
BUILD_CLIENT=TRUE - Build Minetest client
BUILD_SERVER=FALSE - Build Minetest server
BUILD_UNITTESTS=TRUE - Build unittest sources
BUILD_BENCHMARKS=FALSE - Build benchmark sources
CMAKE_BUILD_TYPE=Release - Type of build (Release vs. Debug)
Release - Release build
Debug - Debug build
SemiDebug - Partially optimized debug build
RelWithDebInfo - Release build with debug information
MinSizeRel - Release build with -Os passed to compiler to make executable as small as possible
ENABLE_CURL=ON - Build with cURL; Enables use of online mod repo, public serverlist and remote media fetching via http
ENABLE_CURSES=ON - Build with (n)curses; Enables a server side terminal (command line option: --terminal)
ENABLE_GETTEXT=ON - Build with Gettext; Allows using translations
ENABLE_GLES=OFF - Enable extra support code for OpenGL ES (requires support by IrrlichtMt)
ENABLE_LEVELDB=ON - Build with LevelDB; Enables use of LevelDB map backend
ENABLE_POSTGRESQL=ON - Build with libpq; Enables use of PostgreSQL map backend (PostgreSQL 9.5 or greater recommended)
ENABLE_REDIS=ON - Build with libhiredis; Enables use of Redis map backend
ENABLE_SPATIAL=ON - Build with LibSpatial; Speeds up AreaStores
ENABLE_SOUND=ON - Build with OpenAL, libogg & libvorbis; in-game sounds
ENABLE_LUAJIT=ON - Build with LuaJIT (much faster than non-JIT Lua)
ENABLE_PROMETHEUS=OFF - Build with Prometheus metrics exporter (listens on tcp/30000 by default)
ENABLE_SYSTEM_GMP=ON - Use GMP from system (much faster than bundled mini-gmp)
ENABLE_SYSTEM_JSONCPP=ON - Use JsonCPP from system
RUN_IN_PLACE=FALSE - Create a portable install (worlds, settings etc. in current directory)
ENABLE_UPDATE_CHECKER=TRUE - Whether to enable update checks by default
USE_GPROF=FALSE - Enable profiling using GProf
VERSION_EXTRA= - Text to append to version (e.g. VERSION_EXTRA=foobar -> Minetest 0.4.9-foobar)
ENABLE_TOUCH=FALSE - Enable Touchscreen support (requires support by IrrlichtMt)
Library specific options:
CURL_DLL - Only if building with cURL on Windows; path to libcurl.dll
CURL_INCLUDE_DIR - Only if building with cURL; directory where curl.h is located
CURL_LIBRARY - Only if building with cURL; path to libcurl.a/libcurl.so/libcurl.lib
EGL_INCLUDE_DIR - Only if building with GLES; directory that contains egl.h
EGL_LIBRARY - Only if building with GLES; path to libEGL.a/libEGL.so
EXTRA_DLL - Only on Windows; optional paths to additional DLLs that should be packaged
FREETYPE_INCLUDE_DIR_freetype2 - Directory that contains files such as ftimage.h
FREETYPE_INCLUDE_DIR_ft2build - Directory that contains ft2build.h
FREETYPE_LIBRARY - Path to libfreetype.a/libfreetype.so/freetype.lib
FREETYPE_DLL - Only on Windows; path to libfreetype-6.dll
GETTEXT_DLL - Only when building with gettext on Windows; paths to libintl + libiconv DLLs
GETTEXT_INCLUDE_DIR - Only when building with gettext; directory that contains iconv.h
GETTEXT_LIBRARY - Only when building with gettext on Windows; path to libintl.dll.a
GETTEXT_MSGFMT - Only when building with gettext; path to msgfmt/msgfmt.exe
IRRLICHT_DLL - Only on Windows; path to IrrlichtMt.dll
IRRLICHT_INCLUDE_DIR - Directory that contains IrrCompileConfig.h (usable for server build only)
LEVELDB_INCLUDE_DIR - Only when building with LevelDB; directory that contains db.h
LEVELDB_LIBRARY - Only when building with LevelDB; path to libleveldb.a/libleveldb.so/libleveldb.dll.a
LEVELDB_DLL - Only when building with LevelDB on Windows; path to libleveldb.dll
PostgreSQL_INCLUDE_DIR - Only when building with PostgreSQL; directory that contains libpq-fe.h
PostgreSQL_LIBRARY - Only when building with PostgreSQL; path to libpq.a/libpq.so/libpq.lib
REDIS_INCLUDE_DIR - Only when building with Redis; directory that contains hiredis.h
REDIS_LIBRARY - Only when building with Redis; path to libhiredis.a/libhiredis.so
SPATIAL_INCLUDE_DIR - Only when building with LibSpatial; directory that contains spatialindex/SpatialIndex.h
SPATIAL_LIBRARY - Only when building with LibSpatial; path to libspatialindex_c.so/spatialindex-32.lib
LUA_INCLUDE_DIR - Only if you want to use LuaJIT; directory where luajit.h is located
LUA_LIBRARY - Only if you want to use LuaJIT; path to libluajit.a/libluajit.so
OGG_DLL - Only if building with sound on Windows; path to libogg.dll
OGG_INCLUDE_DIR - Only if building with sound; directory that contains an ogg directory which contains ogg.h
OGG_LIBRARY - Only if building with sound; path to libogg.a/libogg.so/libogg.dll.a
OPENAL_DLL - Only if building with sound on Windows; path to OpenAL32.dll
OPENAL_INCLUDE_DIR - Only if building with sound; directory where al.h is located
OPENAL_LIBRARY - Only if building with sound; path to libopenal.a/libopenal.so/OpenAL32.lib
SQLITE3_INCLUDE_DIR - Directory that contains sqlite3.h
SQLITE3_LIBRARY - Path to libsqlite3.a/libsqlite3.so/sqlite3.lib
VORBISFILE_LIBRARY - Only if building with sound; path to libvorbisfile.a/libvorbisfile.so/libvorbisfile.dll.a
VORBIS_DLL - Only if building with sound on Windows; paths to vorbis DLLs
VORBIS_INCLUDE_DIR - Only if building with sound; directory that contains a directory vorbis with vorbisenc.h inside
VORBIS_LIBRARY - Only if building with sound; path to libvorbis.a/libvorbis.so/libvorbis.dll.a
ZLIB_DLL - Only on Windows; path to zlib1.dll
ZLIB_INCLUDE_DIR - Directory that contains zlib.h
ZLIB_LIBRARY - Path to libz.a/libz.so/zlib.lib
ZSTD_DLL - Only on Windows; path to libzstd.dll
ZSTD_INCLUDE_DIR - Directory that contains zstd.h
ZSTD_LIBRARY - Path to libzstd.a/libzstd.so/ztd.lib
### Compiling on Windows using MSVC
### Requirements
- [Visual Studio 2015 or newer](https://visualstudio.microsoft.com)
- [CMake](https://cmake.org/download/)
- [vcpkg](https://github.com/Microsoft/vcpkg)
- [Git](https://git-scm.com/downloads)
### Compiling and installing the dependencies
It is highly recommended to use vcpkg as package manager.
After you successfully built vcpkg you can easily install the required libraries:
```powershell
vcpkg install zlib zstd curl[winssl] openal-soft libvorbis libogg libjpeg-turbo sqlite3 freetype luajit gmp jsoncpp opengl-registry --triplet x64-windows
```
- **Don't forget about IrrlichtMt.** The easiest way is to clone it to `lib/irrlichtmt` as described in the Linux section.
- `curl` is optional, but required to read the serverlist, `curl[winssl]` is required to use the content store.
- `openal-soft`, `libvorbis` and `libogg` are optional, but required to use sound.
- `luajit` is optional, it replaces the integrated Lua interpreter with a faster just-in-time interpreter.
- `gmp` and `jsoncpp` are optional, otherwise the bundled versions will be compiled
There are other optional libraries, but they are not tested if they can build and link correctly.
Use `--triplet` to specify the target triplet, e.g. `x64-windows` or `x86-windows`.
### Compile Minetest
#### a) Using the vcpkg toolchain and CMake GUI
1. Start up the CMake GUI
2. Select **Browse Source...** and select DIR/minetest
3. Select **Browse Build...** and select DIR/minetest-build
4. Select **Configure**
5. Choose the right visual Studio version and target platform. It has to match the version of the installed dependencies
6. Choose **Specify toolchain file for cross-compiling**
7. Click **Next**
8. Select the vcpkg toolchain file e.g. `D:/vcpkg/scripts/buildsystems/vcpkg.cmake`
9. Click Finish
10. Wait until cmake have generated the cash file
11. If there are any errors, solve them and hit **Configure**
12. Click **Generate**
13. Click **Open Project**
14. Compile Minetest inside Visual studio.
#### b) Using the vcpkg toolchain and the commandline
Run the following script in PowerShell:
```powershell
cmake . -G"Visual Studio 15 2017 Win64" -DCMAKE_TOOLCHAIN_FILE=D:/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_GETTEXT=OFF -DENABLE_CURSES=OFF
cmake --build . --config Release
```
Make sure that the right compiler is selected and the path to the vcpkg toolchain is correct.
### Windows Installer using WiX Toolset
Requirements:
* [Visual Studio 2017](https://visualstudio.microsoft.com/)
* [WiX Toolset](https://wixtoolset.org/)
In the Visual Studio 2017 Installer select **Optional Features -> WiX Toolset**.
Build the binaries as described above, but make sure you unselect `RUN_IN_PLACE`.
Open the generated project file with Visual Studio. Right-click **Package** and choose **Generate**.
It may take some minutes to generate the installer.
### Compiling on MacOS
#### Requirements
- [Homebrew](https://brew.sh/)
- [Git](https://git-scm.com/downloads)
Install dependencies with homebrew:
```
brew install cmake freetype gettext gmp hiredis jpeg jsoncpp leveldb libogg libpng libvorbis luajit zstd
```
#### Download
Download source (this is the URL to the latest of source repository, which might not work at all times) using Git:
```bash
git clone --depth 1 https://github.com/minetest/minetest.git
cd minetest
```
Download minetest_game (otherwise only the "Development Test" game is available) using Git:
```
git clone --depth 1 https://github.com/minetest/minetest_game.git games/minetest_game
```
Download Minetest's fork of Irrlicht:
```
git clone --depth 1 https://github.com/minetest/irrlicht.git lib/irrlichtmt
```
#### Build
```bash
mkdir build
cd build
cmake .. \
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.14 \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DCMAKE_INSTALL_PREFIX=../build/macos/ \
-DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE
make -j$(sysctl -n hw.logicalcpu)
make install
```
#### Run
```
open ./build/macos/minetest.app
```
- [Compiling on GNU/Linux](doc/compiling/linux.md)
- [Compiling on Windows](doc/compiling/windows.md)
- [Compiling on MacOS](doc/compiling/macos.md)
Docker
------
- [Developing minetestserver with Docker](doc/developing/docker.md)
We provide Minetest server Docker images using the GitLab mirror registry.
Images are built on each commit and available using the following tag scheme:

View File

@@ -1,12 +1,13 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion '30.0.3'
compileSdkVersion 33
buildToolsVersion '33.0.2'
ndkVersion "$ndk_version"
defaultConfig {
applicationId 'net.minetest.minetest'
minSdkVersion 16
targetSdkVersion 30
minSdkVersion 21
targetSdkVersion 33
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
versionCode project.versionCode
}
@@ -40,7 +41,7 @@ android {
abi {
enable true
reset()
include 'armeabi-v7a', 'arm64-v8a'
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
@@ -52,51 +53,60 @@ android {
task prepareAssets() {
def assetsFolder = "build/assets"
def projRoot = "../.."
def gameToCopy = "minetest_game"
def projRoot = rootDir.parent
copy {
from "${projRoot}/minetest.conf.example", "${projRoot}/README.md" into assetsFolder
// See issue #4638
def unsupportedLanguages = new File("${projRoot}/src/unsupported_language_list.txt").text.readLines()
doFirst {
logger.lifecycle('Preparing assets at {}', assetsFolder)
}
copy {
from "${projRoot}/doc/lgpl-2.1.txt" into "${assetsFolder}"
}
copy {
from "${projRoot}/builtin" into "${assetsFolder}/builtin"
}
copy {
from "${projRoot}/client/shaders" into "${assetsFolder}/client/shaders"
}
copy {
from "../native/deps/armeabi-v7a/Irrlicht/Shaders" into "${assetsFolder}/client/shaders/Irrlicht"
}
copy {
from "${projRoot}/fonts" include "*.ttf" into "${assetsFolder}/fonts"
}
copy {
from "${projRoot}/games/${gameToCopy}" into "${assetsFolder}/games/${gameToCopy}"
}
fileTree("${projRoot}/po").include("**/*.po").forEach { poFile ->
def moPath = "${assetsFolder}/locale/${poFile.parentFile.name}/LC_MESSAGES/"
file(moPath).mkdirs()
exec {
commandLine 'msgfmt', '-o', "${moPath}/minetest.mo", poFile
doLast {
copy {
from "${projRoot}/minetest.conf.example", "${projRoot}/README.md" into assetsFolder
}
}
copy {
from "${projRoot}/textures" into "${assetsFolder}/textures"
copy {
from "${projRoot}/doc/lgpl-2.1.txt" into assetsFolder
}
copy {
from "${projRoot}/builtin" into "${assetsFolder}/builtin"
}
copy {
from "${projRoot}/client/shaders" into "${assetsFolder}/client/shaders"
}
copy {
from "../native/deps/armeabi-v7a/Irrlicht/Shaders" into "${assetsFolder}/client/shaders/Irrlicht"
}
copy {
from "${projRoot}/fonts" include "*.ttf" into "${assetsFolder}/fonts"
}
copy {
from "${projRoot}/textures/base/pack" into "${assetsFolder}/textures/base/pack"
}
// compile translations
fileTree("${projRoot}/po").include("**/*.po").grep {
it.parentFile.name !in unsupportedLanguages
}.forEach { poFile ->
def moPath = "${assetsFolder}/locale/${poFile.parentFile.name}/LC_MESSAGES/"
file(moPath).mkdirs()
exec {
commandLine 'msgfmt', '-o', "${moPath}/minetest.mo", poFile
}
}
file("${assetsFolder}/.nomedia").text = ""
}
file("${assetsFolder}/.nomedia").text = "";
task zipAssets(type: Zip) {
archiveName "Minetest.zip"
from "${assetsFolder}"
destinationDir file("src/main/assets")
task zipAssets(dependsOn: prepareAssets, type: Zip) {
archiveFileName = "Minetest.zip"
from assetsFolder
destinationDirectory = file("src/main/assets")
}
}
preBuild.dependsOn zipAssets
prepareAssets.dependsOn ':native:getDeps'
// Map for the version code that gives each ABI a value.
import com.android.build.OutputFile
@@ -112,5 +122,5 @@ android.applicationVariants.all { variant ->
dependencies {
implementation project(':native')
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'androidx.appcompat:appcompat:1.6.1'
}

View File

@@ -5,19 +5,13 @@
android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!--
`android:requestLegacyExternalStorage="true"` is workaround for using `/sdcard`
instead of the `getFilesDir()` patch for assets. Check link below for more information:
https://developer.android.com/training/data-storage/compatibility
-->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-feature android:glEsVersion="0x00020000" />
<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/label"
android:requestLegacyExternalStorage="true"
android:resizeableActivity="false"
tools:ignore="UnusedAttribute">
@@ -52,7 +46,7 @@
</intent-filter>
<meta-data
android:name="android.app.lib_name"
android:value="Minetest" />
android:value="minetest" />
</activity>
<service

View File

@@ -2,6 +2,8 @@
Minetest
Copyright (C) 2014-2020 MoNTE48, Maksim Gamarnik <MoNTE48@mail.ua>
Copyright (C) 2014-2020 ubulem, Bektur Mambetov <berkut87@gmail.com>
Copyright (C) 2023 srifqi, Muhammad Rifqi Priyo Susanto
<muhammadrifqipriyosusanto@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -29,17 +31,52 @@ import androidx.appcompat.widget.AppCompatEditText;
import java.util.Objects;
public class CustomEditText extends AppCompatEditText {
private int editType = 2; // single line text input as default
private boolean wantsToShowKeyboard = false;
public CustomEditText(Context context) {
super(context);
}
public CustomEditText(Context context, int _editType) {
super(context);
editType = _editType;
}
@Override
public boolean onKeyPreIme(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
// For multi-line, do not close the dialog after pressing back button
if (editType != 1 && keyCode == KeyEvent.KEYCODE_BACK) {
InputMethodManager mgr = (InputMethodManager)
getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
Objects.requireNonNull(mgr).hideSoftInputFromWindow(this.getWindowToken(), 0);
}
return false;
}
@Override
public void onWindowFocusChanged(boolean hasWindowFocus) {
super.onWindowFocusChanged(hasWindowFocus);
tryShowKeyboard();
}
public void requestFocusTryShow() {
requestFocus();
wantsToShowKeyboard = true;
tryShowKeyboard();
}
private void tryShowKeyboard() {
if (hasWindowFocus() && wantsToShowKeyboard) {
if (isFocused()) {
CustomEditText that = this;
post(() -> {
final InputMethodManager imm = (InputMethodManager)
getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(that, 0);
});
}
wantsToShowKeyboard = false;
}
}
}

View File

@@ -23,7 +23,6 @@ package net.minetest.minetest;
import android.app.NativeActivity;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.text.InputType;
import android.util.Log;
@@ -32,7 +31,6 @@ import android.view.View;
import android.view.WindowManager;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.LinearLayout;
import androidx.annotation.Keep;
@@ -40,22 +38,22 @@ import androidx.appcompat.app.AlertDialog;
import androidx.core.content.FileProvider;
import java.io.File;
import java.util.Locale;
import java.util.Objects;
// Native code finds these methods by name (see porting_android.cpp).
// This annotation prevents the minifier/Proguard from mangling them.
@Keep
@SuppressWarnings("unused")
public class GameActivity extends NativeActivity {
static {
System.loadLibrary("c++_shared");
System.loadLibrary("Minetest");
System.loadLibrary("minetest");
}
private int messageReturnCode = -1;
private String messageReturnValue = "";
public static native void putMessageBoxResult(String text);
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@@ -63,11 +61,10 @@ public class GameActivity extends NativeActivity {
}
private void makeFullScreen() {
if (Build.VERSION.SDK_INT >= 19)
this.getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
this.getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_HIDE_NAVIGATION |
View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
}
@Override
@@ -83,6 +80,17 @@ public class GameActivity extends NativeActivity {
makeFullScreen();
}
private native void saveSettings();
@Override
protected void onStop() {
super.onStop();
// Avoid losing setting changes in case the app is onDestroy()ed later.
// Saving stuff in onStop() is recommended in the Android activity
// lifecycle documentation.
saveSettings();
}
@Override
public void onBackPressed() {
// Ignore the back press so Minetest can handle it
@@ -98,21 +106,11 @@ public class GameActivity extends NativeActivity {
container.setOrientation(LinearLayout.VERTICAL);
builder.setView(container);
AlertDialog alertDialog = builder.create();
EditText editText;
// For multi-line, do not close the dialog after pressing back button
if (editType == 1) {
editText = new EditText(this);
} else {
editText = new CustomEditText(this);
}
CustomEditText editText = new CustomEditText(this, editType);
container.addView(editText);
editText.setMaxLines(8);
editText.requestFocus();
editText.setHint(hint);
editText.setText(current);
final InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
Objects.requireNonNull(imm).toggleSoftInput(InputMethodManager.SHOW_FORCED,
InputMethodManager.HIDE_IMPLICIT_ONLY);
if (editType == 1)
editText.setInputType(InputType.TYPE_CLASS_TEXT |
InputType.TYPE_TEXT_FLAG_MULTI_LINE);
@@ -121,7 +119,8 @@ public class GameActivity extends NativeActivity {
InputType.TYPE_TEXT_VARIATION_PASSWORD);
else
editText.setInputType(InputType.TYPE_CLASS_TEXT);
editText.setSelection(editText.getText().length());
editText.setSelection(Objects.requireNonNull(editText.getText()).length());
final InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
editText.setOnKeyListener((view, keyCode, event) -> {
// For multi-line, do not submit the text after pressing Enter key
if (keyCode == KeyEvent.KEYCODE_ENTER && editType != 1) {
@@ -145,12 +144,13 @@ public class GameActivity extends NativeActivity {
alertDialog.dismiss();
}));
}
alertDialog.show();
alertDialog.setOnCancelListener(dialog -> {
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);
messageReturnValue = current;
messageReturnCode = -1;
});
alertDialog.show();
editText.requestFocusTryShow();
}
public int getDialogState() {
@@ -204,4 +204,28 @@ public class GameActivity extends NativeActivity {
Intent shareIntent = Intent.createChooser(intent, null);
startActivity(shareIntent);
}
public String getLanguage() {
String langCode = Locale.getDefault().getLanguage();
// getLanguage() still uses old language codes to preserve compatibility.
// List of code changes in ISO 639-2:
// https://www.loc.gov/standards/iso639-2/php/code_changes.php
switch (langCode) {
case "in":
langCode = "id"; // Indonesian
break;
case "iw":
langCode = "he"; // Hebrew
break;
case "ji":
langCode = "yi"; // Yiddish
break;
case "jw":
langCode = "jv"; // Javanese
break;
}
return langCode;
}
}

View File

@@ -20,38 +20,30 @@ with this program; if not, write to the Free Software Foundation, Inc.,
package net.minetest.minetest;
import android.Manifest;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import androidx.annotation.StringRes;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.core.content.ContextCompat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import static net.minetest.minetest.UnzipService.*;
public class MainActivity extends AppCompatActivity {
public static final String NOTIFICATION_CHANNEL_ID = "Minetest channel";
private final static int versionCode = BuildConfig.VERSION_CODE;
private final static int PERMISSIONS = 1;
private static final String[] REQUIRED_SDK_PERMISSIONS =
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE};
private static final String SETTINGS = "MinetestSettings";
private static final String TAG_VERSION_CODE = "versionCode";
@@ -95,59 +87,21 @@ public class MainActivity extends AppCompatActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
IntentFilter filter = new IntentFilter(ACTION_UPDATE);
registerReceiver(myReceiver, filter);
mProgressBar = findViewById(R.id.progressBar);
mTextView = findViewById(R.id.textView);
sharedPreferences = getSharedPreferences(SETTINGS, Context.MODE_PRIVATE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
checkPermission();
else
checkAppVersion();
}
checkAppVersion();
private void checkPermission() {
final List<String> missingPermissions = new ArrayList<>();
for (final String permission : REQUIRED_SDK_PERMISSIONS) {
final int result = ContextCompat.checkSelfPermission(this, permission);
if (result != PackageManager.PERMISSION_GRANTED)
missingPermissions.add(permission);
}
if (!missingPermissions.isEmpty()) {
final String[] permissions = missingPermissions
.toArray(new String[0]);
ActivityCompat.requestPermissions(this, permissions, PERMISSIONS);
} else {
final int[] grantResults = new int[REQUIRED_SDK_PERMISSIONS.length];
Arrays.fill(grantResults, PackageManager.PERMISSION_GRANTED);
onRequestPermissionsResult(PERMISSIONS, REQUIRED_SDK_PERMISSIONS, grantResults);
}
}
@Override
public void onRequestPermissionsResult(int requestCode,
@NonNull String[] permissions, @NonNull int[] grantResults) {
if (requestCode == PERMISSIONS) {
for (int grantResult : grantResults) {
if (grantResult != PackageManager.PERMISSION_GRANTED) {
Toast.makeText(this, R.string.not_granted, Toast.LENGTH_LONG).show();
finish();
return;
}
}
checkAppVersion();
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
createNotificationChannel();
}
private void checkAppVersion() {
if (!Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
Toast.makeText(this, R.string.no_external_storage, Toast.LENGTH_LONG).show();
finish();
return;
}
if (UnzipService.getIsRunning()) {
mProgressBar.setVisibility(View.VISIBLE);
mProgressBar.setIndeterminate(true);
@@ -172,6 +126,28 @@ public class MainActivity extends AppCompatActivity {
startActivity(intent);
}
@RequiresApi(Build.VERSION_CODES.O)
private void createNotificationChannel() {
NotificationManager notifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
if (notifyManager == null)
return;
NotificationChannel notifyChannel = new NotificationChannel(
NOTIFICATION_CHANNEL_ID,
getString(R.string.notification_channel_name),
NotificationManager.IMPORTANCE_LOW
);
notifyChannel.setDescription(getString(R.string.notification_channel_description));
// Configure the notification channel without sound set
notifyChannel.setSound(null, null);
notifyChannel.enableLights(false);
notifyChannel.enableVibration(false);
// It is fine to always create the notification channel because creating a channel
// with the same ID is the same as overriding it (only its name and description).
notifyManager.createNotificationChannel(notifyChannel);
}
@Override
public void onBackPressed() {
// Prevent abrupt interruption when copy game files from assets

View File

@@ -22,17 +22,15 @@ package net.minetest.minetest;
import android.app.IntentService;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Environment;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RequiresApi;
import androidx.annotation.StringRes;
import java.io.File;
@@ -59,9 +57,11 @@ public class UnzipService extends IntentService {
private String failureMessage;
private static boolean isRunning = false;
public static synchronized boolean getIsRunning() {
return isRunning;
}
private static synchronized void setIsRunning(boolean v) {
isRunning = v;
}
@@ -77,9 +77,6 @@ public class UnzipService extends IntentService {
try {
setIsRunning(true);
File userDataDirectory = Utils.getUserDataDirectory(this);
if (userDataDirectory == null) {
throw new IOException("Unable to find user data directory");
}
try (InputStream in = this.getAssets().open(zipFile.getName())) {
try (OutputStream out = new FileOutputStream(zipFile)) {
@@ -91,39 +88,25 @@ public class UnzipService extends IntentService {
}
}
migrate(notificationBuilder, userDataDirectory);
unzip(notificationBuilder, zipFile, userDataDirectory);
} catch (IOException e) {
isSuccess = false;
failureMessage = e.getLocalizedMessage();
} finally {
setIsRunning(false);
zipFile.delete();
if (!zipFile.delete()) {
Log.w("UnzipService", "Minetest installation ZIP cannot be deleted");
}
}
}
@NonNull
private Notification.Builder createNotification() {
String name = "net.minetest.minetest";
String channelId = "Minetest channel";
String description = "notifications from Minetest";
Notification.Builder builder;
if (mNotifyManager == null)
mNotifyManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
int importance = NotificationManager.IMPORTANCE_LOW;
NotificationChannel mChannel = null;
if (mNotifyManager != null)
mChannel = mNotifyManager.getNotificationChannel(channelId);
if (mChannel == null) {
mChannel = new NotificationChannel(channelId, name, importance);
mChannel.setDescription(description);
// Configure the notification channel, NO SOUND
mChannel.setSound(null, null);
mChannel.enableLights(false);
mChannel.enableVibration(false);
mNotifyManager.createNotificationChannel(mChannel);
}
builder = new Notification.Builder(this, channelId);
builder = new Notification.Builder(this, MainActivity.NOTIFICATION_CHANNEL_ID);
} else {
builder = new Notification.Builder(this);
}
@@ -131,12 +114,16 @@ public class UnzipService extends IntentService {
Intent notificationIntent = new Intent(this, MainActivity.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
int pendingIntentFlag = 0;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
pendingIntentFlag = PendingIntent.FLAG_MUTABLE;
}
PendingIntent intent = PendingIntent.getActivity(this, 0,
notificationIntent, 0);
notificationIntent, pendingIntentFlag);
builder.setContentTitle(getString(R.string.notification_title))
builder.setContentTitle(getString(R.string.unzip_notification_title))
.setSmallIcon(R.mipmap.ic_launcher)
.setContentText(getString(R.string.notification_description))
.setContentText(getString(R.string.unzip_notification_description))
.setContentIntent(intent)
.setOngoing(true)
.setProgress(0, 0, true);
@@ -179,9 +166,9 @@ public class UnzipService extends IntentService {
try {
Process p = new ProcessBuilder("/system/bin/mv",
src.getAbsolutePath(), dst.getAbsolutePath()).start();
int exitcode = p.waitFor();
if (exitcode != 0)
throw new IOException("Move failed with exit code " + exitcode);
int exitCode = p.waitFor();
if (exitCode != 0)
throw new IOException("Move failed with exit code " + exitCode);
} catch (InterruptedException e) {
throw new IOException("Move operation interrupted");
}
@@ -197,41 +184,7 @@ public class UnzipService extends IntentService {
}
}
/**
* Migrates user data from deprecated external storage to app scoped storage
*/
private void migrate(Notification.Builder notificationBuilder, File newLocation) throws IOException {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
return;
}
File oldLocation = new File(Environment.getExternalStorageDirectory(), "Minetest");
if (!oldLocation.isDirectory())
return;
publishProgress(notificationBuilder, R.string.migrating, 0);
newLocation.mkdir();
String[] dirs = new String[] { "worlds", "games", "mods", "textures", "client" };
for (int i = 0; i < dirs.length; i++) {
publishProgress(notificationBuilder, R.string.migrating, 100 * i / dirs.length);
File dir = new File(oldLocation, dirs[i]), dir2 = new File(newLocation, dirs[i]);
if (dir.isDirectory() && !dir2.isDirectory()) {
moveFileOrDir(dir, dir2);
}
}
for (String filename : new String[] { "minetest.conf" }) {
File file = new File(oldLocation, filename), file2 = new File(newLocation, filename);
if (file.isFile() && !file2.isFile()) {
moveFileOrDir(file, file2);
}
}
recursivelyDeleteDirectory(oldLocation);
}
private void publishProgress(@Nullable Notification.Builder notificationBuilder, @StringRes int message, int progress) {
private void publishProgress(@Nullable Notification.Builder notificationBuilder, @StringRes int message, int progress) {
Intent intentUpdate = new Intent(ACTION_UPDATE);
intentUpdate.putExtra(ACTION_PROGRESS, progress);
intentUpdate.putExtra(ACTION_PROGRESS_MESSAGE, message);

View File

@@ -1,37 +1,43 @@
package net.minetest.minetest;
import android.content.Context;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.io.File;
import java.util.Objects;
public class Utils {
public static @NonNull File createDirs(File root, String dir) {
@NonNull
public static File createDirs(@NonNull File root, @NonNull String dir) {
File f = new File(root, dir);
if (!f.isDirectory())
f.mkdirs();
if (!f.mkdirs())
Log.e("Utils", "Directory " + dir + " cannot be created");
return f;
}
public static @Nullable File getUserDataDirectory(Context context) {
File extDir = context.getExternalFilesDir(null);
if (extDir == null) {
return null;
}
@NonNull
public static File getUserDataDirectory(@NonNull Context context) {
File extDir = Objects.requireNonNull(
context.getExternalFilesDir(null),
"Cannot get external file directory"
);
return createDirs(extDir, "Minetest");
}
public static @Nullable File getCacheDirectory(Context context) {
return context.getCacheDir();
@NonNull
public static File getCacheDirectory(@NonNull Context context) {
return Objects.requireNonNull(
context.getCacheDir(),
"Cannot get cache directory"
);
}
public static boolean isInstallValid(Context context) {
public static boolean isInstallValid(@NonNull Context context) {
File userDataDirectory = getUserDataDirectory(context);
return userDataDirectory != null && userDataDirectory.isDirectory() &&
new File(userDataDirectory, "games").isDirectory() &&
return userDataDirectory.isDirectory() &&
new File(userDataDirectory, "builtin").isDirectory() &&
new File(userDataDirectory, "client").isDirectory() &&
new File(userDataDirectory, "textures").isDirectory();

View File

@@ -1,13 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Minetest</string>
<string name="loading">Loading&#8230;</string>
<string name="migrating">Migrating save data from old install&#8230; (this may take a while)</string>
<string name="not_granted">Required permission wasn\'t granted, Minetest can\'t run without it</string>
<string name="notification_title">Loading Minetest</string>
<string name="notification_description">Less than 1 minute&#8230;</string>
<string name="notification_channel_name">General notification</string>
<string name="notification_channel_description">Notifications from Minetest</string>
<string name="unzip_notification_title">Loading Minetest</string>
<string name="unzip_notification_description">Less than 1 minute&#8230;</string>
<string name="ime_dialog_done">Done</string>
<string name="no_external_storage">External storage isn\'t available. If you use an SDCard, please reinsert it. Otherwise, try restarting your phone or contacting the Minetest developers</string>
</resources>

View File

@@ -1,23 +1,22 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
project.ext.set("versionMajor", 5) // Version Major
project.ext.set("versionMinor", 6) // Version Minor
project.ext.set("versionPatch", 0) // Version Patch
project.ext.set("versionExtra", "") // Version Extra
project.ext.set("versionCode", 40) // Android Version Code
project.ext.set("developmentBuild", 0) // Whether it is a development build, or a release
project.ext.set("versionMinor", 8) // Version Minor
project.ext.set("versionPatch", 1) // Version Patch
// ^ keep in sync with cmake
project.ext.set("versionCode", 48) // Android Version Code
// NOTE: +2 after each release!
// +1 for ARM and +1 for ARM64 APK's, because
// each APK must have a larger `versionCode` than the previous
buildscript {
ext.ndk_version = '23.2.8568313'
ext.ndk_version = '25.2.9519653'
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath 'com.android.tools.build:gradle:7.4.1'
classpath 'de.undercouch:gradle-download-task:4.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -27,11 +26,10 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
delete 'native/deps'
}

View File

@@ -7,5 +7,5 @@ org.gradle.daemon=true
org.gradle.parallel=true
org.gradle.parallel.threads=8
org.gradle.configureondemand=true
android.enableJetifier=true
android.enableJetifier=false
android.useAndroidX=true

View File

@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip

111
android/icons/exit_btn.svg Normal file
View File

@@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="512"
height="512"
viewBox="0 0 135.46666 135.46667"
version="1.1"
id="svg8"
inkscape:version="1.2.2 (732a01da63, 2022-12-09)"
sodipodi:docname="exit_btn.svg"
inkscape:export-filename="../../textures/base/pack/exit_btn.png"
inkscape:export-xdpi="24.000002"
inkscape:export-ydpi="24.000002"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs10" />
<sodipodi:namedview
id="base"
pagecolor="#404040"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="0.84958349"
inkscape:cx="-94.752312"
inkscape:cy="291.31922"
inkscape:document-units="px"
inkscape:current-layer="layer2"
showgrid="true"
units="px"
inkscape:window-width="1920"
inkscape:window-height="1001"
inkscape:window-x="-9"
inkscape:window-y="-9"
inkscape:window-maximized="1"
inkscape:pagecheckerboard="false"
inkscape:snap-grids="true"
inkscape:snap-page="true"
showguides="false"
inkscape:showpageshadow="2"
inkscape:deskcolor="#404040">
<inkscape:grid
type="xygrid"
id="grid16"
spacingx="0.26458333"
spacingy="0.26458333"
empspacing="4"
color="#40ff40"
opacity="0.1254902"
empcolor="#40ff40"
empopacity="0.25098039" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<g
inkscape:groupmode="layer"
id="layer2"
inkscape:label="Layer 2"
style="display:inline">
<path
id="rect5028"
style="display:inline;fill:none;stroke:#ffffff;stroke-width:5.99996;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none"
d="m 78.052082,90.48746 v 17.4625 l -50.535415,4e-5 V 27.516667 l 50.535415,3.7e-5 v 17.462423"
sodipodi:nodetypes="cccccc" />
<path
style="display:inline;fill:none;stroke:#ffffff;stroke-width:5.99996;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 101.49853,55.033202 12.69966,12.700052 -12.69966,12.699942"
id="path4737"
inkscape:connector-curvature="0"
sodipodi:nodetypes="ccc" />
<path
style="display:inline;fill:none;stroke:#ffffff;stroke-width:6;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="M 113.36416,67.733332 H 59.484405"
id="path4729"
inkscape:connector-curvature="0"
sodipodi:nodetypes="cc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@@ -2,27 +2,25 @@ apply plugin: 'com.android.library'
apply plugin: 'de.undercouch.download'
android {
compileSdkVersion 30
buildToolsVersion '30.0.3'
compileSdkVersion 33
buildToolsVersion '33.0.2'
ndkVersion "$ndk_version"
defaultConfig {
minSdkVersion 16
targetSdkVersion 30
minSdkVersion 21
targetSdkVersion 33
externalNativeBuild {
ndkBuild {
arguments '-j' + Runtime.getRuntime().availableProcessors(),
"versionMajor=${versionMajor}",
"versionMinor=${versionMinor}",
"versionPatch=${versionPatch}",
"versionExtra=${versionExtra}",
"developmentBuild=${developmentBuild}"
cmake {
arguments "-DANDROID_STL=c++_shared",
"-DENABLE_CURL=1", "-DENABLE_SOUND=1",
"-DENABLE_TOUCH=1", "-DENABLE_GETTEXT=1",
"-DBUILD_UNITTESTS=0", "-DENABLE_UPDATE_CHECKER=0"
}
}
}
externalNativeBuild {
ndkBuild {
path file('jni/Android.mk')
cmake {
path file("../../CMakeLists.txt")
}
}
@@ -31,18 +29,12 @@ android {
abi {
enable true
reset()
include 'armeabi-v7a', 'arm64-v8a'//, 'x86'
include 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
buildTypes {
release {
externalNativeBuild {
ndkBuild {
arguments 'NDEBUG=1'
}
}
ndk {
debugSymbolLevel 'SYMBOL_TABLE'
}
@@ -51,19 +43,30 @@ android {
}
// get precompiled deps
task downloadDeps(type: Download) {
src 'https://github.com/minetest/minetest_android_deps/releases/download/latest/deps.zip'
dest new File(buildDir, 'deps.zip')
overwrite false
}
def depsDir = new File(buildDir.parent, 'deps')
if (new File(depsDir, 'armeabi-v7a').exists()) {
task getDeps {
doLast { logger.lifecycle('Using existing deps from {}', depsDir) }
}
} else {
task downloadDeps(type: Download) {
def depsZip = new File(buildDir, 'deps.zip')
task getDeps(dependsOn: downloadDeps, type: Copy) {
def deps = new File(buildDir.parent, 'deps')
if (!deps.exists()) {
deps.mkdir()
from zipTree(downloadDeps.dest)
into deps
src 'https://github.com/minetest/minetest_android_deps/releases/download/5.8.0/deps.zip'
dest depsZip
overwrite false
task getDeps(dependsOn: downloadDeps, type: Copy) {
depsDir.mkdir()
from zipTree(depsZip)
into depsDir
doFirst { logger.lifecycle('Extracting to {}', depsDir) }
}
}
}
preBuild.dependsOn getDeps
clean {
delete new File(buildDir.parent, 'deps')
}

View File

@@ -1,291 +0,0 @@
LOCAL_PATH := $(call my-dir)/..
#LOCAL_ADDRESS_SANITIZER:=true
#USE_BUILTIN_LUA:=true
include $(CLEAR_VARS)
LOCAL_MODULE := Curl
LOCAL_SRC_FILES := deps/$(APP_ABI)/Curl/libcurl.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libmbedcrypto
LOCAL_SRC_FILES := deps/$(APP_ABI)/Curl/libmbedcrypto.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libmbedtls
LOCAL_SRC_FILES := deps/$(APP_ABI)/Curl/libmbedtls.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libmbedx509
LOCAL_SRC_FILES := deps/$(APP_ABI)/Curl/libmbedx509.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Freetype
LOCAL_SRC_FILES := deps/$(APP_ABI)/Freetype/libfreetype.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Iconv
LOCAL_SRC_FILES := deps/$(APP_ABI)/Iconv/libiconv.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libcharset
LOCAL_SRC_FILES := deps/$(APP_ABI)/Iconv/libcharset.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Irrlicht
LOCAL_SRC_FILES := deps/$(APP_ABI)/Irrlicht/libIrrlichtMt.a
include $(PREBUILT_STATIC_LIBRARY)
ifndef USE_BUILTIN_LUA
include $(CLEAR_VARS)
LOCAL_MODULE := LuaJIT
LOCAL_SRC_FILES := deps/$(APP_ABI)/LuaJIT/libluajit.a
include $(PREBUILT_STATIC_LIBRARY)
endif
include $(CLEAR_VARS)
LOCAL_MODULE := OpenAL
LOCAL_SRC_FILES := deps/$(APP_ABI)/OpenAL-Soft/libopenal.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Gettext
LOCAL_SRC_FILES := deps/$(APP_ABI)/Gettext/libintl.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := SQLite3
LOCAL_SRC_FILES := deps/$(APP_ABI)/SQLite/libsqlite3.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Vorbis
LOCAL_SRC_FILES := deps/$(APP_ABI)/Vorbis/libvorbis.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libvorbisfile
LOCAL_SRC_FILES := deps/$(APP_ABI)/Vorbis/libvorbisfile.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := libogg
LOCAL_SRC_FILES := deps/$(APP_ABI)/Vorbis/libogg.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Zstd
LOCAL_SRC_FILES := deps/$(APP_ABI)/Zstd/libzstd.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_MODULE := Minetest
LOCAL_CFLAGS += \
-DJSONCPP_NO_LOCALE_SUPPORT \
-DHAVE_TOUCHSCREENGUI \
-DENABLE_GLES=1 \
-DUSE_CURL=1 \
-DUSE_SOUND=1 \
-DUSE_LEVELDB=0 \
-DUSE_GETTEXT=1 \
-DVERSION_MAJOR=${versionMajor} \
-DVERSION_MINOR=${versionMinor} \
-DVERSION_PATCH=${versionPatch} \
-DVERSION_EXTRA=${versionExtra} \
-DDEVELOPMENT_BUILD=${developmentBuild} \
$(GPROF_DEF)
ifdef USE_BUILTIN_LUA
LOCAL_CFLAGS += -DUSE_LUAJIT=0
else
LOCAL_CFLAGS += -DUSE_LUAJIT=1
endif
ifdef NDEBUG
LOCAL_CFLAGS += -DNDEBUG=1
endif
ifdef GPROF
GPROF_DEF := -DGPROF
PROFILER_LIBS := android-ndk-profiler
LOCAL_CFLAGS += -pg
endif
LOCAL_C_INCLUDES := \
../../src \
../../src/script \
../../lib/gmp \
../../lib/jsoncpp \
deps/$(APP_ABI)/Curl/include \
deps/$(APP_ABI)/Freetype/include/freetype2 \
deps/$(APP_ABI)/Irrlicht/include \
deps/$(APP_ABI)/Gettext/include \
deps/$(APP_ABI)/Iconv/include \
deps/$(APP_ABI)/OpenAL-Soft/include \
deps/$(APP_ABI)/SQLite/include \
deps/$(APP_ABI)/Vorbis/include \
deps/$(APP_ABI)/Zstd/include
ifdef USE_BUILTIN_LUA
LOCAL_C_INCLUDES += \
../../lib/lua/src \
../../lib/bitop
else
LOCAL_C_INCLUDES += deps/$(APP_ABI)/LuaJIT/include
endif
LOCAL_SRC_FILES := \
$(wildcard ../../src/client/*.cpp) \
$(wildcard ../../src/client/*/*.cpp) \
$(wildcard ../../src/content/*.cpp) \
../../src/database/database.cpp \
../../src/database/database-dummy.cpp \
../../src/database/database-files.cpp \
../../src/database/database-sqlite3.cpp \
$(wildcard ../../src/gui/*.cpp) \
$(wildcard ../../src/irrlicht_changes/*.cpp) \
$(wildcard ../../src/mapgen/*.cpp) \
$(wildcard ../../src/network/*.cpp) \
$(wildcard ../../src/script/*.cpp) \
$(wildcard ../../src/script/*/*.cpp) \
$(wildcard ../../src/server/*.cpp) \
$(wildcard ../../src/threading/*.cpp) \
$(wildcard ../../src/util/*.c) \
$(wildcard ../../src/util/*.cpp) \
../../src/ban.cpp \
../../src/chat.cpp \
../../src/clientiface.cpp \
../../src/collision.cpp \
../../src/content_mapnode.cpp \
../../src/content_nodemeta.cpp \
../../src/convert_json.cpp \
../../src/craftdef.cpp \
../../src/debug.cpp \
../../src/defaultsettings.cpp \
../../src/emerge.cpp \
../../src/environment.cpp \
../../src/face_position_cache.cpp \
../../src/filesys.cpp \
../../src/gettext.cpp \
../../src/httpfetch.cpp \
../../src/hud.cpp \
../../src/inventory.cpp \
../../src/inventorymanager.cpp \
../../src/itemdef.cpp \
../../src/itemstackmetadata.cpp \
../../src/light.cpp \
../../src/log.cpp \
../../src/main.cpp \
../../src/map.cpp \
../../src/map_settings_manager.cpp \
../../src/mapblock.cpp \
../../src/mapnode.cpp \
../../src/mapsector.cpp \
../../src/metadata.cpp \
../../src/modchannels.cpp \
../../src/nameidmapping.cpp \
../../src/nodedef.cpp \
../../src/nodemetadata.cpp \
../../src/nodetimer.cpp \
../../src/noise.cpp \
../../src/objdef.cpp \
../../src/object_properties.cpp \
../../src/particles.cpp \
../../src/pathfinder.cpp \
../../src/player.cpp \
../../src/porting.cpp \
../../src/porting_android.cpp \
../../src/profiler.cpp \
../../src/raycast.cpp \
../../src/reflowscan.cpp \
../../src/remoteplayer.cpp \
../../src/rollback.cpp \
../../src/rollback_interface.cpp \
../../src/serialization.cpp \
../../src/server.cpp \
../../src/serverenvironment.cpp \
../../src/serverlist.cpp \
../../src/settings.cpp \
../../src/staticobject.cpp \
../../src/texture_override.cpp \
../../src/tileanimation.cpp \
../../src/tool.cpp \
../../src/translation.cpp \
../../src/version.cpp \
../../src/voxel.cpp \
../../src/voxelalgorithms.cpp
# Built-in Lua
ifdef USE_BUILTIN_LUA
LOCAL_SRC_FILES += \
../../lib/lua/src/lapi.c \
../../lib/lua/src/lauxlib.c \
../../lib/lua/src/lbaselib.c \
../../lib/lua/src/lcode.c \
../../lib/lua/src/ldblib.c \
../../lib/lua/src/ldebug.c \
../../lib/lua/src/ldo.c \
../../lib/lua/src/ldump.c \
../../lib/lua/src/lfunc.c \
../../lib/lua/src/lgc.c \
../../lib/lua/src/linit.c \
../../lib/lua/src/liolib.c \
../../lib/lua/src/llex.c \
../../lib/lua/src/lmathlib.c \
../../lib/lua/src/lmem.c \
../../lib/lua/src/loadlib.c \
../../lib/lua/src/lobject.c \
../../lib/lua/src/lopcodes.c \
../../lib/lua/src/loslib.c \
../../lib/lua/src/lparser.c \
../../lib/lua/src/lstate.c \
../../lib/lua/src/lstring.c \
../../lib/lua/src/lstrlib.c \
../../lib/lua/src/ltable.c \
../../lib/lua/src/ltablib.c \
../../lib/lua/src/ltm.c \
../../lib/lua/src/lundump.c \
../../lib/lua/src/lvm.c \
../../lib/lua/src/lzio.c \
../../lib/bitop/bit.c
endif
# GMP
LOCAL_SRC_FILES += ../../lib/gmp/mini-gmp.c
# JSONCPP
LOCAL_SRC_FILES += ../../lib/jsoncpp/jsoncpp.cpp
LOCAL_STATIC_LIBRARIES += \
Curl libmbedcrypto libmbedtls libmbedx509 \
Freetype \
Iconv libcharset \
Irrlicht \
OpenAL \
Gettext \
SQLite3 \
Vorbis libvorbisfile libogg \
Zstd
ifndef USE_BUILTIN_LUA
LOCAL_STATIC_LIBRARIES += LuaJIT
endif
LOCAL_STATIC_LIBRARIES += android_native_app_glue $(PROFILER_LIBS)
LOCAL_LDLIBS := -lEGL -lGLESv1_CM -lGLESv2 -landroid -lOpenSLES
include $(BUILD_SHARED_LIBRARY)
ifdef GPROF
$(call import-module,android-ndk-profiler)
endif
$(call import-module,android/native_app_glue)

View File

@@ -1,32 +0,0 @@
APP_PLATFORM := ${APP_PLATFORM}
APP_ABI := ${TARGET_ABI}
APP_STL := c++_shared
NDK_TOOLCHAIN_VERSION := clang
APP_SHORT_COMMANDS := true
APP_MODULES := Minetest
APP_CPPFLAGS := -O2 -fvisibility=hidden
ifeq ($(APP_ABI),armeabi-v7a)
APP_CPPFLAGS += -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb
endif
ifeq ($(APP_ABI),x86)
APP_CPPFLAGS += -mssse3 -mfpmath=sse -funroll-loops
endif
ifndef NDEBUG
APP_CPPFLAGS := -g -Og -fno-omit-frame-pointer
endif
APP_CFLAGS := $(APP_CPPFLAGS) -Wno-inconsistent-missing-override -Wno-parentheses-equality
APP_CXXFLAGS := $(APP_CPPFLAGS) -fexceptions -frtti -std=gnu++14
APP_LDFLAGS := -Wl,--no-warn-mismatch,--gc-sections,--icf=safe
ifeq ($(APP_ABI),arm64-v8a)
APP_LDFLAGS := -Wl,--no-warn-mismatch,--gc-sections
endif
ifndef NDEBUG
APP_LDFLAGS :=
endif

View File

@@ -13,9 +13,12 @@ end
-- Import a bunch of individual files from builtin/game/
local gamepath = core.get_builtin_path() .. "game" .. DIR_DELIM
local commonpath = core.get_builtin_path() .. "common" .. DIR_DELIM
local builtin_shared = {}
dofile(gamepath .. "constants.lua")
dofile(gamepath .. "item_s.lua")
assert(loadfile(commonpath .. "item_s.lua"))(builtin_shared)
dofile(gamepath .. "misc_s.lua")
dofile(gamepath .. "features.lua")
dofile(gamepath .. "voxelarea.lua")
@@ -33,11 +36,16 @@ do
setmetatable(v, {__newindex = {}})
-- Reassemble the other tables
if v.type == "node" then
getmetatable(v).__index = all.nodedef_default
all.registered_nodes[k] = v
elseif v.type == "craftitem" then
elseif v.type == "craft" then
getmetatable(v).__index = all.craftitemdef_default
all.registered_craftitems[k] = v
elseif v.type == "tool" then
getmetatable(v).__index = all.tooldef_default
all.registered_tools[k] = v
else
getmetatable(v).__index = all.noneitemdef_default
end
end
@@ -57,3 +65,5 @@ setmetatable(core.registered_items, alias_metatable)
setmetatable(core.registered_nodes, alias_metatable)
setmetatable(core.registered_craftitems, alias_metatable)
setmetatable(core.registered_tools, alias_metatable)
builtin_shared.cache_content_ids()

View File

@@ -10,3 +10,4 @@ dofile(commonpath .. "chatcommands.lua")
dofile(clientpath .. "chatcommands.lua")
dofile(clientpath .. "death_formspec.lua")
dofile(clientpath .. "misc.lua")
assert(loadfile(commonpath .. "item_s.lua"))({}) -- Just for push/read node functions

View File

@@ -5,3 +5,14 @@ function core.setting_get_pos(name)
end
return core.string_to_pos(value)
end
-- old non-method sound functions
function core.sound_stop(handle, ...)
return handle:stop(...)
end
function core.sound_fade(handle, ...)
return handle:fade(...)
end

View File

@@ -20,8 +20,8 @@
-- TODO code cleanup --
-- Generic implementation of a filter/sortable list --
-- Usage: --
-- Filterlist needs to be initialized on creation. To achieve this you need to --
-- pass following functions: --
-- Filterlist needs to be initialized on creation. To achieve this you need --
-- to pass following functions: --
-- raw_fct() (mandatory): --
-- function returning a table containing the elements to be filtered --
-- compare_fct(element1,element2) (mandatory): --
@@ -31,7 +31,7 @@
-- filter_fct(element,filtercriteria) (optional) --
-- function returning true/false if filtercriteria met to element --
-- fetch_param (optional) --
-- parameter passed to raw_fct to aquire correct raw data --
-- parameter passed to raw_fct to acquire correct raw data --
-- --
--------------------------------------------------------------------------------
filterlist = {}

View File

@@ -22,6 +22,7 @@ local LIST_FORMSPEC_DESCRIPTION = [[
local F = core.formspec_escape
local S = core.get_translator("__builtin")
local check_player_privs = core.check_player_privs
-- CHAT COMMANDS FORMSPEC
@@ -57,11 +58,10 @@ local function build_chatcommands_formspec(name, sel, copy)
.. "any entry in the list.").. "\n" ..
S("Double-click to copy the entry to the chat history.")
local privs = core.get_player_privs(name)
for i, data in ipairs(mod_cmds) do
rows[#rows + 1] = COLOR_BLUE .. ",0," .. F(data[1]) .. ","
for j, cmds in ipairs(data[2]) do
local has_priv = privs[cmds[2].privs]
local has_priv = check_player_privs(name, cmds[2].privs)
rows[#rows + 1] = ("%s,1,%s,%s"):format(
has_priv and COLOR_GREEN or COLOR_GRAY,
cmds[1], F(cmds[2].params))

View File

@@ -4,6 +4,8 @@
-- Server or writable access to IGameDef on the engine side.
-- (The '_s' stands for standalone.)
local builtin_shared = ...
--
-- Item definition helpers
--
@@ -92,6 +94,26 @@ function core.facedir_to_dir(facedir)
return facedir_to_dir[facedir_to_dir_map[facedir % 32]]
end
function core.dir_to_fourdir(dir)
if math.abs(dir.x) > math.abs(dir.z) then
if dir.x < 0 then
return 3
else
return 1
end
else
if dir.z < 0 then
return 2
else
return 0
end
end
end
function core.fourdir_to_dir(fourdir)
return facedir_to_dir[facedir_to_dir_map[fourdir % 4]]
end
function core.dir_to_wallmounted(dir)
if math.abs(dir.y) > math.max(math.abs(dir.x), math.abs(dir.z)) then
if dir.y < 0 then
@@ -137,7 +159,8 @@ end
function core.is_colored_paramtype(ptype)
return (ptype == "color") or (ptype == "colorfacedir") or
(ptype == "colorwallmounted") or (ptype == "colordegrotate")
(ptype == "color4dir") or (ptype == "colorwallmounted") or
(ptype == "colordegrotate")
end
function core.strip_param2_color(param2, paramtype2)
@@ -146,6 +169,8 @@ function core.strip_param2_color(param2, paramtype2)
end
if paramtype2 == "colorfacedir" then
param2 = math.floor(param2 / 32) * 32
elseif paramtype2 == "color4dir" then
param2 = math.floor(param2 / 4) * 4
elseif paramtype2 == "colorwallmounted" then
param2 = math.floor(param2 / 8) * 8
elseif paramtype2 == "colordegrotate" then
@@ -154,3 +179,61 @@ function core.strip_param2_color(param2, paramtype2)
-- paramtype2 == "color" requires no modification.
return param2
end
-- Content ID caching
local old_get_content_id = core.get_content_id
local old_get_name_from_content_id = core.get_name_from_content_id
local name2content = setmetatable({}, {
__index = function(self, name)
return old_get_content_id(name)
end,
})
local content2name = setmetatable({}, {
__index = function(self, id)
return old_get_name_from_content_id(id)
end,
})
function core.get_content_id(name)
return name2content[name]
end
function core.get_name_from_content_id(id)
return content2name[id]
end
-- Cache content IDs after they have stopped changing.
function builtin_shared.cache_content_ids()
for name in pairs(core.registered_nodes) do
local id = old_get_content_id(name)
name2content[name] = id
content2name[id] = name
end
-- unknown is not in the registered node list.
local unknown_name = old_get_name_from_content_id(core.CONTENT_UNKNOWN)
name2content[unknown_name] = core.CONTENT_UNKNOWN
content2name[core.CONTENT_UNKNOWN] = unknown_name
for name in pairs(core.registered_aliases) do
if core.registered_nodes[name] then
name2content[name] = old_get_content_id(name)
end
end
end
if core.set_read_node and core.set_push_node then
local function read_node(node)
return name2content[node.name], node.param1, node.param2
end
core.set_read_node(read_node)
core.set_read_node = nil
local function push_node(content, param1, param2)
return {name = content2name[content], param1 = param1, param2 = param2}
end
core.set_push_node(push_node)
core.set_push_node = nil
end

View File

@@ -170,6 +170,9 @@ end
--------------------------------------------------------------------------------
function string.split(str, delim, include_empty, max_splits, sep_is_pattern)
delim = delim or ","
if delim == "" then
error("string.split separator is empty", 2)
end
max_splits = max_splits or -2
local items = {}
local pos, len = 1, #str
@@ -250,11 +253,12 @@ local formspec_escapes = {
["["] = "\\[",
["]"] = "\\]",
[";"] = "\\;",
[","] = "\\,"
[","] = "\\,",
["$"] = "\\$",
}
function core.formspec_escape(text)
-- Use explicit character set instead of dot here because it doubles the performance
return text and string.gsub(text, "[\\%[%];,]", formspec_escapes)
return text and string.gsub(text, "[\\%[%];,$]", formspec_escapes)
end
@@ -519,18 +523,6 @@ end
--------------------------------------------------------------------------------
-- mainmenu only functions
--------------------------------------------------------------------------------
if INIT == "mainmenu" then
function core.get_game(index)
local games = core.get_games()
if index > 0 and index <= #games then
return games[index]
end
return nil
end
end
if core.gettext then -- for client and mainmenu
function fgettext_ne(text, ...)
text = core.gettext(text)

View File

@@ -0,0 +1,74 @@
local builtin_shared = ...
do
local default = {mod = "??", name = "??"}
core.callback_origins = setmetatable({}, {
__index = function()
return default
end
})
end
function core.run_callbacks(callbacks, mode, ...)
assert(type(callbacks) == "table")
local cb_len = #callbacks
if cb_len == 0 then
if mode == 2 or mode == 3 then
return true
elseif mode == 4 or mode == 5 then
return false
end
end
local ret = nil
for i = 1, cb_len do
local origin = core.callback_origins[callbacks[i]]
core.set_last_run_mod(origin.mod)
local cb_ret = callbacks[i](...)
if mode == 0 and i == 1 then
ret = cb_ret
elseif mode == 1 and i == cb_len then
ret = cb_ret
elseif mode == 2 then
if not cb_ret or i == 1 then
ret = cb_ret
end
elseif mode == 3 then
if cb_ret then
return cb_ret
end
ret = cb_ret
elseif mode == 4 then
if (cb_ret and not ret) or i == 1 then
ret = cb_ret
end
elseif mode == 5 and cb_ret then
return cb_ret
end
end
return ret
end
function builtin_shared.make_registration()
local t = {}
local registerfunc = function(func)
t[#t + 1] = func
core.callback_origins[func] = {
mod = core.get_current_modname() or "??",
name = debug.getinfo(1, "n").name or "??"
}
end
return t, registerfunc
end
function builtin_shared.make_registration_reverse()
local t = {}
local registerfunc = function(func)
table.insert(t, 1, func)
core.callback_origins[func] = {
mod = core.get_current_modname() or "??",
name = debug.getinfo(1, "n").name or "??"
}
end
return t, registerfunc
end

View File

@@ -8,7 +8,7 @@ local next, rawget, pairs, pcall, error, type, setfenv, loadstring
local table_concat, string_dump, string_format, string_match, math_huge
= table.concat, string.dump, string.format, string.match, math.huge
-- Recursively counts occurences of objects (non-primitives including strings) in a table.
-- Recursively counts occurrences of objects (non-primitives including strings) in a table.
local function count_objects(value)
local counts = {}
if value == nil then
@@ -61,17 +61,21 @@ end
-- Serializes Lua nil, booleans, numbers, strings, tables and even functions
-- Tables are referenced by reference, strings are referenced by value. Supports circular tables.
local function serialize(value, write)
local reference, refnum = "r1", 1
-- [object] = reference string
local reference, refnum = "1", 1
-- [object] = reference
local references = {}
-- Circular tables that must be filled using `table[key] = value` statements
local to_fill = {}
for object, count in pairs(count_objects(value)) do
local type_ = type(object)
-- Object must appear more than once. If it is a string, the reference has to be shorter than the string.
if count >= 2 and (type_ ~= "string" or #reference + 2 < #object) then
if count >= 2 and (type_ ~= "string" or #reference + 5 < #object) then
if refnum == 1 then
write"local _={};" -- initialize reference table
end
write"_["
write(reference)
write("=")
write("]=")
if type_ == "table" then
write("{}")
elseif type_ == "function" then
@@ -85,7 +89,7 @@ local function serialize(value, write)
to_fill[object] = reference
end
refnum = refnum + 1
reference = ("r%X"):format(refnum)
reference = ("%d"):format(refnum)
end
end
-- Used to decide whether we should do "key=..."
@@ -105,12 +109,22 @@ local function serialize(value, write)
end
local type_ = type(value)
if type_ == "number" then
return write(string_format("%.17g", value))
if value ~= value then -- nan
return write"0/0"
elseif value == math_huge then
return write"1/0"
elseif value == -math_huge then
return write"-1/0"
else
return write(string_format("%.17g", value))
end
end
-- Reference types: table, function and string
local ref = references[value]
if ref then
return write(ref)
write"_["
write(ref)
return write"]"
end
if type_ == "string" then
return write(quote(value))
@@ -156,7 +170,9 @@ local function serialize(value, write)
-- Write the statements to fill circular tables
for table, ref in pairs(to_fill) do
for k, v in pairs(table) do
write("_[")
write(ref)
write("]")
if use_short_key(k) then
write(".")
write(k)
@@ -185,8 +201,6 @@ end
local function dummy_func() end
local nan = (0/0)^1 -- +nan
function core.deserialize(str, safe)
-- Backwards compatibility
if str == nil then
@@ -201,8 +215,8 @@ function core.deserialize(str, safe)
local func, err = loadstring(str)
if not func then return nil, err end
-- math.huge is serialized to inf, NaNs are serialized to nan by Lua
local env = {inf = math_huge, nan = nan}
-- math.huge was serialized to inf and NaNs to nan by Lua in Minetest 5.6, so we have to support this here
local env = {inf = math_huge, nan = 0/0}
if safe then
env.loadstring = dummy_func
else

View File

@@ -10,10 +10,11 @@ end
local meta = {}
local declared = {}
-- Key is source file, line, and variable name; seperated by NULs
-- Key is source file, line, and variable name; separated by NULs
local warned = {}
function meta:__newindex(name, value)
rawset(self, name, value)
if declared[name] then
return
end
@@ -25,7 +26,6 @@ function meta:__newindex(name, value)
:format(name, desc))
warned[warn_key] = true
end
rawset(self, name, value)
declared[name] = true
end

View File

@@ -1,5 +1,4 @@
_G.core = {}
_G.vector = {metatable = {}}
dofile("builtin/common/vector.lua")
dofile("builtin/common/misc_helpers.lua")
@@ -39,6 +38,12 @@ describe("string", function()
assert.same({ "one", "two" }, string.split("one,two", ",", false, -1, true))
assert.same({ "one", "two", "three" }, string.split("one2two3three", "%d", false, -1, true))
end)
it("rejects empty separator", function()
assert.has.errors(function()
string.split("", "")
end)
end)
end)
end)

View File

@@ -1,5 +1,4 @@
_G.core = {}
_G.vector = {metatable = {}}
_G.setfenv = require 'busted.compatibility'.setfenv

View File

@@ -1,4 +1,4 @@
_G.vector = {metatable = {}}
_G.vector = {}
dofile("builtin/common/vector.lua")
describe("vector", function()
@@ -462,4 +462,11 @@ describe("vector", function()
end
end)
it("in_area()", function()
assert.True(vector.in_area(vector.zero(), vector.new(-10, -10, -10), vector.new(10, 10, 10)))
assert.True(vector.in_area(vector.new(-2, 5, -8), vector.new(-10, -10, -10), vector.new(10, 10, 10)))
assert.True(vector.in_area(vector.new(-10, -10, -10), vector.new(-10, -10, -10), vector.new(10, 10, 10)))
assert.False(vector.in_area(vector.new(-10, -10, -10), vector.new(10, 10, 10), vector.new(-11, -10, -10)))
end)
end)

View File

@@ -6,8 +6,10 @@ Note: The vector.*-functions must be able to accept old vectors that had no meta
-- localize functions
local setmetatable = setmetatable
-- vector.metatable is set by C++.
local metatable = vector.metatable
vector = {}
local metatable = {}
vector.metatable = metatable
local xyz = {"x", "y", "z"}
@@ -79,7 +81,7 @@ metatable.__eq = vector.equals
function vector.length(v)
return math.sqrt(v.x * v.x + v.y * v.y + v.z * v.z)
end
-- Note: we can not use __len because it is already used for primitive table length
-- Note: we cannot use __len because it is already used for primitive table length
function vector.normalize(v)
local len = vector.length(v)
@@ -354,7 +356,7 @@ function vector.dir_to_rotation(forward, up)
-- Since vector.angle never returns a negative value or a value greater
-- than math.pi, rot.z has to be inverted sometimes.
-- To determine wether this is the case, we rotate the up vector back around
-- To determine whether this is the case, we rotate the up vector back around
-- the forward vector and check if it worked out.
local back = vector.rotate_around_axis(up, forward, -rot.z)
@@ -366,3 +368,28 @@ function vector.dir_to_rotation(forward, up)
end
return rot
end
function vector.in_area(pos, min, max)
return (pos.x >= min.x) and (pos.x <= max.x) and
(pos.y >= min.y) and (pos.y <= max.y) and
(pos.z >= min.z) and (pos.z <= max.z)
end
if rawget(_G, "core") and core.set_read_vector and core.set_push_vector then
local function read_vector(v)
return v.x, v.y, v.z
end
core.set_read_vector(read_vector)
core.set_read_vector = nil
if rawget(_G, "jit") then
-- This is necessary to prevent trace aborts.
local function push_vector(x, y, z)
return (fast_new(x, y, z))
end
core.set_push_vector(push_vector)
else
core.set_push_vector(fast_new)
end
core.set_push_vector = nil
end

View File

@@ -1,5 +1,6 @@
--Minetest
--Copyright (C) 2014 sapier
--Copyright (C) 2023 Gregor Parzefall
--
--This program is free software; you can redistribute it and/or modify
--it under the terms of the GNU Lesser General Public License as published by
@@ -16,115 +17,101 @@
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
local function buttonbar_formspec(self)
local BASE_SPACING = 0.1
local SCROLL_BTN_WIDTH = TOUCHSCREEN_GUI and 0.8 or 0.5
local function buttonbar_formspec(self)
if self.hidden then
return ""
end
local formspec = string.format("box[%f,%f;%f,%f;%s]",
self.pos.x,self.pos.y ,self.size.x,self.size.y,self.bgcolor)
local formspec = {
"style_type[box;noclip=true]",
string.format("box[%f,%f;%f,%f;%s]", self.pos.x, self.pos.y, self.size.x,
self.size.y, self.bgcolor),
"style_type[box;noclip=false]",
}
for i=self.startbutton,#self.buttons,1 do
local btn_name = self.buttons[i].name
local btn_pos = {}
local btn_size = self.size.y - 2*BASE_SPACING
if self.orientation == "horizontal" then
btn_pos.x = self.pos.x + --base pos
(i - self.startbutton) * self.btn_size + --button offset
self.btn_initial_offset
else
btn_pos.x = self.pos.x + (self.btn_size * 0.05)
end
-- Spacing works like CSS Flexbox with `justify-content: space-evenly;`.
-- `BASE_SPACING` is used as the minimum spacing, like `gap` in CSS Flexbox.
if self.orientation == "vertical" then
btn_pos.y = self.pos.y + --base pos
(i - self.startbutton) * self.btn_size + --button offset
self.btn_initial_offset
else
btn_pos.y = self.pos.y + (self.btn_size * 0.05)
end
-- The number of buttons per page is always calculated as if the scroll
-- buttons were visible.
local avail_space = self.size.x - 2*BASE_SPACING - 2*SCROLL_BTN_WIDTH
local btns_per_page = math.floor((avail_space - BASE_SPACING) / (btn_size + BASE_SPACING))
if (self.orientation == "vertical" and
(btn_pos.y + self.btn_size <= self.pos.y + self.size.y)) or
(self.orientation == "horizontal" and
(btn_pos.x + self.btn_size <= self.pos.x + self.size.x)) then
self.num_pages = math.ceil(#self.buttons / btns_per_page)
self.cur_page = math.min(self.cur_page, self.num_pages)
local first_btn = (self.cur_page - 1) * btns_per_page + 1
local borders="true"
local show_scroll_btns = self.num_pages > 1
if self.buttons[i].image ~= nil then
borders="false"
end
-- In contrast, the button spacing calculation takes hidden scroll buttons
-- into account.
local real_avail_space = show_scroll_btns and avail_space or self.size.x
local btn_spacing = (real_avail_space - btns_per_page * btn_size) / (btns_per_page + 1)
formspec = formspec ..
string.format("image_button[%f,%f;%f,%f;%s;%s;%s;true;%s]tooltip[%s;%s]",
btn_pos.x, btn_pos.y, self.btn_size, self.btn_size,
self.buttons[i].image, btn_name, self.buttons[i].caption,
borders, btn_name, self.buttons[i].tooltip)
else
--print("end of displayable buttons: orientation: " .. self.orientation)
--print( "button_end: " .. (btn_pos.y + self.btn_size - (self.btn_size * 0.05)))
--print( "bar_end: " .. (self.pos.x + self.size.x))
local btn_start_x = self.pos.x + btn_spacing
if show_scroll_btns then
btn_start_x = btn_start_x + BASE_SPACING + SCROLL_BTN_WIDTH
end
for i = first_btn, first_btn + btns_per_page - 1 do
local btn = self.buttons[i]
if btn == nil then
break
end
local btn_pos = {
x = btn_start_x + (i - first_btn) * (btn_size + btn_spacing),
y = self.pos.y + BASE_SPACING,
}
table.insert(formspec, string.format("image_button[%f,%f;%f,%f;%s;%s;%s;true;false]tooltip[%s;%s]",
btn_pos.x, btn_pos.y, btn_size, btn_size, btn.image, btn.name,
btn.caption, btn.name, btn.tooltip))
end
if (self.have_move_buttons) then
local btn_dec_pos = {}
btn_dec_pos.x = self.pos.x + (self.btn_size * 0.05)
btn_dec_pos.y = self.pos.y + (self.btn_size * 0.05)
local btn_inc_pos = {}
local btn_size = {}
if show_scroll_btns then
local btn_prev_pos = {
x = self.pos.x + BASE_SPACING,
y = self.pos.y + BASE_SPACING,
}
local btn_next_pos = {
x = self.pos.x + self.size.x - BASE_SPACING - SCROLL_BTN_WIDTH,
y = self.pos.y + BASE_SPACING,
}
if self.orientation == "horizontal" then
btn_size.x = 0.5
btn_size.y = self.btn_size
btn_inc_pos.x = self.pos.x + self.size.x - 0.5
btn_inc_pos.y = self.pos.y + (self.btn_size * 0.05)
else
btn_size.x = self.btn_size
btn_size.y = 0.5
btn_inc_pos.x = self.pos.x + (self.btn_size * 0.05)
btn_inc_pos.y = self.pos.y + self.size.y - 0.5
end
table.insert(formspec, string.format("style[%s,%s;noclip=true]",
self.btn_prev_name, self.btn_next_name))
local text_dec = "<"
local text_inc = ">"
if self.orientation == "vertical" then
text_dec = "^"
text_inc = "v"
end
table.insert(formspec, string.format("button[%f,%f;%f,%f;%s;<]",
btn_prev_pos.x, btn_prev_pos.y, SCROLL_BTN_WIDTH, btn_size,
self.btn_prev_name))
formspec = formspec ..
string.format("image_button[%f,%f;%f,%f;;btnbar_dec_%s;%s;true;true]",
btn_dec_pos.x, btn_dec_pos.y, btn_size.x, btn_size.y,
self.name, text_dec)
formspec = formspec ..
string.format("image_button[%f,%f;%f,%f;;btnbar_inc_%s;%s;true;true]",
btn_inc_pos.x, btn_inc_pos.y, btn_size.x, btn_size.y,
self.name, text_inc)
table.insert(formspec, string.format("button[%f,%f;%f,%f;%s;>]",
btn_next_pos.x, btn_next_pos.y, SCROLL_BTN_WIDTH, btn_size,
self.btn_next_name))
end
return formspec
return table.concat(formspec)
end
local function buttonbar_buttonhandler(self, fields)
if fields["btnbar_inc_" .. self.name] ~= nil and
self.startbutton < #self.buttons then
self.startbutton = self.startbutton + 1
if fields[self.btn_prev_name] and self.cur_page > 1 then
self.cur_page = self.cur_page - 1
return true
end
if fields["btnbar_dec_" .. self.name] ~= nil and self.startbutton > 1 then
self.startbutton = self.startbutton - 1
if fields[self.btn_next_name] and self.cur_page < self.num_pages then
self.cur_page = self.cur_page + 1
return true
end
for i=1,#self.buttons,1 do
if fields[self.buttons[i].name] ~= nil then
for _, btn in ipairs(self.buttons) do
if fields[btn.name] then
return self.userbuttonhandler(fields)
end
end
@@ -141,74 +128,45 @@ local buttonbar_metatable = {
delete = function(self) ui.delete(self) end,
add_button = function(self, name, caption, image, tooltip)
if caption == nil then caption = "" end
if image == nil then image = "" end
if tooltip == nil then tooltip = "" end
if caption == nil then caption = "" end
if image == nil then image = "" end
if tooltip == nil then tooltip = "" end
self.buttons[#self.buttons + 1] = {
name = name,
caption = caption,
image = image,
tooltip = tooltip
}
if self.orientation == "horizontal" then
if ( (self.btn_size * #self.buttons) + (self.btn_size * 0.05 *2)
> self.size.x ) then
self.btn_initial_offset = self.btn_size * 0.05 + 0.5
self.have_move_buttons = true
end
else
if ((self.btn_size * #self.buttons) + (self.btn_size * 0.05 *2)
> self.size.y ) then
self.btn_initial_offset = self.btn_size * 0.05 + 0.5
self.have_move_buttons = true
end
end
end,
set_bgparams = function(self, bgcolor)
if (type(bgcolor) == "string") then
self.bgcolor = bgcolor
end
end,
table.insert(self.buttons, {
name = name,
caption = caption,
image = image,
tooltip = tooltip,
})
end,
}
buttonbar_metatable.__index = buttonbar_metatable
function buttonbar_create(name, cbf_buttonhandler, pos, orientation, size)
assert(name ~= nil)
assert(cbf_buttonhandler ~= nil)
assert(orientation == "vertical" or orientation == "horizontal")
assert(pos ~= nil and type(pos) == "table")
assert(size ~= nil and type(size) == "table")
function buttonbar_create(name, pos, size, bgcolor, cbf_buttonhandler)
assert(type(name) == "string" )
assert(type(pos) == "table" )
assert(type(size) == "table" )
assert(type(bgcolor) == "string" )
assert(type(cbf_buttonhandler) == "function")
local self = {}
self.name = name
self.type = "addon"
self.bgcolor = "#000000"
self.name = name
self.pos = pos
self.size = size
self.orientation = orientation
self.startbutton = 1
self.have_move_buttons = false
self.hidden = false
if self.orientation == "horizontal" then
self.btn_size = self.size.y
else
self.btn_size = self.size.x
end
if (self.btn_initial_offset == nil) then
self.btn_initial_offset = self.btn_size * 0.05
end
self.bgcolor = bgcolor
self.userbuttonhandler = cbf_buttonhandler
self.buttons = {}
setmetatable(self,buttonbar_metatable)
self.hidden = false
self.buttons = {}
self.num_pages = 1
self.cur_page = 1
self.btn_prev_name = "btnbar_prev_" .. self.name
self.btn_next_name = "btnbar_next_" .. self.name
setmetatable(self, buttonbar_metatable)
ui.add(self)
return self

View File

@@ -38,8 +38,18 @@ local dialog_metatable = {
handle_events = function(self,event)
if not self.hidden then return self.eventhandler(self,event) end
end,
hide = function(self) self.hidden = true end,
show = function(self) self.hidden = false end,
hide = function(self)
if not self.hidden then
self.hidden = true
self.eventhandler(self, "DialogHide")
end
end,
show = function(self)
if self.hidden then
self.hidden = false
self.eventhandler(self, "DialogShow")
end
end,
delete = function(self)
if self.parent ~= nil then
self.parent:show()

View File

@@ -42,6 +42,7 @@ local function add_tab(self,tab)
event_handler = tab.cbf_events,
get_formspec = tab.cbf_formspec,
tabsize = tab.tabsize,
formspec_version = tab.formspec_version or 6,
on_change = tab.on_change,
tabdata = {},
}
@@ -65,13 +66,38 @@ local function get_formspec(self)
local content, prepend = tab.get_formspec(self, tab.name, tab.tabdata, tab.tabsize)
local tsize = tab.tabsize or { width = self.width, height = self.height }
if self.parent == nil and not prepend then
local tsize = tab.tabsize or {width=self.width, height=self.height}
prepend = string.format("size[%f,%f,%s]", tsize.width, tsize.height,
dump(self.fixed_size))
if tab.formspec_version then
prepend = ("formspec_version[%d]"):format(tab.formspec_version) .. prepend
end
end
local end_button_size = 0.75
local tab_header_size = { width = tsize.width, height = 0.85 }
if self.end_button then
tab_header_size.width = tab_header_size.width - end_button_size - 0.1
end
local formspec = (prepend or "") .. self:tab_header(tab_header_size) .. content
if self.end_button then
formspec = formspec ..
("style[%s;noclip=true;border=false]"):format(self.end_button.name) ..
("tooltip[%s;%s]"):format(self.end_button.name, self.end_button.label) ..
("image_button[%f,%f;%f,%f;%s;%s;]"):format(
self.width - end_button_size,
(-tab_header_size.height - end_button_size) / 2,
end_button_size,
end_button_size,
core.formspec_escape(self.end_button.icon),
self.end_button.name)
end
local formspec = (prepend or "") .. self:tab_header() .. content
return formspec
end
@@ -86,8 +112,12 @@ local function handle_buttons(self,fields)
return true
end
if self.end_button and fields[self.end_button.name] then
return self.end_button.on_click(self)
end
if self.glb_btn_handler ~= nil and
self.glb_btn_handler(self,fields) then
self.glb_btn_handler(self, fields) then
return true
end
@@ -121,20 +151,23 @@ end
--------------------------------------------------------------------------------
local function tab_header(self)
local function tab_header(self, size)
local toadd = ""
for i=1,#self.tablist,1 do
for i = 1, #self.tablist do
if toadd ~= "" then
toadd = toadd .. ","
end
toadd = toadd .. self.tablist[i].caption
local caption = self.tablist[i].caption
if type(caption) == "function" then
caption = caption(self)
end
toadd = toadd .. caption
end
return string.format("tabheader[%f,%f;%s;%s;%i;true;false]",
self.header_x, self.header_y, self.name, toadd, self.last_tab_index);
return string.format("tabheader[%f,%f;%f,%f;%s;%s;%i;true;false]",
self.header_x, self.header_y, size.width, size.height, self.name, toadd, self.last_tab_index)
end
--------------------------------------------------------------------------------
@@ -225,6 +258,8 @@ local tabview_metatable = {
function(self,handler) self.glb_evt_handler = handler end,
set_fixed_size =
function(self,state) self.fixed_size = state end,
set_end_button =
function(self, v) self.end_button = v end,
tab_header = tab_header,
handle_tab_buttons = handle_tab_buttons
}

View File

@@ -62,8 +62,8 @@ function ui.update()
-- handle errors
if gamedata ~= nil and gamedata.reconnect_requested then
local error_message = core.formspec_escape(
gamedata.errormessage or fgettext("<none available>"))
local error_message = core.formspec_escape(gamedata.errormessage)
or fgettext("<none available>")
formspec = {
"size[14,8]",
"real_coordinates[true]",

View File

@@ -416,7 +416,7 @@ core.register_chatcommand("revokeme", {
core.register_chatcommand("setpassword", {
params = S("<name> <password>"),
description = S("Set player's password"),
description = S("Set player's password (sent unencrypted, thus insecure)"),
privs = {password=true},
func = function(name, param)
local toname, raw_password = string.match(param, "^([^ ]+) +(.+)$")

View File

@@ -161,7 +161,16 @@ core.register_entity(":__builtin:falling_node", {
local fdir = node.param2 % 32 % 24
-- Get rotation from a precalculated lookup table
local euler = facedir_to_euler[fdir + 1]
self.object:set_rotation(euler)
if euler then
self.object:set_rotation(euler)
end
elseif (def.paramtype2 == "4dir" or def.paramtype2 == "color4dir") then
local fdir = node.param2 % 4
-- Get rotation from a precalculated lookup table
local euler = facedir_to_euler[fdir + 1]
if euler then
self.object:set_rotation(euler)
end
elseif (def.drawtype ~= "plantlike" and def.drawtype ~= "plantlike_rooted" and
(def.paramtype2 == "wallmounted" or def.paramtype2 == "colorwallmounted" or def.drawtype == "signlike")) then
local rot = node.param2 % 8
@@ -457,15 +466,39 @@ local function drop_attached_node(p)
end
end
function builtin_shared.check_attached_node(p, n)
function builtin_shared.check_attached_node(p, n, group_rating)
local def = core.registered_nodes[n.name]
local d = vector.zero()
if def.paramtype2 == "wallmounted" or
if group_rating == 3 then
-- always attach to floor
d.y = -1
elseif group_rating == 4 then
-- always attach to ceiling
d.y = 1
elseif group_rating == 2 then
-- attach to facedir or 4dir direction
if (def.paramtype2 == "facedir" or
def.paramtype2 == "colorfacedir") then
-- Attach to whatever facedir is "mounted to".
-- For facedir, this is where tile no. 5 point at.
-- The fallback vector here is in case 'facedir to dir' is nil due
-- to voxelmanip placing a wallmounted node without resetting a
-- pre-existing param2 value that is out-of-range for facedir.
-- The fallback vector corresponds to param2 = 0.
d = core.facedir_to_dir(n.param2) or vector.new(0, 0, 1)
elseif (def.paramtype2 == "4dir" or
def.paramtype2 == "color4dir") then
-- Similar to facedir handling
d = core.fourdir_to_dir(n.param2) or vector.new(0, 0, 1)
end
elseif def.paramtype2 == "wallmounted" or
def.paramtype2 == "colorwallmounted" then
-- The fallback vector here is in case 'wallmounted to dir' is nil due
-- to voxelmanip placing a wallmounted node without resetting a
-- pre-existing param2 value that is out-of-range for wallmounted.
-- The fallback vector corresponds to param2 = 0.
-- Attach to whatever this node is "mounted to".
-- This where tile no. 2 points at.
-- The fallback vector here is used for the same reason as
-- for facedir nodes.
d = core.wallmounted_to_dir(n.param2) or vector.new(0, 1, 0)
else
d.y = -1
@@ -496,22 +529,23 @@ function core.check_single_for_falling(p)
if same and d_bottom.paramtype2 == "leveled" and
core.get_node_level(p_bottom) <
core.get_node_max_level(p_bottom) then
convert_to_falling_node(p, n)
return true
local success, _ = convert_to_falling_node(p, n)
return success
end
-- Otherwise only if the bottom node is considered "fall through"
if not same and
(not d_bottom.walkable or d_bottom.buildable_to) and
(core.get_item_group(n.name, "float") == 0 or
d_bottom.liquidtype == "none") then
convert_to_falling_node(p, n)
return true
local success, _ = convert_to_falling_node(p, n)
return success
end
end
end
if core.get_item_group(n.name, "attached_node") ~= 0 then
if not builtin_shared.check_attached_node(p, n) then
local an = core.get_item_group(n.name, "attached_node")
if an ~= 0 then
if not builtin_shared.check_attached_node(p, n, an) then
drop_attached_node(p)
return true
end

View File

@@ -24,6 +24,11 @@ core.features = {
particlespawner_tweenable = true,
dynamic_add_media_table = true,
get_sky_as_table = true,
get_light_data_buffer = true,
mod_storage_on_disk = true,
compress_zstd = true,
sound_params_start_time = true,
physics_overrides_v2 = true,
}
function core.has_feature(arg)

View File

@@ -33,7 +33,7 @@ local function get_relevant_tables(transient)
end
end
function core.forceload_block(pos, transient)
function core.forceload_block(pos, transient, limit)
-- set changed flag
forceload_blocks_changed = true
@@ -46,7 +46,8 @@ function core.forceload_block(pos, transient)
elseif other_table[hash] ~= nil then
relevant_table[hash] = 1
else
if total_forceloaded >= (tonumber(core.settings:get("max_forceloaded_blocks")) or 16) then
limit = limit or tonumber(core.settings:get("max_forceloaded_blocks")) or 16
if limit >= 0 and total_forceloaded >= limit then
return false
end
total_forceloaded = total_forceloaded+1

View File

@@ -8,9 +8,10 @@ local gamepath = scriptpath .. "game".. DIR_DELIM
local builtin_shared = {}
dofile(gamepath .. "constants.lua")
dofile(gamepath .. "item_s.lua")
assert(loadfile(commonpath .. "item_s.lua"))(builtin_shared)
assert(loadfile(gamepath .. "item.lua"))(builtin_shared)
dofile(gamepath .. "register.lua")
assert(loadfile(commonpath .. "register.lua"))(builtin_shared)
assert(loadfile(gamepath .. "register.lua"))(builtin_shared)
if core.settings:get_bool("profiler.load") then
profiler = dofile(scriptpath .. "profiler" .. DIR_DELIM .. "init.lua")
@@ -37,4 +38,6 @@ dofile(gamepath .. "statbars.lua")
dofile(gamepath .. "knockback.lua")
dofile(gamepath .. "async.lua")
core.after(0, builtin_shared.cache_content_ids)
profiler = nil

View File

@@ -205,7 +205,9 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2,
newnode.param2 = core.dir_to_wallmounted(dir)
-- Calculate the direction for furnaces and chests and stuff
elseif (def.paramtype2 == "facedir" or
def.paramtype2 == "colorfacedir") and not param2 then
def.paramtype2 == "colorfacedir" or
def.paramtype2 == "4dir" or
def.paramtype2 == "color4dir") and not param2 then
local placer_pos = placer and placer:get_pos()
if placer_pos then
local dir = vector.subtract(above, placer_pos)
@@ -225,6 +227,8 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2,
color_divisor = 8
elseif def.paramtype2 == "colorfacedir" then
color_divisor = 32
elseif def.paramtype2 == "color4dir" then
color_divisor = 4
elseif def.paramtype2 == "colordegrotate" then
color_divisor = 32
end
@@ -236,10 +240,11 @@ function core.item_place_node(itemstack, placer, pointed_thing, param2,
end
-- Check if the node is attached and if it can be placed there
if core.get_item_group(def.name, "attached_node") ~= 0 and
not builtin_shared.check_attached_node(place_to, newnode) then
local an = core.get_item_group(def.name, "attached_node")
if an ~= 0 and
not builtin_shared.check_attached_node(place_to, newnode, an) then
log("action", "attached node " .. def.name ..
" can not be placed at " .. core.pos_to_string(place_to))
" cannot be placed at " .. core.pos_to_string(place_to))
return itemstack, nil
end
@@ -345,8 +350,26 @@ function core.item_drop(itemstack, dropper, pos)
-- environment failed
end
function core.item_pickup(itemstack, picker, pointed_thing, ...)
itemstack = ItemStack(itemstack)
-- Invoke global on_item_pickup callbacks.
for _, callback in ipairs(core.registered_on_item_pickups) do
local result = callback(itemstack, picker, pointed_thing, ...)
if result then
return ItemStack(result)
end
end
-- Pickup item.
local inv = picker and picker:get_inventory()
if inv then
return inv:add_item("main", itemstack)
end
return itemstack
end
function core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed_thing)
for _, callback in pairs(core.registered_on_item_eats) do
for _, callback in ipairs(core.registered_on_item_eats) do
local result = callback(hp_change, replace_with_item, itemstack, user, pointed_thing)
if result then
return result
@@ -367,22 +390,20 @@ function core.do_item_eat(hp_change, replace_with_item, itemstack, user, pointed
-- Changing hp might kill the player causing mods to do who-knows-what to the
-- inventory, so do this before set_hp().
if replace_with_item then
if itemstack:is_empty() then
itemstack:add_item(replace_with_item)
else
local inv = user:get_inventory()
-- Check if inv is null, since non-players don't have one
if inv and inv:room_for_item("main", {name=replace_with_item}) then
inv:add_item("main", replace_with_item)
else
local pos = user:get_pos()
pos.y = math.floor(pos.y + 0.5)
core.add_item(pos, replace_with_item)
end
replace_with_item = itemstack:add_item(replace_with_item)
user:set_wielded_item(itemstack)
if not replace_with_item:is_empty() then
local inv = user:get_inventory()
-- Check if inv is null, since non-players don't have one
if inv then
replace_with_item = inv:add_item("main", replace_with_item)
end
end
user:set_wielded_item(itemstack)
if not replace_with_item:is_empty() then
local pos = user:get_pos()
pos.y = math.floor(pos.y + 0.5)
core.add_item(pos, replace_with_item)
end
user:set_hp(user:get_hp() + hp_change)
@@ -585,6 +606,7 @@ core.nodedef_default = {
-- Interaction callbacks
on_place = redef_wrapper(core, 'item_place'), -- core.item_place
on_drop = redef_wrapper(core, 'item_drop'), -- core.item_drop
on_pickup = redef_wrapper(core, 'item_pickup'), -- core.item_pickup
on_use = nil,
can_dig = nil,
@@ -597,8 +619,8 @@ core.nodedef_default = {
-- Node properties
drawtype = "normal",
visual_scale = 1.0,
tiles = {},
special_tiles = {},
tiles = nil,
special_tiles = nil,
post_effect_color = {a=0, r=0, g=0, b=0},
paramtype = "none",
paramtype2 = "none",
@@ -637,6 +659,7 @@ core.craftitemdef_default = {
-- Interaction callbacks
on_place = redef_wrapper(core, 'item_place'), -- core.item_place
on_drop = redef_wrapper(core, 'item_drop'), -- core.item_drop
on_pickup = redef_wrapper(core, 'item_pickup'), -- core.item_pickup
on_secondary_use = redef_wrapper(core, 'item_secondary_use'),
on_use = nil,
}
@@ -657,6 +680,7 @@ core.tooldef_default = {
on_place = redef_wrapper(core, 'item_place'), -- core.item_place
on_secondary_use = redef_wrapper(core, 'item_secondary_use'),
on_drop = redef_wrapper(core, 'item_drop'), -- core.item_drop
on_pickup = redef_wrapper(core, 'item_pickup'), -- core.item_pickup
on_use = nil,
}
@@ -673,8 +697,9 @@ core.noneitemdef_default = { -- This is used for the hand and unknown items
tool_capabilities = nil,
-- Interaction callbacks
on_place = redef_wrapper(core, 'item_place'),
on_place = redef_wrapper(core, 'item_place'), -- core.item_place
on_secondary_use = redef_wrapper(core, 'item_secondary_use'),
on_pickup = redef_wrapper(core, 'item_pickup'), -- core.item_pickup
on_drop = nil,
on_use = nil,
}

View File

@@ -69,6 +69,7 @@ core.register_entity(":__builtin:item", {
automatic_rotate = math.pi * 0.5 * 0.2 / size,
wield_item = self.itemstring,
glow = glow,
infotext = stack:get_description(),
})
-- cache for usage in on_step
@@ -103,7 +104,7 @@ core.register_entity(":__builtin:item", {
try_merge_with = function(self, own_stack, object, entity)
if self.age == entity.age then
-- Can not merge with itself
-- Cannot merge with itself
return false
end
@@ -113,7 +114,7 @@ core.register_entity(":__builtin:item", {
own_stack:get_meta() ~= stack:get_meta() or
own_stack:get_wear() ~= stack:get_wear() or
own_stack:get_free_space() == 0 then
-- Can not merge different or full stack
-- Cannot merge different or full stack
return false
end
@@ -178,6 +179,11 @@ core.register_entity(":__builtin:item", {
return
end
-- Prevent assert when item_entity is attached
if moveresult == nil and self.object:get_attach() then
return
end
if self.force_out then
-- This code runs after the entity got a push from the is_stuck code.
-- It makes sure the entity is entirely outside the solid node
@@ -318,16 +324,29 @@ core.register_entity(":__builtin:item", {
end
end,
on_punch = function(self, hitter)
local inv = hitter:get_inventory()
if inv and self.itemstring ~= "" then
local left = inv:add_item("main", self.itemstring)
if left and not left:is_empty() then
self:set_item(left)
return
end
on_punch = function(self, hitter, ...)
if self.itemstring == "" then
self.object:remove()
return
end
-- Call on_pickup callback in item definition.
local itemstack = ItemStack(self.itemstring)
local callback = itemstack:get_definition().on_pickup
local ret = callback(itemstack, hitter, {type = "object", ref = self.object}, ...)
if not ret then
-- Don't modify (and don't reset rotation)
return
end
itemstack = ItemStack(ret)
-- Handle the leftover itemstack
if itemstack:is_empty() then
self.itemstring = ""
self.object:remove()
else
self:set_item(itemstack)
end
self.itemstring = ""
self.object:remove()
end,
})

View File

@@ -1,4 +1,4 @@
-- can be overriden by mods
-- can be overridden by mods
function core.calculate_knockback(player, hitter, time_from_last_punch, tool_capabilities, dir, distance, damage)
if damage == 0 or player:get_armor_groups().immortal then
return 0.0

View File

@@ -121,7 +121,7 @@ function core.get_player_radius_area(player_name, radius)
end
-- To be overriden by protection mods
-- To be overridden by protection mods
function core.is_protected(pos, name)
return false
@@ -261,6 +261,11 @@ function core.get_globals_to_transfer()
local all = {
registered_items = copy_filtering(core.registered_items),
registered_aliases = core.registered_aliases,
nodedef_default = copy_filtering(core.nodedef_default),
craftitemdef_default = copy_filtering(core.craftitemdef_default),
tooldef_default = copy_filtering(core.tooldef_default),
noneitemdef_default = copy_filtering(core.noneitemdef_default),
}
return all
end

View File

@@ -8,10 +8,9 @@
-- Misc. API functions
--
-- This must match the implementation in src/script/common/c_converter.h
function core.hash_node_position(pos)
return (pos.z + 32768) * 65536 * 65536
+ (pos.y + 32768) * 65536
+ pos.x + 32768
return (pos.z + 0x8000) * 0x100000000 + (pos.y + 0x8000) * 0x10000 + (pos.x + 0x8000)
end

View File

@@ -1,5 +1,6 @@
-- Minetest: builtin/register.lua
local builtin_shared = ...
local S = core.get_translator("__builtin")
--
@@ -79,8 +80,22 @@ local function check_modname_prefix(name)
end
end
local function check_node_list(list, field)
local t = type(list)
if t == "table" then
for _, entry in pairs(list) do
assert(type(entry) == "string",
"Field '" .. field .. "' contains non-string entry")
end
elseif t ~= "string" and t ~= "nil" then
error("Field '" .. field .. "' has invalid type " .. t)
end
end
function core.register_abm(spec)
-- Add to core.registered_abms
check_node_list(spec.nodenames, "nodenames")
check_node_list(spec.neighbors, "neighbors")
assert(type(spec.action) == "function", "Required field 'action' of type function")
core.registered_abms[#core.registered_abms + 1] = spec
spec.mod_origin = core.get_current_modname() or "??"
@@ -89,6 +104,7 @@ end
function core.register_lbm(spec)
-- Add to core.registered_lbms
check_modname_prefix(spec.name)
check_node_list(spec.nodenames, "nodenames")
assert(type(spec.action) == "function", "Required field 'action' of type function")
core.registered_lbms[#core.registered_lbms + 1] = spec
spec.mod_origin = core.get_current_modname() or "??"
@@ -303,14 +319,16 @@ end
function core.on_craft(itemstack, player, old_craft_list, craft_inv)
for _, func in ipairs(core.registered_on_crafts) do
itemstack = func(itemstack, player, old_craft_list, craft_inv) or itemstack
-- cast to ItemStack since func() could return a string
itemstack = ItemStack(func(itemstack, player, old_craft_list, craft_inv) or itemstack)
end
return itemstack
end
function core.craft_predict(itemstack, player, old_craft_list, craft_inv)
for _, func in ipairs(core.registered_craft_predicts) do
itemstack = func(itemstack, player, old_craft_list, craft_inv) or itemstack
-- cast to ItemStack since func() could return a string
itemstack = ItemStack(func(itemstack, player, old_craft_list, craft_inv) or itemstack)
end
return itemstack
end
@@ -403,55 +421,6 @@ function core.override_item(name, redefinition)
register_item_raw(item)
end
do
local default = {mod = "??", name = "??"}
core.callback_origins = setmetatable({}, {
__index = function()
return default
end
})
end
function core.run_callbacks(callbacks, mode, ...)
assert(type(callbacks) == "table")
local cb_len = #callbacks
if cb_len == 0 then
if mode == 2 or mode == 3 then
return true
elseif mode == 4 or mode == 5 then
return false
end
end
local ret = nil
for i = 1, cb_len do
local origin = core.callback_origins[callbacks[i]]
core.set_last_run_mod(origin.mod)
local cb_ret = callbacks[i](...)
if mode == 0 and i == 1 then
ret = cb_ret
elseif mode == 1 and i == cb_len then
ret = cb_ret
elseif mode == 2 then
if not cb_ret or i == 1 then
ret = cb_ret
end
elseif mode == 3 then
if cb_ret then
return cb_ret
end
ret = cb_ret
elseif mode == 4 then
if (cb_ret and not ret) or i == 1 then
ret = cb_ret
end
elseif mode == 5 and cb_ret then
return cb_ret
end
end
return ret
end
function core.run_priv_callbacks(name, priv, caller, method)
local def = core.registered_privileges[priv]
if not def or not def["on_" .. method] or
@@ -468,34 +437,6 @@ end
-- Callback registration
--
local function make_registration()
local t = {}
local registerfunc = function(func)
t[#t + 1] = func
core.callback_origins[func] = {
mod = core.get_current_modname() or "??",
name = debug.getinfo(1, "n").name or "??"
}
--local origin = core.callback_origins[func]
--print(origin.name .. ": " .. origin.mod .. " registering cbk " .. tostring(func))
end
return t, registerfunc
end
local function make_registration_reverse()
local t = {}
local registerfunc = function(func)
table.insert(t, 1, func)
core.callback_origins[func] = {
mod = core.get_current_modname() or "??",
name = debug.getinfo(1, "n").name or "??"
}
--local origin = core.callback_origins[func]
--print(origin.name .. ": " .. origin.mod .. " registering cbk " .. tostring(func))
end
return t, registerfunc
end
local function make_registration_wrap(reg_fn_name, clear_fn_name)
local list = {}
@@ -583,6 +524,9 @@ core.registered_decorations = make_registration_wrap("register_decoration", "cle
core.unregister_biome = make_wrap_deregistration(core.register_biome,
core.clear_registered_biomes, core.registered_biomes)
local make_registration = builtin_shared.make_registration
local make_registration_reverse = builtin_shared.make_registration_reverse
core.registered_on_chat_messages, core.register_on_chat_message = make_registration()
core.registered_on_chatcommands, core.register_on_chatcommand = make_registration()
core.registered_globalsteps, core.register_globalstep = make_registration()
@@ -605,6 +549,7 @@ core.registered_on_crafts, core.register_on_craft = make_registration()
core.registered_craft_predicts, core.register_craft_predict = make_registration()
core.registered_on_protection_violation, core.register_on_protection_violation = make_registration()
core.registered_on_item_eats, core.register_on_item_eat = make_registration()
core.registered_on_item_pickups, core.register_on_item_pickup = make_registration()
core.registered_on_punchplayers, core.register_on_punchplayer = make_registration()
core.registered_on_priv_grant, core.register_on_priv_grant = make_registration()
core.registered_on_priv_revoke, core.register_on_priv_revoke = make_registration()
@@ -615,6 +560,17 @@ core.registered_on_player_inventory_actions, core.register_on_player_inventory_a
core.registered_allow_player_inventory_actions, core.register_allow_player_inventory_action = make_registration()
core.registered_on_rightclickplayers, core.register_on_rightclickplayer = make_registration()
core.registered_on_liquid_transformed, core.register_on_liquid_transformed = make_registration()
core.registered_on_mapblocks_changed, core.register_on_mapblocks_changed = make_registration()
core.register_on_mods_loaded(function()
core.after(0, function()
setmetatable(core.registered_on_mapblocks_changed, {
__newindex = function()
error("on_mapblocks_changed callbacks must be registered at load time")
end,
})
end)
end)
--
-- Compatibility for on_mapgen_init()

View File

@@ -8,7 +8,10 @@ VoxelArea = {
zstride = 0,
}
function VoxelArea:new(o)
local class_metatable = {}
setmetatable(VoxelArea, class_metatable)
local function new(self, o)
o = o or {}
setmetatable(o, self)
self.__index = self
@@ -20,6 +23,12 @@ function VoxelArea:new(o)
return o
end
function class_metatable:__call(MinEdge, MaxEdge)
return new(self, {MinEdge = MinEdge, MaxEdge = MaxEdge})
end
VoxelArea.new = new
function VoxelArea:getExtent()
local MaxEdge, MinEdge = self.MaxEdge, self.MinEdge
return vector_new(

View File

@@ -6,19 +6,25 @@
--
-- Initialize some very basic things
function core.debug(...) core.log(table.concat({...}, "\t")) end
if core.print then
local core_print = core.print
-- Override native print and use
-- terminal if that's turned on
function print(...)
function core.error_handler(err, level)
return debug.traceback(tostring(err), level)
end
do
local function concat_args(...)
local n, t = select("#", ...), {...}
for i = 1, n do
t[i] = tostring(t[i])
end
core_print(table.concat(t, "\t"))
return table.concat(t, "\t")
end
function core.debug(...) core.log(concat_args(...)) end
if core.print then
local core_print = core.print
-- Override native print and use
-- terminal if that's turned on
function print(...) core_print(concat_args(...)) end
core.print = nil -- don't pollute our namespace
end
core.print = nil -- don't pollute our namespace
end
math.randomseed(os.time())
minetest = core

View File

@@ -1,4 +1,22 @@
# textdomain: __builtin
Invalid parameters (see /help @1).=Ungültige Parameter (siehe „/help @1“).
Too many arguments, try using just /help <command>=Zu viele Argumente. Probieren Sie es mit „/help <Befehl>“
Available commands: @1=Verfügbare Befehle: @1
Use '/help <cmd>' to get more information, or '/help all' to list everything.=„/help <Befehl>“ benutzen, um mehr Informationen zu erhalten, oder „/help all“, um alles aufzulisten.
Available commands:=Verfügbare Befehle:
Command not available: @1=Befehl nicht verfügbar: @1
[all | privs | <cmd>] [-t]=[all | privs | <Befehl>] [-t]
Get help for commands or list privileges (-t: output in chat)=Hilfe für Befehle erhalten oder Privilegien auflisten (-t: Ausgabe im Chat)
Available privileges:=Verfügbare Privilegien:
Command=Befehl
Parameters=Parameter
For more information, click on any entry in the list.=Für mehr Informationen klicken Sie auf einen beliebigen Eintrag in der Liste.
Double-click to copy the entry to the chat history.=Doppelklicken, um den Eintrag in die Chathistorie einzufügen.
Command: @1 @2=Befehl: @1 @2
Available commands: (see also: /help <cmd>)=Verfügbare Befehle: (siehe auch: /help <Befehl>)
Close=Schließen
Privilege=Privileg
Description=Beschreibung
Empty command.=Leerer Befehl.
Invalid command: @1=Ungültiger Befehl: @1
Invalid command usage.=Ungültige Befehlsverwendung.
@@ -43,7 +61,7 @@ Invalid parameters (see /help revoke).=Ungültige Parameter (siehe „/help revo
Revoke privileges from yourself=Privilegien von Ihnen selbst entfernen
Invalid parameters (see /help revokeme).=Ungültige Parameter (siehe „/help revokeme“).
<name> <password>=<Name> <Passwort>
Set player's password=Passwort von Spieler setzen
Set player's password (sent unencrypted, thus insecure)=Spielerpasswort setzen (unverschlüsselt gesendet, also unsicher)
Name field required.=Namensfeld benötigt.
Your password was cleared by @1.=Ihr Passwort wurde von @1 geleert.
Password of player "@1" cleared.=Passwort von Spieler „@1“ geleert.
@@ -189,30 +207,6 @@ You are already dead.=Sie sind schon tot.
@1 is already dead.=@1 ist bereits tot.
@1 has been killed.=@1 wurde getötet.
Kill player or yourself=Einen Spieler oder Sie selbst töten
Invalid parameters (see /help @1).=Ungültige Parameter (siehe „/help @1“).
Too many arguments, try using just /help <command>=Zu viele Argumente. Probieren Sie es mit „/help <Befehl>“
Available commands: @1=Verfügbare Befehle: @1
Use '/help <cmd>' to get more information, or '/help all' to list everything.=„/help <Befehl>“ benutzen, um mehr Informationen zu erhalten, oder „/help all“, um alles aufzulisten.
Available commands:=Verfügbare Befehle:
Command not available: @1=Befehl nicht verfügbar: @1
[all | privs | <cmd>] [-t]=[all | privs | <Befehl>] [-t]
Get help for commands or list privileges (-t: output in chat)=Hilfe für Befehle erhalten oder Privilegien auflisten (-t: Ausgabe im Chat)
Command=Befehl
Parameters=Parameter
For more information, click on any entry in the list.=Für mehr Informationen klicken Sie auf einen beliebigen Eintrag in der Liste.
Double-click to copy the entry to the chat history.=Doppelklicken, um den Eintrag in die Chathistorie einzufügen.
Command: @1 @2=Befehl: @1 @2
Available commands: (see also: /help <cmd>)=Verfügbare Befehle: (siehe auch: /help <Befehl>)
Close=Schließen
Privilege=Privileg
Description=Beschreibung
Available privileges:=Verfügbare Privilegien:
print [<filter>] | dump [<filter>] | save [<format> [<filter>]] | reset=print [<Filter>] | dump [<Filter>] | save [<Format> [<Filter>]]
Handle the profiler and profiling data=Den Profiler und Profilingdaten verwalten
Statistics written to action log.=Statistiken zum Aktionsprotokoll geschrieben.
Statistics were reset.=Statistiken wurden zurückgesetzt.
Usage: @1=Verwendung: @1
Format can be one of txt, csv, lua, json, json_pretty (structures may be subject to change).=Format kann entweder „txt“, „csv“, „lua“, „json“ oder „json_pretty“ sein (die Struktur kann sich in Zukunft ändern).
@1 joined the game.=@1 ist dem Spiel beigetreten.
@1 left the game.=@1 hat das Spiel verlassen.
@1 left the game (timed out).=@1 hat das Spiel verlassen (Netzwerkzeitüberschreitung).
@@ -239,6 +233,12 @@ Unknown Item=Unbekannter Gegenstand
Air=Luft
Ignore=Ignorieren
You can't place 'ignore' nodes!=Sie können keine „ignore“-Blöcke platzieren!
print [<filter>] | dump [<filter>] | save [<format> [<filter>]] | reset=print [<Filter>] | dump [<Filter>] | save [<Format> [<Filter>]] | reset
Handle the profiler and profiling data=Den Profiler und Profilingdaten verwalten
Statistics written to action log.=Statistiken zum Aktionsprotokoll geschrieben.
Statistics were reset.=Statistiken wurden zurückgesetzt.
Usage: @1=Verwendung: @1
Format can be one of txt, csv, lua, json, json_pretty (structures may be subject to change).=Format kann entweder „txt“, „csv“, „lua“, „json“ oder „json_pretty“ sein (die Struktur kann sich in Zukunft ändern).
Values below show absolute/relative times spend per server step by the instrumented function.=Die unten angegebenen Werte zeigen absolute/relative Zeitspannen, die je Server-Step von der instrumentierten Funktion in Anspruch genommen wurden.
A total of @1 sample(s) were taken.=Es wurden insgesamt @1 Datenpunkt(e) aufgezeichnet.
The output is limited to '@1'.=Die Ausgabe ist beschränkt auf „@1“.

View File

@@ -0,0 +1,246 @@
# textdomain: __builtin
Invalid parameters (see /help @1).=Parameter tidak sah (lihat /help @1).
Too many arguments, try using just /help <command>=Terlalu banyak argumen. Coba hanya gunakan /help <perintah>
Available commands: @1=Perintah yang tersedia: @1
Use '/help <cmd>' to get more information, or '/help all' to list everything.=Gunakan '/help <perintah>' untuk informasi lebih lanjut atau '/help all' untuk melihat daftar semuanya.
Available commands:=Perintah yang tersedia:
Command not available: @1=Perintah tidak tersedia: @1
[all | privs | <cmd>] [-t]=[all | privs | <perintah>] [-t]
Get help for commands or list privileges (-t: output in chat)=Ambil bantuan untuk perintah atau daftar hak (-t: keluaran di obrolan)
Available privileges:=Hak yang ada:
Command=Perintah
Parameters=Parameter
For more information, click on any entry in the list.=Untuk informasi lebih lanjut, klik pada entri apa pun dalam daftar.
Double-click to copy the entry to the chat history.=Klik ganda untuk menyalin entri ke riwayat obrolan.
Command: @1 @2=Perintah: @1 @2
Available commands: (see also: /help <cmd>)=Perintah yang tersedia: (lihat juga: /help <perintah>)
Close=Tutup
Privilege=Hak
Description=Deskripsi
Empty command.=Perintah kosong.
Invalid command: @1=Perintah tidak sah: @1
Invalid command usage.=Penggunaan perintah tidak sah.
(@1 s)= (@1 detik)
Command execution took @1 s=Pelaksanaan perintah memerlukan @1 detik
You don't have permission to run this command (missing privileges: @1).=Anda tidak memiliki izin untuk menjalankan perintah ini (hak tidak ada: @1).
Unable to get position of player @1.=Tidak dapat mengambil letak pemain @1.
Incorrect area format. Expected: (x1,y1,z1) (x2,y2,z2)=Format daerah tidak sah. Diharapkan: (x1,y1,z1) (x2,y2,z2)
<action>=<tindakan>
Show chat action (e.g., '/me orders a pizza' displays '<player name> orders a pizza')=Tampilkan tindakan obrolan (misal, '/me memesan piza' menampilkan '<nama pemain> memesan piza')
Show the name of the server owner=Tampilkan nama pemilik server
The administrator of this server is @1.=Pengurus server ini adalah @1.
There's no administrator named in the config file.=Tidak ada nama pengurus dalam berkas konfigurasi.
@1 does not have any privileges.=@1 tidak punya hak apa pun.
Privileges of @1: @2=Hak @1: @2
[<name>]=[<nama>]
Show privileges of yourself or another player=Tampilkan hak diri Anda atau pemain lain
Player @1 does not exist.=Pemain @1 tidak ada.
<privilege>=<hak istimewa>
Return list of all online players with privilege=Tampilkan daftar semua pemain daring dengan hak yang diberikan
Invalid parameters (see /help haspriv).=Parameter tidak sah (lihat /help haspriv).
Unknown privilege!=Hak tidak diketahui!
No online player has the "@1" privilege.=Tidak ada pemain daring dengan hak "@1".
Players online with the "@1" privilege: @2=Pemain daring dengan hak "@1": @2
Your privileges are insufficient.=Hak Anda tidak cukup.
Your privileges are insufficient. '@1' only allows you to grant: @2=Hak Anda tidak cukup. '@1' hanya membolehkan Anda untuk memberi hak: @2
Unknown privilege: @1=Hak tidak diketahui: @1
@1 granted you privileges: @2=@1 memberi Anda hak: @2
<name> (<privilege> [, <privilege2> [<...>]] | all)=<nama> (<hak> [, <hak2> [<...>]] | all)
Give privileges to player=Beri hak kepada pemain
Invalid parameters (see /help grant).=Parameter tidak sah (lihat /help grant).
<privilege> [, <privilege2> [<...>]] | all=<hak> [, <hak2> [<...>]] | all
Grant privileges to yourself=Beri hak-hak kepada diri Anda
Invalid parameters (see /help grantme).=Parameter tidak sah (lihat /help grantme).
Your privileges are insufficient. '@1' only allows you to revoke: @2=Hak Anda tidak cukup. '@1' hanya membolehkan Anda untuk mencabut hak: @2
Note: Cannot revoke in singleplayer: @1=Catatan: Tidak dapat mencabut hak dalam pemain tunggal: @1
Note: Cannot revoke from admin: @1=Catatan: Tidak dapat mencabut hak dari pengurus: @1
No privileges were revoked.=Tidak ada hak yang dicabut.
@1 revoked privileges from you: @2=@1 mencabut hak Anda: @2
Remove privileges from player=Hapus hak dari pemain
Invalid parameters (see /help revoke).=Parameter tidak sah (lihat /help revoke).
Revoke privileges from yourself=Hapus hak dari diri Anda
Invalid parameters (see /help revokeme).=Parameter tidak sah (lihat /help revokeme).
<name> <password>=<nama> <kata sandi>
Set player's password (sent unencrypted, thus insecure)=Atur kata sandi pemain (dikirim tanpa enkripsi sehingga tidak aman)
Name field required.=Isian nama diperlukan.
Your password was cleared by @1.=Kata sandi Anda dikosongkan oleh @1.
Password of player "@1" cleared.=Kata sandi pemain "@1" dikosongkan.
Your password was set by @1.=Kata sandi Anda diatur oleh @1.
Password of player "@1" set.=Kata sandi pemain "@1" diatur.
<name>=<nama>
Set empty password for a player=Atur kata sandi kosong untuk pemain
Reload authentication data=Muat ulang data autentikasi
Done.=Selesai.
Failed.=Gagal.
Remove a player's data=Hapus data pemain
Player "@1" removed.=Pemain "@1" dihapus.
No such player "@1" to remove.=Tidak ada pemain "@1" yang dapat dihapus.
Player "@1" is connected, cannot remove.=Pemain "@1" sedang daring dan tidak dapat dihapus.
Unhandled remove_player return code @1.=Masalah pada remove_player dengan kode @1.
Cannot teleport out of map bounds!=Tidak dapat teleportasi ke luar batas peta!
Cannot get player with name @1.=Tidak dapat mengambil pemain dengan nama @1.
Cannot teleport, @1 is attached to an object!=Tidak dapat meneleportasikan karena @1 terikat kepada sebuah objek!
Teleporting @1 to @2.=Meneleportasikan @1 ke @2.
One does not teleport to oneself.=Tidak dapat teleportasi ke diri sendiri.
Cannot get teleportee with name @1.=Tidak dapat mengambil pemain yang akan diteleportasi dengan nama @1.
Cannot get target player with name @1.=Tidak dapat mengambil pemain tujuan dengan nama @1.
Teleporting @1 to @2 at @3.=Meneleportasikan @1 ke arah @2 di @3.
<X>,<Y>,<Z> | <to_name> | <name> <X>,<Y>,<Z> | <name> <to_name>=<X>,<Y>,<Z> | <nama_tujuan> | <nama> <X>,<Y>,<Z> | <nama> <nama_tujuan>
Teleport to position or player=Teleportasi ke letak tertentu atau pemain
You don't have permission to teleport other players (missing privilege: @1).=Anda tidak punya izin untuk meneleportasikan pemain lain (hak tidak ada: @1)
([-n] <name> <value>) | <name>=([-n] <nama> <nilai>) | <nama>
Set or read server configuration setting=Atur atau baca setelan konfigurasi server
Failed. Cannot modify secure settings. Edit the settings file manually.=Gagal. Tidak dapat mengubah setelan aman. Sunting berkas setelan secara manual.
Failed. Use '/set -n <name> <value>' to create a new setting.=Gagal. Gunakan '/set -n <nama> <nilai>' untuk membuat setelan baru.
@1 @= @2=@1 @= @2
<not set>=<tidak diatur>
Invalid parameters (see /help set).=Parameter tidak sah (lihat /help set).
Finished emerging @1 blocks in @2ms.=Selesai memunculkan @1 blok dalam @2 milidetik.
emergeblocks update: @1/@2 blocks emerged (@3%)=kabar emergeblocks: @1/@2 blok muncul (@3%)
(here [<radius>]) | (<pos1> <pos2>)=(here [<jari-jari>]) | (<letak1> <letak2>)
Load (or, if nonexistent, generate) map blocks contained in area pos1 to pos2 (<pos1> and <pos2> must be in parentheses)=Muat (atau buat jika belum ada) blok peta yang ada dalam daerah dari letak1 ke letak2 (<letak1> dan <letak2> harus dalam tanda kurung)
Started emerge of area ranging from @1 to @2.=Mulai memunculkan daerah dari @1 ke @2.
Delete map blocks contained in area pos1 to pos2 (<pos1> and <pos2> must be in parentheses)=Hapus blok peta yang ada dalam daerah dari letak1 ke letak2 (<letak1> dan <letak2> harus dalam tanda kurung)
Successfully cleared area ranging from @1 to @2.=Berhasil menghapus daerah dari @1 ke @2.
Failed to clear one or more blocks in area.=Gagal menghapus satu atau beberapa blok dalam daerah.
Resets lighting in the area between pos1 and pos2 (<pos1> and <pos2> must be in parentheses)=Atur ulang pencahayaan dalam daerah dari letak1 ke letak2 (<letak1> dan <letak2> harus dalam tanda kurung)
Successfully reset light in the area ranging from @1 to @2.=Berhasil mengatur ulang pencahayaan dalam daerah dari @1 ke @2.
Failed to load one or more blocks in area.=Gagal memuat satu atau beberapa blok dalam daerah.
List mods installed on the server=Daftar mod yang dipasang di server
No mods installed.=Tiada mod yang dipasang.
Cannot give an empty item.=Tidak dapat memberikan barang kosong.
Cannot give an unknown item.=Tidak dapat memberikan barang yang tidak diketahui.
Giving 'ignore' is not allowed.=Memberikan 'ignore' tidak dibolehkan.
@1 is not a known player.=@1 bukan pemain yang diketahui.
@1 partially added to inventory.=@1 ditambahkan sebagian ke inventaris.
@1 could not be added to inventory.=@1 tidak dapat ditambahkan ke inventaris.
@1 added to inventory.=@1 ditambahkan ke inventaris.
@1 partially added to inventory of @2.=@1 ditambahkan sebagian ke inventaris @2.
@1 could not be added to inventory of @2.=@1 tidak dapat ditambahkan ke inventaris @2.
@1 added to inventory of @2.=@1 ditambahkan ke inventaris @2.
<name> <ItemString> [<count> [<wear>]]=<nama> <ItemString> [<jumlah> [<penggunaan>]]
Give item to player=Beri barang kepada pemain
Name and ItemString required.=Nama dan ItemString diperlukan.
<ItemString> [<count> [<wear>]]=<ItemString> [<jumlah> [<penggunaan>]]
Give item to yourself=Beri barang kepada diri Anda
ItemString required.=ItemString diperlukan.
<EntityName> [<X>,<Y>,<Z>]=<EntityName> [<X>,<Y>,<Z>]
Spawn entity at given (or your) position=Bangkitkan entitas pada letak tertentu (atau letak Anda)
EntityName required.=EntityName diperlukan.
Unable to spawn entity, player is nil.=Tidak dapat membangkitkan entitas karena pemain bernilai nil.
Cannot spawn an unknown entity.=Tidak dapat membangkitkan entitas yang tidak diketahui.
Invalid parameters (@1).=Parameter tidak sah (@1).
@1 spawned.=@1 dibangkitkan.
@1 failed to spawn.=@1 gagal dibangkitkan.
Destroy item in hand=Hapus barang di tangan.
Unable to pulverize, no player.=Gagal menghapus karena pemain tidak ada.
Unable to pulverize, no item in hand.=Gagal menghapus karena barang tidak ada di tangan.
An item was pulverized.=Sebuah barang dihapus.
[<range>] [<seconds>] [<limit>]=[<jangkauan>] [<detik>] [<batas>]
Check who last touched a node or a node near it within the time specified by <seconds>. Default: range @= 0, seconds @= 86400 @= 24h, limit @= 5. Set <seconds> to inf for no time limit=Periksa yang terakhir menyentuh sebuah nodus atau nodus di sekitarnya dalam waktu tertentu yang diatur dengan <detik>. Bawaan: jangkauan @= 0, detik @= 86400 @= 24 jam, batas @= 5. Atur <detik> ke inf untuk tanpa batas waktu
Rollback functions are disabled.=Fungsi cadangan (rollback) dimatikan.
That limit is too high!=Batasnya terlalu tinggi!
Checking @1 ...=Memeriksa @1 ...
Nobody has touched the specified location in @1 seconds.=Tidak ada yang menyentuh lokasi yang diberikan dalam @1 detik.
@1 @2 @3 -> @4 @5 seconds ago.=@1 @2 @3 -> @4 @5 detik yang lalu.
Punch a node (range@=@1, seconds@=@2, limit@=@3).=Pukul sebuah nodus (jangkauan@=@1, detik@=@2, batas@=@3).
(<name> [<seconds>]) | (:<actor> [<seconds>])=(<nama> [<detik>]) | (:<pemeran> [<detik>])
Revert actions of a player. Default for <seconds> is 60. Set <seconds> to inf for no time limit=Batalkan tindakan pemain. Bawaan untuk <detik> adalah 60. Atur <detik> ke inf untuk tanpa batas waktu
Invalid parameters. See /help rollback and /help rollback_check.=Parameter tidak sah. Lihat /help rollback dan /help rollback_check.
Reverting actions of player '@1' since @2 seconds.=Membatalkan tindakan pemain '@1' sejak @2 detik.
Reverting actions of @1 since @2 seconds.=Membatalkan tindakan @1 sejak @2 detik.
(log is too long to show)=(log terlalu panjang untuk ditampilkan)
Reverting actions succeeded.=Pembatalan tindakan berhasil.
Reverting actions FAILED.=Pembatalan tindakan GAGAL.
Show server status=Tampilkan status server
This command was disabled by a mod or game.=Perintah ini dimatikan oleh mod atau permainan.
[<0..23>:<0..59> | <0..24000>]=[<0..23>:<0..59> | <0..24000>]
Show or set time of day=Tampilkan atau atur waktu harian
Current time is @1:@2.=Waktu saat ini @1.@2.
You don't have permission to run this command (missing privilege: @1).=Anda tidak memiliki izin untuk menjalankan perintah ini (hak tidak ada: @1).
Invalid time (must be between 0 and 24000).=Waktu tidak sah (harus antara 0 dan 24000).
Time of day changed.=Waktu harian diubah.
Invalid hour (must be between 0 and 23 inclusive).=Jam tidak sah (harus antara 0 dan 23 inklusif).
Invalid minute (must be between 0 and 59 inclusive).=Menit tidak sah (harus antara 0 dan 59 inklusif).
Show day count since world creation=Tampilkan hitungan hari sejak pembuatan dunia
Current day is @1.=Sekarang hari @1.
[<delay_in_seconds> | -1] [-r] [<message>]=[<jeda_dalam_detik> | -1] [-r] [<pesan>]
Shutdown server (-1 cancels a delayed shutdown, -r allows players to reconnect)=Matikan server (-1 membatalkan mati terjadwal, -r membolehkan pemain untuk menyambung ulang)
Server shutting down (operator request).=Server dimatikan (permintaan operator).
Ban the IP of a player or show the ban list=Blokir IP pemain atau tampilkan daftar blokir
The ban list is empty.=Daftar blokir kosong.
Ban list: @1=Daftar blokir: @1
You cannot ban players in singleplayer!=Anda tidak dapat memblokir pemain dalam pemain tunggal!
Player is not online.=Pemain tidak daring.
Failed to ban player.=Gagal memblokir pemain.
Banned @1.=@1 diblokir.
<name> | <IP_address>=<nama> | <alamat_IP>
Remove IP ban belonging to a player/IP=Hapus blokir IP yang dimiliki pemain
Failed to unban player/IP.=Gagal menghapus blokir pemain/IP.
Unbanned @1.=@1 dihapus blokir.
<name> [<reason>]=<nama> [<alasan>]
Kick a player=Tendang keluar pemain
Failed to kick player @1.=Gagal menendang keluar pemain @1.
Kicked @1.=@1 ditendang keluar.
[full | quick]=[full | quick]
Clear all objects in world=Hapus semua objek dalam dunia
Invalid usage, see /help clearobjects.=Penggunaan tidak sah. Lihat /help clearobjects.
Clearing all objects. This may take a long time. You may experience a timeout. (by @1)=Menghapus semua objek. Ini mungkin perlu waktu lama. Anda mungkin mengalami kehabisan waktu. (oleh @1)
Cleared all objects.=Semua objek dihapus.
<name> <message>=<nama> <pesan>
Send a direct message to a player=Kirim pesan langsung kepada pemain
Invalid usage, see /help msg.=Penggunaan tidak sah. Lihat /help msg.
The player @1 is not online.=Pemain @1 tidak daring.
DM from @1: @2=Pesan langsung dari @1: @2
Message sent.=Pesan terkirim.
Get the last login time of a player or yourself=Ambil waktu masuk terakhir pemain atau diri Anda
@1's last login time was @2.=Waktu masuk terakhir @1 adalah @2.
@1's last login time is unknown.=Waktu masuk terakhir @1 tidak diketahui.
Clear the inventory of yourself or another player=Bersihkan inventaris diri Anda atau pemain lain
You don't have permission to clear another player's inventory (missing privilege: @1).=Anda tidak punya izin untuk membersihkan inventaris pemain lain (hak tidak ada: @1).
@1 cleared your inventory.=@1 membersihkan inventaris Anda.
Cleared @1's inventory.=Inventaris @1 dibersihkan.
Player must be online to clear inventory!=Pemain harus daring untuk dapat dibersihkan inventarisnya.
Players can't be killed, damage has been disabled.=Pemain tidak dapat dibunuh karena kerusakan dimatikan.
Player @1 is not online.=Pemain @1 tidak daring.
You are already dead.=Anda telah mati.
@1 is already dead.=@1 telah mati.
@1 has been killed.=@1 telah dibunuh.
Kill player or yourself=Bunuh pemain atau diri Anda
@1 joined the game.=@1 bergabung dalam permainan.
@1 left the game.=@1 keluar permainan.
@1 left the game (timed out).=@1 keluar permainan (kehabisan waktu).
(no description)=(tanpa deskripsi)
Can interact with things and modify the world=Dapat berinteraksi dengan barang dan mengubah dunia
Can speak in chat=Dapat berbicara di obrolan
Can modify basic privileges (@1)=Dapat mengubah hak-hak dasar (@1)
Can modify privileges=Dapat mengubah hak-hak
Can teleport self=Dapat teleportasi diri
Can teleport other players=Dapat meneleportasikan pemain lain
Can set the time of day using /time=Dapat mengatur waktu harian dengan /time
Can do server maintenance stuff=Dapat melakukan tindakan perawatan server
Can bypass node protection in the world=Dapat menembus pengamanan nodus dalam dunia
Can ban and unban players=Dapat memblokir atau menghapus blokir pemain
Can kick players=Dapat menendang keluar pemain
Can use /give and /giveme=Dapat menggunakan /give dan /giveme
Can use /setpassword and /clearpassword=Dapat menggunakan /setpassword dan /clearpassword
Can use fly mode=Dapat menggunakan mode terbang
Can use fast mode=Dapat menggunakan mode cepat
Can fly through solid nodes using noclip mode=Dapat terbang menembus nodus padat dengan mode tembus blok
Can use the rollback functionality=Dapat menggunakan fungsi cadangan (rollback)
Can enable wireframe=Dapat melihat dalam mode rangka kawat
Unknown Item=Barang Tak Diketahui
Air=Udara
Ignore=Ignore
You can't place 'ignore' nodes!=Anda tidak dapat menaruh nodus 'ignore'!
print [<filter>] | dump [<filter>] | save [<format> [<filter>]] | reset=print [<filter>] | dump [<filter>] | save [<format> [<filter>]] | reset
Handle the profiler and profiling data=Menangani profiler dan data profiling
Statistics written to action log.=Statistik ditulis ke log action.
Statistics were reset.=Statistik diatur ulang.
Usage: @1=Penggunaan: @1
Format can be one of txt, csv, lua, json, json_pretty (structures may be subject to change).=Format berupa salah satu dari txt, csv, lua, json, json_pretty (struktur mungkin berubah).
Values below show absolute/relative times spend per server step by the instrumented function.=Nilai berikut menampilkan waktu mutlak/relatif yang dihabiskan tiap langkah server oleh fungsi instrumen.
A total of @1 sample(s) were taken.=Total @1 sampel yang diambil.
The output is limited to '@1'.=Keluaran dibatasi ke '@1'.
Saving of profile failed: @1=Penyimpanan profil gagal: @1
Profile saved to @1=Profil disimpan ke @1

View File

@@ -1,78 +1,97 @@
# textdomain: __builtin
# note for transaltors: sono state seguite le norme di https://italianoinclusivo.it/ a parte per il suffisso -tore -trice, con l'intento di trasformarlo in un epiceno
Invalid parameters (see /help @1).=Parametri non validi (vedi /help @1)
Too many arguments, try using just /help <command>=Troppi argomenti, prova a usare /help <comando>
Available commands: @1=Comandi disponibili: @1
Use '/help <cmd>' to get more information, or '/help all' to list everything.=Usa '/help <comando>' per ottenere più informazioni, o '/help all' per elencare tutti i comandi.
Available commands:=Comandi disponibili:
Command not available: @1=Comando non disponibile: @1
[all | privs | <cmd>] [-t]=[all | privs | <comando>] [-t]
Get help for commands or list privileges (-t: output in chat)=Richiama la finestra d'aiuto dei comandi o dei privilegi (-t: mostra in chat)
Available privileges:=Privilegi disponibili:
Command=Comando
Parameters=Parametri
For more information, click on any entry in the list.=Per più informazioni, clicca su una qualsiasi voce dell'elenco.
Double-click to copy the entry to the chat history.=Doppio clic per copiare la voce nella cronologia della chat.
Command: @1 @2=Comando: @1 @2
Available commands: (see also: /help <cmd>)=Comandi disponibili: (vedi anche /help <comando>)
Close=Chiudi
Privilege=Privilegio
Description=Descrizione
Empty command.=Comando vuoto.
Invalid command: @1=Comando non valido: @1
Invalid command usage.=Utilizzo del comando non valido.
(@1 s)=
Command execution took @1 s=
(@1 s)= (@1 s)
Command execution took @1 s=L'esecuzione del comando ha richiesto @1 s
You don't have permission to run this command (missing privileges: @1).=Non hai il permesso di eseguire questo comando (privilegi mancanti: @1).
Unable to get position of player @1.=Impossibile ottenere la posizione del giocatore @1.
Unable to get position of player @1.=Impossibile ottenere la posizione del giocatore @1.
Incorrect area format. Expected: (x1,y1,z1) (x2,y2,z2)=Formato dell'area non corretto. Richiesto: (x1,y1,z1) (x2,y2,z2)
<action>=<azione>
Show chat action (e.g., '/me orders a pizza' displays '<player name> orders a pizza')=Mostra un'azione in chat (es. `/me ordina una pizza` mostra `<nome giocatore> ordina una pizza`)
Show the name of the server owner=Mostra il nome del proprietario del server
Show the name of the server owner=Mostra il nome di chi possiede il server
The administrator of this server is @1.=L'amministratore di questo server è @1.
There's no administrator named in the config file.=Non c'è nessun amministratore nel file di configurazione.
@1 does not have any privileges.=
There's no administrator named in the config file.=Non c'è nessun*amministratore nel file di configurazione.
@1 does not have any privileges.=@1 non ha nessun privilegio
Privileges of @1: @2=Privilegi di @1: @2
[<name>]=[<nome>]
Show privileges of yourself or another player=Mostra i privilegi propri o di un altro giocatore
Player @1 does not exist.=Il giocatore @1 non esiste.
Show privileges of yourself or another player=Mostra i privilegi propri o di un*altrə giocatore
Player @1 does not exist.= giocatore @1 non esiste.
<privilege>=<privilegio>
Return list of all online players with privilege=Ritorna una lista di tutti i giocatori connessi col tale privilegio
Return list of all online players with privilege=Ritorna una lista di tuttɜ lɜ giocatori connessɜ col tale privilegio
Invalid parameters (see /help haspriv).=Parametri non validi (vedi /help haspriv).
Unknown privilege!=Privilegio sconosciuto!
No online player has the "@1" privilege.=
Players online with the "@1" privilege: @2=Giocatori connessi con il privilegio "@1": @2
No online player has the "@1" privilege.=Nessunə giocatore ha il privilegio "@1".
Players online with the "@1" privilege: @2=Giocatori connessɜ con il privilegio "@1": @2
Your privileges are insufficient.=I tuoi privilegi sono insufficienti.
Your privileges are insufficient. '@1' only allows you to grant: @2=
Your privileges are insufficient. '@1' only allows you to grant: @2=I tuoi privilegi sono insufficienti. '@1' ti permette soltanto di elargire: @2
Unknown privilege: @1=Privilegio sconosciuto: @1
@1 granted you privileges: @2=@1 ti ha assegnato i seguenti privilegi: @2
<name> (<privilege> [, <privilege2> [<...>]] | all)=
Give privileges to player=Dà privilegi al giocatore
<name> (<privilege> [, <privilege2> [<...>]] | all)=<nome> (<privilegio> [, <privilegio2> [<...>]] | all)
Give privileges to player=Dà privilegi al giocatore
Invalid parameters (see /help grant).=Parametri non validi (vedi /help grant).
<privilege> [, <privilege2> [<...>]] | all=
<privilege> [, <privilege2> [<...>]] | all=<privilegio> [, <privilegio2> [<...>]] | all
Grant privileges to yourself=Assegna dei privilegi a te stessǝ
Invalid parameters (see /help grantme).=Parametri non validi (vedi /help grantme).
Your privileges are insufficient. '@1' only allows you to revoke: @2=
Note: Cannot revoke in singleplayer: @1=
Note: Cannot revoke from admin: @1=
No privileges were revoked.=
Your privileges are insufficient. '@1' only allows you to revoke: @2=I tuoi privilegi sono insufficienti. '@1' ti permette soltanto di revocare: @2
Note: Cannot revoke in singleplayer: @1=N.B.: Non si può revocare in locale: @1
Note: Cannot revoke from admin: @1=N.B.: Non si può revocare a un*amministratore: @1
No privileges were revoked.=Nessun privilegio è stato revocato.
@1 revoked privileges from you: @2=@1 ti ha revocato i seguenti privilegi: @2
Remove privileges from player=Rimuove privilegi dal giocatore
Remove privileges from player=Rimuove privilegi dal giocatore
Invalid parameters (see /help revoke).=Parametri non validi (vedi /help revoke).
Revoke privileges from yourself=Revoca privilegi a te stessǝ
Invalid parameters (see /help revokeme).=Parametri non validi (vedi /help revokeme).
<name> <password>=<nome> <password>
Set player's password=Imposta la password del giocatore
Set player's password (sent unencrypted, thus insecure)=Imposta la password del giocatore (non crittografata, ergo insicura)
Name field required.=Campo "nome" richiesto.
Your password was cleared by @1.=La tua password è stata resettata da @1.
Password of player "@1" cleared.=Password del giocatore "@1" resettata.
Password of player "@1" cleared.=Password del giocatore "@1" resettata.
Your password was set by @1.=La tua password è stata impostata da @1.
Password of player "@1" set.=Password del giocatore "@1" impostata.
Password of player "@1" set.=Password del giocatore "@1" impostata.
<name>=<nome>
Set empty password for a player=Imposta una password vuota a un giocatore
Reload authentication data=Ricarica i dati d'autenticazione
Done.=Fatto.
Failed.=Errore.
Remove a player's data=Rimuove i dati di un giocatore
Remove a player's data=Rimuove i dati di unə giocatore
Player "@1" removed.=Giocatore "@1" rimosso.
No such player "@1" to remove.=Non è presente nessun giocatore "@1" da rimuovere.
Player "@1" is connected, cannot remove.=Il giocatore "@1" è connesso, non può essere rimosso.
No such player "@1" to remove.=Non è presente nessunə giocatore "@1" da rimuovere.
Player "@1" is connected, cannot remove.= giocatore "@1" è connessə, non può essere rimossə.
Unhandled remove_player return code @1.=Codice ritornato da remove_player non gestito (@1).
Cannot teleport out of map bounds!=Non ci si può teletrasportare fuori dai limiti della mappa!
Cannot get player with name @1.=Impossibile trovare il giocatore chiamato @1.
Cannot teleport, @1 is attached to an object!=Impossibile teletrasportare, @1 è attaccato a un oggetto!
Cannot get player with name @1.=Impossibile trovare lə giocatore chiamato @1.
Cannot teleport, @1 is attached to an object!=Impossibile teletrasportare, @1 è attaccatə a un oggetto!
Teleporting @1 to @2.=Teletrasportando @1 da @2.
One does not teleport to oneself.=Non ci si può teletrasportare su se stessi.
Cannot get teleportee with name @1.=Impossibile trovare il giocatore chiamato @1 per il teletrasporto
Cannot get target player with name @1.=Impossibile trovare il giocatore chiamato @1 per il teletrasporto
One does not teleport to oneself.=Non ci si può teletrasportare su se stessɜ.
Cannot get teleportee with name @1.=Impossibile trovare lə giocatore chiamatə @1 per il teletrasporto
Cannot get target player with name @1.=Impossibile trovare lə giocatore chiamato @1 per il teletrasporto
Teleporting @1 to @2 at @3.=Teletrasportando @1 da @2 a @3
<X>,<Y>,<Z> | <to_name> | <name> <X>,<Y>,<Z> | <name> <to_name>=<X>,<Y>,<Z> | <da_nome> | <nome> <X>,<Y>,<Z> | <nome> <da_nome>
Teleport to position or player=Teletrasporta a una posizione o da un giocatore
You don't have permission to teleport other players (missing privilege: @1).=Non hai il permesso di teletrasportare altri giocatori (privilegio mancante: @1).
Teleport to position or player=Teletrasporta a una posizione o da unə giocatore
You don't have permission to teleport other players (missing privilege: @1).=Non hai il permesso di teletrasportare altrɜ giocatori (privilegio mancante: @1).
([-n] <name> <value>) | <name>=([-n] <nome> <valore>) | <nome>
Set or read server configuration setting=Imposta o ottieni le configurazioni del server
Failed. Cannot modify secure settings. Edit the settings file manually.=
Failed. Cannot modify secure settings. Edit the settings file manually.=Errore. Non è possibile modificare le impostazioni di sicurezza. Modifica manualmente il file d'impostazioni.
Failed. Use '/set -n <name> <value>' to create a new setting.=Errore. Usa 'set -n <nome> <valore>' per creare una nuova impostazione
@1 @= @2=@1 @= @2
<not set>=<non impostato>
@@ -89,11 +108,11 @@ Resets lighting in the area between pos1 and pos2 (<pos1> and <pos2> must be in
Successfully reset light in the area ranging from @1 to @2.=Luce nell'area tra @1 e @2 reimpostata con successo.
Failed to load one or more blocks in area.=Errore nel caricare uno o più blocchi mappa nell'area.
List mods installed on the server=Elenca le mod installate nel server
No mods installed.=
No mods installed.=Nessuna mod installata.
Cannot give an empty item.=Impossibile dare un oggetto vuoto.
Cannot give an unknown item.=Impossibile dare un oggetto sconosciuto.
Giving 'ignore' is not allowed.=Non è permesso dare 'ignore'.
@1 is not a known player.=@1 non è un giocatore conosciuto.
@1 is not a known player.=@1 non è unə giocatore conosciutə.
@1 partially added to inventory.=@1 parzialmente aggiunto all'inventario.
@1 could not be added to inventory.=@1 non può essere aggiunto all'inventario.
@1 added to inventory.=@1 aggiunto all'inventario.
@@ -101,7 +120,7 @@ Giving 'ignore' is not allowed.=Non è permesso dare 'ignore'.
@1 could not be added to inventory of @2.=Non è stato possibile aggiungere @1 all'inventario di @2.
@1 added to inventory of @2.=@1 aggiunto all'inventario di @2.
<name> <ItemString> [<count> [<wear>]]=<nome> <NomeOggetto> [<quantità> [<usura>]]
Give item to player=Dà oggetti ai giocatori
Give item to player=Dà oggetti allɜ giocatori
Name and ItemString required.=Richiesti nome e NomeOggetto.
<ItemString> [<count> [<wear>]]=<NomeOggetto> [<quantità> [<usura>]]
Give item to yourself=Dà oggetti a te stessǝ
@@ -109,29 +128,29 @@ ItemString required.=Richiesto NomeOggetto.
<EntityName> [<X>,<Y>,<Z>]=<NomeEntità> [<X>,<Y>,<Z>]
Spawn entity at given (or your) position=Genera un'entità alla data coordinata (o la tua)
EntityName required.=Richiesto NomeEntità
Unable to spawn entity, player is nil.=Impossibile generare l'entità, il giocatore è nil.
Unable to spawn entity, player is nil.=Impossibile generare l'entità, lə giocatore è nil.
Cannot spawn an unknown entity.=Impossibile generare un'entità sconosciuta.
Invalid parameters (@1).=Parametri non validi (@1).
@1 spawned.=Generata entità @1.
@1 failed to spawn.=Errore nel generare @1
Destroy item in hand=Distrugge l'oggetto in mano
Unable to pulverize, no player.=Impossibile polverizzare, nessun giocatore.
Unable to pulverize, no player.=Impossibile polverizzare, nessunə giocatore.
Unable to pulverize, no item in hand.=Impossibile polverizzare, nessun oggetto in mano.
An item was pulverized.=Un oggetto è stato polverizzato.
[<range>] [<seconds>] [<limit>]=[<raggio>] [<secondi>] [<limite>]
Check who last touched a node or a node near it within the time specified by <seconds>. Default: range @= 0, seconds @= 86400 @= 24h, limit @= 5. Set <seconds> to inf for no time limit=Controlla chi è l'ultimo giocatore che ha toccato un nodo o un nodo nelle sue vicinanze, negli ultimi secondi indicati. Di base: raggio @= 0, secondi @= 86400 @= 24h, limite @= 5.
Check who last touched a node or a node near it within the time specified by <seconds>. Default: range @= 0, seconds @= 86400 @= 24h, limit @= 5. Set <seconds> to inf for no time limit=Controlla chi è l'ultimə giocatore che ha toccato un nodo o un nodo nelle sue vicinanze, negli ultimi secondi indicati. Di base: raggio @= 0, secondi @= 86400 @= 24h, limite @= 5.
Rollback functions are disabled.=Le funzioni di rollback sono disabilitate.
That limit is too high!=Il limite è troppo alto!
Checking @1 ...=Controllando @1 ...
Nobody has touched the specified location in @1 seconds.=Nessuno ha toccato il punto specificato negli ultimi @1 secondi.
Nobody has touched the specified location in @1 seconds.=Nessunə ha toccato il punto specificato negli ultimi @1 secondi.
@1 @2 @3 -> @4 @5 seconds ago.=@1 @2 @3 -> @4 @5 secondi fa.
Punch a node (range@=@1, seconds@=@2, limit@=@3).=Colpisce un nodo (raggio@=@1, secondi@=@2, limite@=@3)
(<name> [<seconds>]) | (:<actor> [<seconds>])=(<nome> [<secondi>]) | (:<attore> [<secondi>])
Revert actions of a player. Default for <seconds> is 60. Set <seconds> to inf for no time limit=Riavvolge le azioni di un giocatore. Di base, <secondi> è 60. Imposta <secondi> a inf per nessun limite di tempo
Revert actions of a player. Default for <seconds> is 60. Set <seconds> to inf for no time limit=Riavvolge le azioni di unə giocatore. Di base, <secondi> è 60. Imposta <secondi> a inf per nessun limite di tempo
Invalid parameters. See /help rollback and /help rollback_check.=Parametri non validi. Vedi /help rollback e /help rollback_check.
Reverting actions of player '@1' since @2 seconds.=Riavvolge le azioni del giocatore '@1' avvenute negli ultimi @2 secondi.
Reverting actions of player '@1' since @2 seconds.=Riavvolge le azioni del giocatore '@1' avvenute negli ultimi @2 secondi.
Reverting actions of @1 since @2 seconds.=Riavvolge le azioni di @1 avvenute negli ultimi @2 secondi.
(log is too long to show)=(il log è troppo lungo per essere mostrato)
(log is too long to show)=(lo storico è troppo lungo per essere mostrato)
Reverting actions succeeded.=Riavvolgimento azioni avvenuto con successo.
Reverting actions FAILED.=Errore nel riavvolgere le azioni.
Show server status=Mostra lo stato del server
@@ -140,120 +159,89 @@ This command was disabled by a mod or game.=Questo comando è stato disabilitato
Show or set time of day=Mostra o imposta l'orario della giornata
Current time is @1:@2.=Orario corrente: @1:@2.
You don't have permission to run this command (missing privilege: @1).=Non hai il permesso di eseguire questo comando (privilegio mancante: @1)
Invalid time (must be between 0 and 24000).=
Invalid time (must be between 0 and 24000).=Orario non valido (deve essere tra 0 e 24000).
Time of day changed.=Orario della giornata cambiato.
Invalid hour (must be between 0 and 23 inclusive).=Ora non valida (deve essere tra 0 e 23 inclusi)
Invalid minute (must be between 0 and 59 inclusive).=Minuto non valido (deve essere tra 0 e 59 inclusi)
Show day count since world creation=Mostra il conteggio dei giorni da quando il mondo è stato creato
Current day is @1.=Giorno attuale: @1.
[<delay_in_seconds> | -1] [-r] [<message>]=
Shutdown server (-1 cancels a delayed shutdown, -r allows players to reconnect)=
[<delay_in_seconds> | -1] [-r] [<message>]=[<ritardo_in_secondi> | -1] [-r] [<messaggio>]
Shutdown server (-1 cancels a delayed shutdown, -r allows players to reconnect)=Arresta il server (-1 cancella un arresto programmato, -r permette allɜ giocatori di riconnettersi)
Server shutting down (operator request).=Arresto del server in corso (per richiesta dell'operatore)
Ban the IP of a player or show the ban list=Bandisce l'IP del giocatore o mostra la lista di quelli banditi
The ban list is empty.=La lista banditi è vuota.
Ban list: @1=Lista banditi: @1
You cannot ban players in singleplayer!=
Player is not online.=Il giocatore non è connesso.
Failed to ban player.=Errore nel bandire il giocatore.
Ban the IP of a player or show the ban list=Bandisce l'IP del giocatore o mostra la lista di quellɜ banditɜ
The ban list is empty.=La lista banditɜ è vuota.
Ban list: @1=Lista banditɜ: @1
You cannot ban players in singleplayer!=Non puoi bandire giocatori in locale!
Player is not online.= giocatore non è connessə.
Failed to ban player.=Errore nel bandire lə giocatore.
Banned @1.=@1 banditǝ.
<name> | <IP_address>=<nome> | <indirizzo_IP>
Remove IP ban belonging to a player/IP=Perdona l'IP appartenente a un giocatore/IP
Failed to unban player/IP.=Errore nel perdonare il giocatore/IP
Remove IP ban belonging to a player/IP=Perdona l'IP appartenente a unə giocatore/IP
Failed to unban player/IP.=Errore nel perdonare lə giocatore/IP
Unbanned @1.=@1 perdonatǝ
<name> [<reason>]=<nome> [<ragione>]
Kick a player=Caccia un giocatore
Failed to kick player @1.=Errore nel cacciare il giocatore @1.
Kick a player=Caccia unə giocatore
Failed to kick player @1.=Errore nel cacciare lə giocatore @1.
Kicked @1.=@1 cacciatǝ.
[full | quick]=[full | quick]
Clear all objects in world=Elimina tutti gli oggetti/entità nel mondo
Invalid usage, see /help clearobjects.=Uso incorretto, vedi /help clearobjects.
Clearing all objects. This may take a long time. You may experience a timeout. (by @1)=Eliminando tutti gli oggetti/entità. Questo potrebbe richiedere molto tempo e farti eventualmente crashare. (di @1)
Clearing all objects. This may take a long time. You may experience a timeout. (by @1)=Eliminando tutti gli oggetti/entità. Questo potrebbe richiedere molto tempo e farti disconnettere. (di @1)
Cleared all objects.=Tutti gli oggetti sono stati eliminati.
<name> <message>=<nome> <messaggio>
Send a direct message to a player=Invia un messaggio privato al giocatore
Send a direct message to a player=Invia un messaggio privato a unə giocatore
Invalid usage, see /help msg.=Uso incorretto, vedi /help msg
The player @1 is not online.=Il giocatore @1 non è connesso.
The player @1 is not online.= giocatore @1 non è connessə.
DM from @1: @2=Messaggio privato da @1: @2
Message sent.=Messaggio inviato.
Get the last login time of a player or yourself=Ritorna l'ultimo accesso di un giocatore o di te stessǝ
@1's last login time was @2.=L'ultimo accesso di @1 è avvenuto il @2
@1's last login time is unknown.=L'ultimo accesso di @1 non è conosciuto
Clear the inventory of yourself or another player=Svuota l'inventario tuo o di un altro giocatore
You don't have permission to clear another player's inventory (missing privilege: @1).=Non hai il permesso di svuotare l'inventario di un altro giocatore (privilegio mancante: @1).
Get the last login time of a player or yourself=Ritorna l'ultimo accesso di unə giocatore o di te stessǝ
@1's last login time was @2.=L'ultimo accesso di @1 è avvenuto il @2.
@1's last login time is unknown.=L'ultimo accesso di @1 è ignoto.
Clear the inventory of yourself or another player=Svuota l'inventario tuo o di un*altrə giocatore
You don't have permission to clear another player's inventory (missing privilege: @1).=Non hai il permesso di svuotare l'inventario di un*altrə giocatore (privilegio mancante: @1).
@1 cleared your inventory.=@1 ha svuotato il tuo inventario.
Cleared @1's inventory.=L'inventario di @1 è stato svuotato.
Player must be online to clear inventory!=Il giocatore deve essere connesso per svuotarne l'inventario!
Players can't be killed, damage has been disabled.=I giocatori non possono essere uccisi, il danno è disabilitato.
Player @1 is not online.=Il giocatore @1 non è connesso.
Player must be online to clear inventory!= giocatore deve essere connessə per svuotarne l'inventario!
Players can't be killed, damage has been disabled.= giocatori non possono essere uccisɜ, il danno è disabilitato.
Player @1 is not online.= giocatore @1 non è connesso.
You are already dead.=Sei già mortǝ.
@1 is already dead.=@1 è già mortǝ.
@1 has been killed.=@1 è stato uccisǝ.
Kill player or yourself=Uccide un giocatore o te stessǝ
Invalid parameters (see /help @1).=
Too many arguments, try using just /help <command>=
Available commands: @1=Comandi disponibili: @1
Use '/help <cmd>' to get more information, or '/help all' to list everything.=Usa '/help <comando>' per ottenere più informazioni, o '/help all' per elencare tutti i comandi.
Available commands:=Comandi disponibili:
Command not available: @1=Comando non disponibile: @1
[all | privs | <cmd>] [-t]=
Get help for commands or list privileges (-t: output in chat)=
Command=Comando
Parameters=Parametri
For more information, click on any entry in the list.=Per più informazioni, clicca su una qualsiasi voce dell'elenco.
Double-click to copy the entry to the chat history.=Doppio click per copiare la voce nella cronologia della chat.
Command: @1 @2=Comando: @1 @2
Available commands: (see also: /help <cmd>)=Comandi disponibili: (vedi anche /help <comando>)
Close=Chiudi
Privilege=Privilegio
Description=Descrizione
Available privileges:=Privilegi disponibili:
print [<filter>] | dump [<filter>] | save [<format> [<filter>]] | reset=print [<filtro>] | dump [<filtro>] | save [<formato> [<filtro>]] | reset
Handle the profiler and profiling data=Gestisce il profiler e i dati da esso elaborati
Statistics written to action log.=Statistiche scritte nel log delle azioni.
Statistics were reset.=Le statistiche sono state resettate.
Usage: @1=Utilizzo: @1
Format can be one of txt, csv, lua, json, json_pretty (structures may be subject to change).=I formati supportati sono txt, csv, lua, json e json_pretty (le strutture potrebbero essere soggetti a cambiamenti).
@1 joined the game.=
@1 left the game.=
@1 left the game (timed out).=
Kill player or yourself=Uccide unə giocatore o te stessǝ
@1 joined the game.=@1 si è connessə.
@1 left the game.=@1 si è disconnessə.
@1 left the game (timed out).=@1 si è disconnessə (connessione scaduta).
(no description)=(nessuna descrizione)
Can interact with things and modify the world=Si può interagire con le cose e modificare il mondo
Can speak in chat=Si può parlare in chat
Can modify basic privileges (@1)=
Can modify basic privileges (@1)=Si possono modificare i privilegi di base (@1)
Can modify privileges=Si possono modificare i privilegi
Can teleport self=Si può teletrasportare se stessз
Can teleport other players=Si possono teletrasportare gli altri giocatori
Can teleport other players=Si possono teletrasportare altrɜ giocatori
Can set the time of day using /time=Si può impostate l'orario della giornata tramite /time
Can do server maintenance stuff=Si possono eseguire operazioni di manutenzione del server
Can bypass node protection in the world=Si può aggirare la protezione dei nodi nel mondo
Can ban and unban players=Si possono bandire e perdonare i giocatori
Can kick players=Si possono cacciare i giocatori
Can ban and unban players=Si possono bandire e perdonare giocatori
Can kick players=Si possono cacciare giocatori
Can use /give and /giveme=Si possono usare /give e /give me
Can use /setpassword and /clearpassword=Si possono usare /setpassword e /clearpassword
Can use fly mode=Si può usare la modalità volo
Can use fast mode=Si può usare la modalità rapida
Can fly through solid nodes using noclip mode=Si può volare attraverso i nodi solidi con la modalità incorporea
Can use the rollback functionality=Si può usare la funzione di rollback
Can enable wireframe=
Can enable wireframe=Si può abilitare la vista reticolata
Unknown Item=Oggetto sconosciuto
Air=Aria
Ignore=Ignora
You can't place 'ignore' nodes!=Non puoi piazzare nodi 'ignore'!
Values below show absolute/relative times spend per server step by the instrumented function.=
A total of @1 sample(s) were taken.=
The output is limited to '@1'.=
Saving of profile failed: @1=
Profile saved to @1=
##### not used anymore #####
Invalid time.=Orario non valido.
[all | privs | <cmd>]=[all | privs | <comando>]
Get help for commands or list privileges=Richiama la finestra d'aiuto dei comandi o dei privilegi
Allows enabling various debug options that may affect gameplay=Permette di abilitare varie opzioni di debug che potrebbero influenzare l'esperienza di gioco
[<delay_in_seconds> | -1] [reconnect] [<message>]=[<ritardo_in_secondi> | -1] [reconnect] [<messaggio>]
Shutdown server (-1 cancels a delayed shutdown)=Arresta il server (-1 annulla un arresto programmato)
<name> (<privilege> | all)=<nome> (<privilegio> | all)
<privilege> | all=<privilegio> | all
Can modify 'shout' and 'interact' privileges=Si possono modificare i privilegi 'shout' e 'interact'
print [<filter>] | dump [<filter>] | save [<format> [<filter>]] | reset=print [<filtro>] | dump [<filtro>] | save [<formato> [<filtro>]] | reset
Handle the profiler and profiling data=Gestisce il profiler e i dati da esso elaborati
Statistics written to action log.=Statistiche scritte nel registro delle azioni.
Statistics were reset.=Le statistiche sono state resettate.
Usage: @1=Utilizzo: @1
Format can be one of txt, csv, lua, json, json_pretty (structures may be subject to change).=I formati supportati sono txt, csv, lua, json e json_pretty (le strutture potrebbero essere soggetti a cambiamenti).
Values below show absolute/relative times spend per server step by the instrumented function.=I valori sottostanti mostrano i tempi assoluti/relativi impiegati su ogni singolo step dalla funzione analizzata
A total of @1 sample(s) were taken.=Son stati ottenuti campioni per un totale di @1.
The output is limited to '@1'.=L'output è limitato a '@1'.
Saving of profile failed: @1=Errore nel salvare il profilo: @1
Profile saved to @1=Profilo salvato in @1

View File

@@ -0,0 +1,246 @@
# textdomain: __builtin
Invalid parameters (see /help @1).=Parameter tidak sah (sila lihat /help @1).
Too many arguments, try using just /help <command>=Terlalu banyak argumen, cuba guna /help <perintah> sahaja
Available commands: @1=Perintah yang tersedia: @1
Use '/help <cmd>' to get more information, or '/help all' to list everything.=Gunakan '/help <perintah>' untuk maklumat lanjut, atau '/help all' untuk senaraikan kesemuanya.
Available commands:=Perintah yang tersedia:
Command not available: @1=Perintah tidak tersedia: @1
[all | privs | <cmd>] [-t]=[all | privs | <perintah>] [-t]
Get help for commands or list privileges (-t: output in chat)=Dapatkan bantuan untuk perintah atau senaraikan keistimewaan (-t: output dalam sembang)
Available privileges:=Keistimewaan yang tersedia:
Command=Perintah
Parameters=Parameter
For more information, click on any entry in the list.=Untuk maklumat lanjut, klik pada mana-mana entri dalam senarai.
Double-click to copy the entry to the chat history.=Klik dua kali untuk salin entri ke sejarah sembang.
Command: @1 @2=Perintah: @1 @2
Available commands: (see also: /help <cmd>)=Perintah yang tersedua: (sila lihat juga: /help <perintah>)
Close=Tutup
Privilege=Keistimewaan
Description=Keterangan
Empty command.=Perintah kosong.
Invalid command: @1=Perintah tidak sah: @1
Invalid command usage.=Penggunaan perintah tidak sah.
(@1 s)= (@1 s)
Command execution took @1 s=Pelaksanaan perintah mengambil masa @1 s
You don't have permission to run this command (missing privileges: @1).=Anda tiada kebenaran untuk jalankan perintah ini (tiada keistimewaan: @1).
Unable to get position of player @1.=Tidak mampu mendapatkan kedudukan pemain @1.
Incorrect area format. Expected: (x1,y1,z1) (x2,y2,z2)=Format kawasan tidak betul. Format disangka: (x1,y1,z1) (x2,y2,z2)
<action>=<perbuatan>
Show chat action (e.g., '/me orders a pizza' displays '<player name> orders a pizza')=Tunjuk perbuatan sembang (cth., '/me memesan piza' memaparkan '<nama pemain> memesan piza')
Show the name of the server owner=Tunjuk nama pemilik pelayan
The administrator of this server is @1.=Pentadbir bagi pelayan ini ialah @1.
There's no administrator named in the config file.=Tiada pentadbir dinamakan dalam fail konfigurasi.
@1 does not have any privileges.=@1 tidak mempunyai sebarang keistimewaan.
Privileges of @1: @2=Keistimewaan milik @1: @2
[<name>]=[<nama>]
Show privileges of yourself or another player=Tunjuk keistimewaan diri anda atau pemain lain
Player @1 does not exist.=Pemain @1 tidak wujud.
<privilege>=<keistimewaan>
Return list of all online players with privilege=Kembalikan senarai semua pemain dalam talian yang mempunyai keistimewaan
Invalid parameters (see /help haspriv).=Parameter tidak sah (sila lihat /help haspriv).
Unknown privilege!=Keistimewaan tidak diketahui!
No online player has the "@1" privilege.=Tiada pemain dalam talian yang mempunyai keistimewaan "@1".
Players online with the "@1" privilege: @2=Pemain dalam talian yang mempunyai keistimewaan "@1": @2
Your privileges are insufficient.=Keistimewaan anda tidak mencukupi.
Your privileges are insufficient. '@1' only allows you to grant: @2=Keistimewaan anda tidak mencukupi. '@1' hanya membolehkan anda untuk memberikan: @2
Unknown privilege: @1=Keistimewaan tidak diketahui: @1
@1 granted you privileges: @2=@1 memberikan anda keistimewaan: @2
<name> (<privilege> [, <privilege2> [<...>]] | all)=<nama> (<keistimewaan> [, <keistimewaan2> [<...>]] | all)
Give privileges to player=Berikan keistimewaan kepada pemain
Invalid parameters (see /help grant).=Parameter tidak sah (sila lihat /help grant).
<privilege> [, <privilege2> [<...>]] | all=<keistimewaan> [, <keistimewaan2> [<...>]] | all
Grant privileges to yourself=Berikan keistimewaan kepada diri sendiri
Invalid parameters (see /help grantme).=Parameter tidak sah (sila lihat /help grantme).
Your privileges are insufficient. '@1' only allows you to revoke: @2=Keistimewaan anda tidak mencukupi. '@1' hanya membolehkan anda untuk menarik balik: @2
Note: Cannot revoke in singleplayer: @1=Nota: Tidak boleh tarik balik keistimewaan dalam mod pemain perseorangan: @1
Note: Cannot revoke from admin: @1=Nota: Tidak boleh tarik balik keistimewaan daripada pentadbir: @1
No privileges were revoked.=Tiada keistimewaan yang ditarik balik.
@1 revoked privileges from you: @2=@1 menarik balik keistimewaan berikut daripada anda: @2
Remove privileges from player=Tarik balik keistimewaan daripada pemain
Invalid parameters (see /help revoke).=Parameter tidak sah (sila lihat /help revoke).
Revoke privileges from yourself=Tarik balik keistimewaan daripada diri sendiri
Invalid parameters (see /help revokeme).=Parameter tidak sah (sila lihat /help revokeme).
<name> <password>=<nama> <kata laluan>
Set player's password (sent unencrypted, thus insecure)=Menetapkan kata laluan pemain (dihantar secara tidak tersulit, oleh itu ia tidak selamat)
Name field required.=Medan nama diperlukan.
Your password was cleared by @1.=Kata laluan anda telah dipadamkan oleh @1.
Password of player "@1" cleared.=Kata laluan bagi pemain "@1" telah dipadamkan.
Your password was set by @1.=Kata laluan anda telah ditetapkan oleh @1.
Password of player "@1" set.=Kata laluan bagi pemain "@1" telah ditetapkan.
<name>=<nama>
Set empty password for a player=Tetapkan kata laluan kosong bagi seorang pemain
Reload authentication data=Muat semula data pengesahan
Done.=Selesai.
Failed.=Gagal.
Remove a player's data=Buang data seorang pemain
Player "@1" removed.=Pemain "@1" telah dibuang.
No such player "@1" to remove.=Tiada pemain "@1" tersebut untuk dibuang.
Player "@1" is connected, cannot remove.=Pemain "@1" masih tersambung, tidak boleh dibuang.
Unhandled remove_player return code @1.=Kod kembali remove_player tidak dikendalikan @1.
Cannot teleport out of map bounds!=Tidak boleh merentas jarak keluar dari batas peta!
Cannot get player with name @1.=Tidak boleh mendapatkan pemain dengan nama @1.
Cannot teleport, @1 is attached to an object!=Tidak boleh rentas jarak, @1 tersambung ke suatu objek!
Teleporting @1 to @2.=Merentas jarak @1 ke @2.
One does not teleport to oneself.=Seseorang itu tidak boleh rentas jarak ke diri sendiri.
Cannot get teleportee with name @1.=Tidak boleh mendapatkan perentas jarak dengan nama @1.
Cannot get target player with name @1.=Tidak boleh mendapatkan pemain sasaran dengan nama @1.
Teleporting @1 to @2 at @3.=Merentas jarak @1 ke @2 di @3.
<X>,<Y>,<Z> | <to_name> | <name> <X>,<Y>,<Z> | <name> <to_name>=<X>,<Y>,<Z> | <nama_sasaran> | <nama> <X>,<Y>,<Z> | <nama> <nama_sasaran>
Teleport to position or player=Rentas jarak ke kedudukan atau pemain
You don't have permission to teleport other players (missing privilege: @1).=Anda tiada kebenaran untuk merentas jarak pemain yang lain (tiada keistimewaan: @1).
([-n] <name> <value>) | <name>=([-n] <nama> <nilai>) | <nama>
Set or read server configuration setting=Tetapkan atau baca tetapan konfigurasi pelayan
Failed. Cannot modify secure settings. Edit the settings file manually.=Gagal. Tidak boleh mengubah tetapan terselamat. Sila edit fail tetapan secara manual.
Failed. Use '/set -n <name> <value>' to create a new setting.=Gagal. Sila gunakan '/set -n <nama> <nilai>' untuk mencipta tetapan baharu.
@1 @= @2=@1 @= @2
<not set>=<tidak ditetapkan>
Invalid parameters (see /help set).=Parameter tidak sah (sila lihat /help set).
Finished emerging @1 blocks in @2ms.=Selesai menimbulkan @1 blok dalam @2ms.
emergeblocks update: @1/@2 blocks emerged (@3%)=kemas kini blok timbul: @1/@2 blok telah timbul (@3%)
(here [<radius>]) | (<pos1> <pos2>)=(here [<jejari>]) | (<kedudukan1> <kedudukan2>)
Load (or, if nonexistent, generate) map blocks contained in area pos1 to pos2 (<pos1> and <pos2> must be in parentheses)=Muatkan (atau, jika belum wujud, janakan) blok peta yang terkandung dalam kawasan antara kedudukan1 dan kedudukan2 (<kedudukan1> dan <kedudukan2> mestilah berada dalam kurungan)
Started emerge of area ranging from @1 to @2.=Mula menimbulkan kawasan di antara @1 dan @2.
Delete map blocks contained in area pos1 to pos2 (<pos1> and <pos2> must be in parentheses)=Padamkan blok peta yang terkandung dalam kawasan antara kedudukan1 dan kedudukan2 (<kedudukan1> dan <kedudukan2> mestilah berada dalam kurungan)
Successfully cleared area ranging from @1 to @2.=Berjaya memadam kawasan di antara @1 dan @2.
Failed to clear one or more blocks in area.=Gagal untuk memadam satu atau lebih blok dalam kawasan.
Resets lighting in the area between pos1 and pos2 (<pos1> and <pos2> must be in parentheses)=Tetapkan semula pencahayaan dalam kawasan antara kedudukan1 dan kedudukan2 (<kedudukan1> dan <kedudukan2> mestilah berada dalam kurungan)
Successfully reset light in the area ranging from @1 to @2.=Berjaya menetapkan semula pencahayaan dalam kawasan di antara @1 dan @2.
Failed to load one or more blocks in area.=Gagal untuk memuatkan satu atau lebih blok dalam kawasan.
List mods installed on the server=Senaraikan mods yang terpasang di pelayan
No mods installed.=Tiada mods terpasang.
Cannot give an empty item.=Tidak boleh berikan item kosong.
Cannot give an unknown item.=Tidak boleh berikan item tidak diketahui.
Giving 'ignore' is not allowed.=Tidak dibenarkan untuk memberikan nod 'abai'.
@1 is not a known player.=@1 bukanlah pemain yang diketahui.
@1 partially added to inventory.=@1 telah ditambah ke inventori secara separa.
@1 could not be added to inventory.=@1 tidak boleh ditambah ke inventori.
@1 added to inventory.=@1 telah ditambah ke inventori.
@1 partially added to inventory of @2.=@1 telah ditambah secara separa ke inventori @2.
@1 could not be added to inventory of @2.=@1 tidak boleh ditambah ke inventori @2.
@1 added to inventory of @2.=@1 telah ditambah ke inventori @2.
<name> <ItemString> [<count> [<wear>]]=<nama> <RentetanItem> [<jumlah> [<haus>]]
Give item to player=Berikan item kepada pemain
Name and ItemString required.=Nama dan RentetanItem diperlukan.
<ItemString> [<count> [<wear>]]=<RentetanItem> [<jumlah> [<haus>]]
Give item to yourself=Berikan item kepada diri sendiri
ItemString required.=RentetanItem diperlukan.
<EntityName> [<X>,<Y>,<Z>]=<NamaEntiti> [<X>,<Y>,<Z>]
Spawn entity at given (or your) position=Jelmakan entiti di kedudukan yang diberi (atau di kedudukan anda)
EntityName required.=NamaEntiti diperlukan.
Unable to spawn entity, player is nil.=Tidak mampu menjelmakan entiti, pemain itu kosong.
Cannot spawn an unknown entity.=Tidak boleh menjelmakan entiti yang tidak diketahui.
Invalid parameters (@1).=Parameter tidak sah (@1).
@1 spawned.=@1 telah dijelmakan.
@1 failed to spawn.=@1 gagal untuk dijelmakan.
Destroy item in hand=Musnahkan item dalam tangan
Unable to pulverize, no player.=Gagal untuk dimusnahkan, tiada pemain.
Unable to pulverize, no item in hand.=Gagal untuk dimusnahkan, tiada item dalam tangan.
An item was pulverized.=Suatu item telah dimusnahkan.
[<range>] [<seconds>] [<limit>]=[<jarak>] [<saat>] [<had>]
Check who last touched a node or a node near it within the time specified by <seconds>. Default: range @= 0, seconds @= 86400 @= 24h, limit @= 5. Set <seconds> to inf for no time limit=Periksa siapa orang terakhir yang menyentuh suatu nod atau suatu nod berhampiran dalam masa yang ditentukan dalam unit <saat>. Lalai: jarak @= 0, saat @= 86400 @= 24j, had @= 5. Tetapkan <saat> ke inf untuk tiada had masa
Rollback functions are disabled.=Fungsi gulung balik dilumpuhkan.
That limit is too high!=Had tersebut terlalu tinggi!
Checking @1 ...=Memeriksa @1 ...
Nobody has touched the specified location in @1 seconds.=Tiada siapa menyentuh tempat yang ditentukan dalam masa @1 saat yang lalu.
@1 @2 @3 -> @4 @5 seconds ago.=@1 @2 @3 -> @4 @5 saat yang lalu.
Punch a node (range@=@1, seconds@=@2, limit@=@3).=Ketuk suatu nod (jarak@=@1, saat@=@2, had@=@3)
(<name> [<seconds>]) | (:<actor> [<seconds>])=(<nama> [<saat>]) | (:<pelaku> [<saat>])
Revert actions of a player. Default for <seconds> is 60. Set <seconds> to inf for no time limit=Membalikkan perlakuan seorang pemain. Nilai lalai untuk <saat> ialah 60. Tetapkan <saat> ke inf untuk tiada had masa
Invalid parameters. See /help rollback and /help rollback_check.=Parameter tidak sah. Sila lihat /help rollback dan /help rollback_check.
Reverting actions of player '@1' since @2 seconds.=Membalikkan perlakuan pemain '@1' sejak @2 saat lalu.
Reverting actions of @1 since @2 seconds.=Membalikkan perlakuan @1 sejak @2 saat lalu.
(log is too long to show)=(log terlalu panjang untuk ditunjukkan)
Reverting actions succeeded.=Pembalikan perlakuan telah berjaya.
Reverting actions FAILED.=Pembalikan perlakuan telah GAGAL.
Show server status=Tunjukkan status pelayan
This command was disabled by a mod or game.=Perintah ini dilumpuhkan oleh mods atau permainan.
[<0..23>:<0..59> | <0..24000>]=[<0..23>:<0..59> | <0..24000>]
Show or set time of day=Tunjukkan atau tetapkan waktu dalam hari
Current time is @1:@2.=Waktu semasa ialah @1:@2.
You don't have permission to run this command (missing privilege: @1).=Anda tiada kebenaran untuk menjalankan perintah ini (tiada keistimewaan: @1).
Invalid time (must be between 0 and 24000).=Waktu tidak sah (mestilah di antara 0 dan 24000)
Time of day changed.=Waktu dalam hari telah ditukar.
Invalid hour (must be between 0 and 23 inclusive).=Jam tidak sah (mestilah di antara 0 dan 23).
Invalid minute (must be between 0 and 59 inclusive).=Minit tidak sah (mestilah di antara 0 dan 59).
Show day count since world creation=Tunjuk jumlah hari telah berlalu sejak penciptaan dunia
Current day is @1.=Hari semasa ialah hari ke-@1.
[<delay_in_seconds> | -1] [-r] [<message>]=[<lengah_dalam_saat> | -1] [-r] [<mesej>]
Shutdown server (-1 cancels a delayed shutdown, -r allows players to reconnect)=Tutup pelayan (-1 membatalkan penutupan terlengah, -r membolehkan pemain untuk sambung semula)
Server shutting down (operator request).=Pelayan sedang ditutup (permintaan pengendali).
Ban the IP of a player or show the ban list=Haramkan IP seorang pemain atau tunjukkan senarai pengharaman
The ban list is empty.=Senarai pengharaman kosong.
Ban list: @1=Senarai pengharaman: @1
You cannot ban players in singleplayer!=Anda tidak boleh mengharamkan pemain dalam mod pemain perseorangan!
Player is not online.=Pemain tersebut tidak berada dalam talian.
Failed to ban player.=Gagal untuk mengharamkan pemain.
Banned @1.=Berjaya mengharamkan @1.
<name> | <IP_address>=<nama> | <alamat_IP>
Remove IP ban belonging to a player/IP=Buang pengharaman IP kepunyaan seorang pemain/IP tertentu
Failed to unban player/IP.=Gagal untuk membuang pengharaman pemain/IP.
Unbanned @1.=Berjaya membuang pengharaman @1.
<name> [<reason>]=<nama> [<sebab>]
Kick a player=Tendang seorang pemain
Failed to kick player @1.=Gagal untuk menendang pemain @1.
Kicked @1.=Berjaya menendang @1.
[full | quick]=[full | quick]
Clear all objects in world=Padamkan semua objek dalam dunia
Invalid usage, see /help clearobjects.=Kegunaan tidak sah, sila lihat /help clearobjects
Clearing all objects. This may take a long time. You may experience a timeout. (by @1)=Memadamkan semua objek. Ini mungkin ambil masa yang lama. (oleh @1)
Cleared all objects.=Semua objek telah berjaya dipadam.
<name> <message>=<nama> <mesej>
Send a direct message to a player=Menghantar mesej terus kepada seorang pemain
Invalid usage, see /help msg.=Kegunaan tidak sah, sila lihat /help msg.
The player @1 is not online.=Pemain @1 tidak berada dalam talian.
DM from @1: @2=DM daripada @1: @2
Message sent.=Mesej telah dihantar.
Get the last login time of a player or yourself=Dapatkan waktu log masuk terakhir bagi seorang pemain atau diri sendiri
@1's last login time was @2.=Waktu log masuk terakhir @1 ialah pada @2.
@1's last login time is unknown.=Waktu log masuk terakhir @1 tidak diketahui.
Clear the inventory of yourself or another player=Padamkan inventori diri sendiri atau pemain lain
You don't have permission to clear another player's inventory (missing privilege: @1).=Anda tiada kebenaran untuk memadam inventori pemain lain (tiada keistimewaan: @1).
@1 cleared your inventory.=@1 telah memadam inventori anda.
Cleared @1's inventory.=Berjaya memadam inventori @1.
Player must be online to clear inventory!=Pemain mesti berada dalam talian untuk memadam inventorinya!
Players can't be killed, damage has been disabled.=Pemain tidak boleh dibunuh, keupayaan cedera telah dilumpuhkan.
Player @1 is not online.=Pemain @1 tidak berada dalam talian.
You are already dead.=Anda sudah pun mati.
@1 is already dead.=@1 sudah pun mati.
@1 has been killed.=@1 telah berjaya dibunuh.
Kill player or yourself=Bunuh pemain atau diri sendiri
@1 joined the game.=@1 telah menyertai permainan.
@1 left the game.=@1 telah meninggalkan permainan.
@1 left the game (timed out).=@1 telah meninggalkan permainan (tamat tempoh masa).
(no description)=(tiada keterangan)
Can interact with things and modify the world=Boleh berinteraksi dengan barangan dan mengubah dunia
Can speak in chat=Boleh bercakap dalam sembang
Can modify basic privileges (@1)=Boleh mengubah keistimewaan asas (@1)
Can modify privileges=Boleh mengubah keistimewaan
Can teleport self=Boleh merentas jarak diri sendiri
Can teleport other players=Boleh merentas jarak pemain lain
Can set the time of day using /time=Boleh menetapkan waktu dalam hari menggunakan /time
Can do server maintenance stuff=Boleh melakukan perkara berkaitan penyenggaraan pelayan
Can bypass node protection in the world=Boleh memintas perlindungan nod dalam dunia
Can ban and unban players=Boleh mengharamkan dan membuang pengharaman pemain
Can kick players=Boleh menendang pemain
Can use /give and /giveme=Boleh menggunakan /give dan /giveme
Can use /setpassword and /clearpassword=Boleh menggunakan /setpassword dan /clearpassword
Can use fly mode=Boleh menggunakan mod terbang
Can use fast mode=Boleh menggunakan mod pergerakan pantas
Can fly through solid nodes using noclip mode=Boleh terbang menerusi nod pepejal menggunakan mod tembus blok
Can use the rollback functionality=Boleh menggunakan keberfungsian gulung balik
Can enable wireframe=Boleh membolehkan rangka dawai
Unknown Item=Item Tidak Diketahui
Air=Udara
Ignore=Abai
You can't place 'ignore' nodes!=Anda tidak boleh meletakkan nod 'abai'!
print [<filter>] | dump [<filter>] | save [<format> [<filter>]] | reset=print [<tapisan>] | dump [<tapisan>] | save [<format> [<tapisan>]] | reset
Handle the profiler and profiling data=Uruskan pembukah dan data pembukahan
Statistics written to action log.=Statistik telah ditulis ke log perlakuan.
Statistics were reset.=Statistik telah ditetapkan semula.
Usage: @1=Kegunaan: @1
Format can be one of txt, csv, lua, json, json_pretty (structures may be subject to change).=Format boleh jadi salah satu daripada txt, csv, lua, json, json_pretty (struktur boleh berubah kemudian).
Values below show absolute/relative times spend per server step by the instrumented function.=Nilai di bawah menunjukkan masa mutlak/relatif yang digunakan oleh fungsi yang dipasangkan pada setiap langkah pelayan
A total of @1 sample(s) were taken.=Sebanyak @1 sampel telah diambil secara keseluruhan.
The output is limited to '@1'.=Output dihadkan kepada '@1'.
Saving of profile failed: @1=Penyimpanan profil telah gagal: @1
Profile saved to @1=Profil telah disimpan ke @1

View File

@@ -0,0 +1,246 @@
# textdomain: __builtin
Invalid parameters (see /help @1).=Недопустимые параметры (см. /help @1).
Too many arguments, try using just /help <command>=Слишком много аргументов, попробуйте использовать просто /help <команда>
Available commands: @1=Доступные команды: @1
Use '/help <cmd>' to get more information, or '/help all' to list everything.=Используйте '/help <команда>', чтобы получить дополнительную информацию, или '/help all', чтобы перечислить все.
Available commands:=Доступные команды:
Command not available: @1=Команда недоступна: @1
[all | privs | <cmd>] [-t]=[all | privs | <команда>] [-t]
Get help for commands or list privileges (-t: output in chat)=Получить справку по командам или списку привилегий (-t: вывод в чате)
Available privileges:=Доступные привилегии:
Command=Команда
Parameters=Параметры
For more information, click on any entry in the list.=Для получения дополнительной информации нажмите на любую запись в списке.
Double-click to copy the entry to the chat history.=Дважды щелкните, чтобы скопировать запись в историю чата.
Command: @1 @2=Команда: @1 @2
Available commands: (see also: /help <cmd>)=Доступные команды: (смотрите также: /help <команда>)
Close=Закрыть
Privilege=Привилегия
Description=Описание
Empty command.=Пустая команда.
Invalid command: @1=Недопустимая команда: @1
Invalid command usage.=Недопустимое использование команды.
(@1 s)= (@1 с)
Command execution took @1 s=Выполнение команды заняло @1 с
You don't have permission to run this command (missing privileges: @1).=У вас нет разрешения на запуск этой команды (отсутствуют привилегии: @1).
Unable to get position of player @1.=Не удалось получить позицию игрока @1.
Incorrect area format. Expected: (x1,y1,z1) (x2,y2,z2)=Неправильный формат области. Ожидаемое: (x1,y1,z1) (x2,y2,z2)
<action>=<действие>
Show chat action (e.g., '/me orders a pizza' displays '<player name> orders a pizza')=Показать действие в чате (например, '/me заказывает пиццу' отображает '<имя игрока> заказывает пиццу')
Show the name of the server owner=Показать имя владельца сервера
The administrator of this server is @1.=Администратором этого сервера является @1.
There's no administrator named in the config file.=В конфигурационном файле нет имени администратора.
@1 does not have any privileges.=@1 не имеет никаких привилегий.
Privileges of @1: @2=Привилегии @1: @2
[<name>]=[<имя>]
Show privileges of yourself or another player=Показать ваши привилегии или привилегии другого игрока
Player @1 does not exist.=Игрок @1 не существует.
<privilege>=<привилегия>
Return list of all online players with privilege=Возвращает список всех онлайн-игроков, имеющих указанную привилегию
Invalid parameters (see /help haspriv).=Недопустимые параметры (см. /help haspriv).
Unknown privilege!=Неизвестная привилегия!
No online player has the "@1" privilege.=Ни один онлайн-игрок не имеет привилегии "@1".
Players online with the "@1" privilege: @2=Игроки онлайн с привилегией "@1": @2
Your privileges are insufficient.=Ваших привилегий недостаточно.
Your privileges are insufficient. '@1' only allows you to grant: @2=Ваших привилегий недостаточно. '@1' позволяет вам предоставлять только: @2
Unknown privilege: @1=Неизвестная привилегия: @1
@1 granted you privileges: @2=@1 предоставил(а) вам привилегии: @2
<name> (<privilege> [, <privilege2> [<...>]] | all)=<имя> (<привилегия> [, <привилегия2> [<...>]] | all)
Give privileges to player=Предоставить привилегии игроку
Invalid parameters (see /help grant).=Недопустимые параметры (см. /help grant).
<privilege> [, <privilege2> [<...>]] | all=<привилегия> [, <привилегия2> [<...>]] | all
Grant privileges to yourself=Предоставить привилегии себе
Invalid parameters (see /help grantme).=Недопустимые параметры (см. /help grantme).
Your privileges are insufficient. '@1' only allows you to revoke: @2=Ваших привилегий недостаточно. '@1' позволяет вам отозвать только: @2
Note: Cannot revoke in singleplayer: @1=Примечание: Невозможно отозвать в одиночной игре: @1
Note: Cannot revoke from admin: @1=Примечание: Невозможно отозвать у администратора: @1
No privileges were revoked.=Никакие привилегии не были отозваны.
@1 revoked privileges from you: @2=@1 отозвал у вас привилегии: @2
Remove privileges from player=Отозвать привилегии у игрока
Invalid parameters (see /help revoke).=Недопустимые параметры (см. /help revoke).
Revoke privileges from yourself=Отозвать привилегии у себя
Invalid parameters (see /help revokeme).=Недопустимые параметры (см. /help revokeme).
<name> <password>=<имя> <пароль>
Set player's password (sent unencrypted, thus insecure)=Установить пароль игрока (отправка в незашифрованном виде, следовательно, небезопасно)
Name field required.=Обязательное поле "Имя".
Your password was cleared by @1.=@1 сбросил ваш пароль.
Password of player "@1" cleared.=Пароль игрока "@1" сброшен.
Your password was set by @1.=@1 установил вам пароль.
Password of player "@1" set.=Установлен пароль игрока "@1".
<name>=<имя>
Set empty password for a player=Установить пустой пароль для игрока
Reload authentication data=Перезагрузить аутентификационные данные
Done.=Готово.
Failed.=Не удалось.
Remove a player's data=Удалить данные игрока
Player "@1" removed.=Игрок "@1" удален.
No such player "@1" to remove.=Нет такого игрока "@1", которого можно было бы удалить.
Player "@1" is connected, cannot remove.=Игрок "@1" сейчас в игре, удалить его невозможно.
Unhandled remove_player return code @1.=Необработанный код возврата remove_player @1.
Cannot teleport out of map bounds!=Невозможно телепортироваться за пределы карты!
Cannot get player with name @1.=Не удается получить игрока с именем @1.
Cannot teleport, @1 is attached to an object!=Невозможно телепортироваться, @1 привязан к объекту!
Teleporting @1 to @2.=Телепортация @1 в @2.
One does not teleport to oneself.=Игрок не может телепортироваться к самому себе.
Cannot get teleportee with name @1.=Не удается найти телепортирующегося с именем @1.
Cannot get target player with name @1.=Не удается найти целевого игрока с именем @1.
Teleporting @1 to @2 at @3.=Телепортация @1 к @2 в @3.
<X>,<Y>,<Z> | <to_name> | <name> <X>,<Y>,<Z> | <name> <to_name>=<X>,<Y>,<Z> | <имя_к_кому> | <имя> <X>,<Y>,<Z> | <имя> <имя_к_кому>
Teleport to position or player=Телепортироваться на позицию или к игроку
You don't have permission to teleport other players (missing privilege: @1).=У вас нет разрешения на телепортацию других игроков (отсутствует привилегия: @1).
([-n] <name> <value>) | <name>=([-n] <имя> <значение>) | <имя>
Set or read server configuration setting=Установить или прочитать настройки конфигурации сервера
Failed. Cannot modify secure settings. Edit the settings file manually.=Ошибка. Не удается изменить настройки безопасности. Отредактируйте файл настроек вручную.
Failed. Use '/set -n <name> <value>' to create a new setting.=Ошибка. Используйте '/set -n <имя> <значение>', чтобы создать новую настройку.
@1 @= @2=@1 @= @2
<not set>=<не задано>
Invalid parameters (see /help set).=Недопустимые параметры (см. /help set).
Finished emerging @1 blocks in @2ms.=Загрузка/генерация @1 map-блоков завершена за @2мс.
emergeblocks update: @1/@2 blocks emerged (@3%)=обновление emergeblocks: загружено/сгенерировано: @1 из @2 блоков (@3%)
(here [<radius>]) | (<pos1> <pos2>)=(here [<радиус>]) | (<позиция1> <позиция2>)
Load (or, if nonexistent, generate) map blocks contained in area pos1 to pos2 (<pos1> and <pos2> must be in parentheses)=Загрузить (или сгенерировать, если не существуют) map-блоки, содержащиеся в области с позиции1 по позицию2 (<позиция1> и <позиция2> должны быть в круглых скобках)
Started emerge of area ranging from @1 to @2.=Загрузка/генерация области в диапазоне от @1 до @2 начата.
Delete map blocks contained in area pos1 to pos2 (<pos1> and <pos2> must be in parentheses)=Удалить map-блоки, содержащиеся в области с позиции1 по позицию2 (<позиция1> и <позиция2> должны быть заключены в круглые скобки)
Successfully cleared area ranging from @1 to @2.=Успешно очищена область в диапазоне от @1 до @2.
Failed to clear one or more blocks in area.=Не удалось очистить один или несколько блоков в области.
Resets lighting in the area between pos1 and pos2 (<pos1> and <pos2> must be in parentheses)=Сбрасывает освещение в области с позиции1 по позицию2 (<позиция1> и <позиция2> должны быть заключены в круглые скобки)
Successfully reset light in the area ranging from @1 to @2.=Успешно сброшено освещение в диапазоне от @1 до @2.
Failed to load one or more blocks in area.=Не удалось загрузить один или несколько блоков в области.
List mods installed on the server=Список модов, установленных на сервере
No mods installed.=Моды не установлены.
Cannot give an empty item.=Вы должны указать предмет.
Cannot give an unknown item.=Неизвестный предмет.
Giving 'ignore' is not allowed.=Выдача 'ignore' не допускается.
@1 is not a known player.=Неизвестный игрок: @1.
@1 partially added to inventory.=@1 частично добавлен в инвентарь.
@1 could not be added to inventory.=@1 не удалось добавить в инвентарь.
@1 added to inventory.=@1 добавлено в инвентарь.
@1 partially added to inventory of @2.=@1 частично добавлен в инвентарь @2.
@1 could not be added to inventory of @2.=@1 не удалось добавить в инвентарь @2.
@1 added to inventory of @2.=@1 добавлен в инвентарь @2.
<name> <ItemString> [<count> [<wear>]]=<имя> <ItemString> [<количество> [<износ>]]
Give item to player=Добавить предмет в инвентарь игрока
Name and ItemString required.=Требуется <имя> игрока и название предмета <ItemString>.
<ItemString> [<count> [<wear>]]=<ItemString> [<количество> [<износ>]]
Give item to yourself=Добавить предмет в свой инвентарь
ItemString required.=Требуется название предмета <ItemString>.
<EntityName> [<X>,<Y>,<Z>]=<EntityName> [<X>,<Y>,<Z>]
Spawn entity at given (or your) position=Спаун сущности (моб/стрела/...) в заданной (или вашей) позиции
EntityName required.=Требуется имя сущности <EntityName>.
Unable to spawn entity, player is nil.=Не удается создать сущность, игрок не найден.
Cannot spawn an unknown entity.=Не удается создать неизвестную сущность.
Invalid parameters (@1).=Недопустимые параметры (@1).
@1 spawned.=Сущность @1 создана.
@1 failed to spawn.=Сущность @1 не удалось создать.
Destroy item in hand=Уничтожить предмет, который у вас в руках
Unable to pulverize, no player.=Невозможно уничтожить предмет, нет игрока.
Unable to pulverize, no item in hand.=Невозможно уничтожить предмет, в руках нет предмета.
An item was pulverized.=Предмет был уничтожен.
[<range>] [<seconds>] [<limit>]=[<диапазон>] [<секунды>] [<ограничение>]
Check who last touched a node or a node near it within the time specified by <seconds>. Default: range @= 0, seconds @= 86400 @= 24h, limit @= 5. Set <seconds> to inf for no time limit=Проверить кто в последний раз прикасался к ноде или нодам рядом в течение времени, указанного в <секундах>. По умолчанию: диапазон @= 0, секунды @= 86400 @= 24 часа, ограничение @= 5. Установите <секунды> в значение inf для отключения ограничения по времени
Rollback functions are disabled.=Функции отката отключены.
That limit is too high!=Это <ограничение> слишком велико!
Checking @1 ...=Проверка @1 ...
Nobody has touched the specified location in @1 seconds.=Никто не прикасался к указанному местоположению в течение @1 секунд(ы).
@1 @2 @3 -> @4 @5 seconds ago.=@1 @2 @3 -> @4 @5 секунд назад.
Punch a node (range@=@1, seconds@=@2, limit@=@3).=Ударьте по ноде (диапазон@=@1, секунды@=@2, предел @=@3).
(<name> [<seconds>]) | (:<actor> [<seconds>])=(<имя> [<секунды>]) | (:<игрок> [<секунды>])
Revert actions of a player. Default for <seconds> is 60. Set <seconds> to inf for no time limit=Отменяет действия игрока. Значение по умолчанию для <секунд> равно 60. Установите <секунды> в значение inf для отключения ограничения по времени
Invalid parameters. See /help rollback and /help rollback_check.=Недопустимые параметры. Смотрите /help rollback и /help rollback_check.
Reverting actions of player '@1' since @2 seconds.=Отмена действия игрока "@1" за последние @2 секунд(у/ы).
Reverting actions of @1 since @2 seconds.=Отмена действий @1 за последние @2 секунд(у/ы).
(log is too long to show)=(журнал слишком длинный для отображения)
Reverting actions succeeded.=Отмена действий завершилась успешно.
Reverting actions FAILED.=Отменить действия НЕ УДАЛОСЬ.
Show server status=Показать статус сервера
This command was disabled by a mod or game.=Эта команда была отключена модом или игрой.
[<0..23>:<0..59> | <0..24000>]=[<0..23>:<0..59> | <0..24000>]
Show or set time of day=Показать или установить время суток
Current time is @1:@2.=Текущее время @1:@2.
You don't have permission to run this command (missing privilege: @1).=У вас нет разрешения на выполнение этой команды (отсутствует привилегия: @1).
Invalid time (must be between 0 and 24000).=Недопустимое время (должно быть в диапазоне от 0 до 24000).
Time of day changed.=Время суток изменено.
Invalid hour (must be between 0 and 23 inclusive).=Недопустимый час (должно быть от 0 до 23 включительно).
Invalid minute (must be between 0 and 59 inclusive).=Недопустимая минута (должно быть от 0 до 59 включительно).
Show day count since world creation=Показать количество дней с момента сотворения мира
Current day is @1.=Текущий день: @1.
[<delay_in_seconds> | -1] [-r] [<message>]=[<задержка_в_секундах> | -1] [-r] [<сообщение>]
Shutdown server (-1 cancels a delayed shutdown, -r allows players to reconnect)=Завершение работы сервера (-1 отменяет отложенное завершение работы, -r позволяет игрокам повторно подключиться)
Server shutting down (operator request).=Завершение работы сервера (по запросу администрации).
Ban the IP of a player or show the ban list=Заблокировать IP игрока или показать список заблокированных
The ban list is empty.=Список заблокированных пуст.
Ban list: @1=Список заблокированных: @1
You cannot ban players in singleplayer!=Вы не можете забанить игроков в одиночной игре!
Player is not online.=Игрок не подключен к Сети.
Failed to ban player.=Не удалось забанить игрока.
Banned @1.=@1 забанен.
<name> | <IP_address>=<имя> | <IP_адрес>
Remove IP ban belonging to a player/IP=Удалить IP-бан, принадлежащий игроку/IP-адресу
Failed to unban player/IP.=Не удалось разбанить игрока/IP.
Unbanned @1.=@1 разбанен.
<name> [<reason>]=<имя> [<причина>]
Kick a player=Кикнуть игрока
Failed to kick player @1.=Не удалось кикнуть @1.
Kicked @1.=@1 кикнут.
[full | quick]=[full | quick]
Clear all objects in world=Удалить ВСЕ объекты/сущности во ВСЁМ мире
Invalid usage, see /help clearobjects.=Недопустимое использование, см. /help clearobjects.
Clearing all objects. This may take a long time. You may experience a timeout. (by @1)=Удаление всех объектов. Это может занять много времени. Ваш клиент может отключиться из-за тайм-аута. (запущено: @1)
Cleared all objects.=Все объекты удалены.
<name> <message>=<имя> <сообщение>
Send a direct message to a player=Отправить прямое сообщение игроку
Invalid usage, see /help msg.=Недопустимое использование, см. /help msg.
The player @1 is not online.=Игрок @1 не находится в игре.
DM from @1: @2=DM от @1: @2
Message sent.=Сообщение отправлено.
Get the last login time of a player or yourself=Вывести время последнего входа игрока или своё
@1's last login time was @2.=Время последнего входа @1: @2.
@1's last login time is unknown.=Время последнего входа @1 неизвестно.
Clear the inventory of yourself or another player=Очистить свой инвентарь или инвентарь другого игрока
You don't have permission to clear another player's inventory (missing privilege: @1).=У вас нет разрешения на очистку инвентаря другого игрока (отсутствует привилегия: @1).
@1 cleared your inventory.=@1 очистил ваш инвентарь.
Cleared @1's inventory.=Инвентарь @1 очищен.
Player must be online to clear inventory!=Игрок должен быть онлайн, чтобы очистить его инвентарь!
Players can't be killed, damage has been disabled.=Игроки не могут быть убиты, урон отключен.
Player @1 is not online.=Игрок @1 не находится в игре.
You are already dead.=Ты уже мертв.
@1 is already dead.=@1 уже мертв.
@1 has been killed.=@1 был убит.
Kill player or yourself=Убить игрока или себя
@1 joined the game.=@1 присоединился к игре.
@1 left the game.=@1 вышел из игры.
@1 left the game (timed out).=@1 вышел из игры (тайм-аут).
(no description)=(без описания)
Can interact with things and modify the world=Может взаимодействовать (с объектами/игроками/...) и изменять мир
Can speak in chat=Может общаться в чате
Can modify basic privileges (@1)=Может изменять базовые привилегии (@1)
Can modify privileges=Может изменять привилегии
Can teleport self=Может самостоятельно телепортироваться
Can teleport other players=Может телепортировать других игроков
Can set the time of day using /time=Может устанавливать время суток с помощью /time
Can do server maintenance stuff=Может заниматься обслуживанием сервера
Can bypass node protection in the world=Может обходить защиту нод во всем мире
Can ban and unban players=Может банить и разбанивать игроков
Can kick players=Может кикать игроков
Can use /give and /giveme=Может использовать /give и /giveme
Can use /setpassword and /clearpassword=Может использовать /setpassword и /clearpassword
Can use fly mode=Может использовать режим полета
Can use fast mode=Может использовать быстрый режим (ускорение)
Can fly through solid nodes using noclip mode=Может пролетать сквозь ноды, используя режим noclip
Can use the rollback functionality=Может использовать функцию отката
Can enable wireframe=Может использовать режим каркаса в отладке
Unknown Item=Неизвестный предмет
Air=Воздух
Ignore=Игнорируемая встроенная нода (":ignore")
You can't place 'ignore' nodes!=Вы не можете установить ноду 'ignore'!
print [<filter>] | dump [<filter>] | save [<format> [<filter>]] | reset=print [<filter>] | dump [<filter>] | save [<format> [<filter>]] | reset
Handle the profiler and profiling data=Работа с профайлером и данными профилирования
Statistics written to action log.=Статистика записывается в журнал действий.
Statistics were reset.=Статистика была сброшена.
Usage: @1=Использование: @1
Format can be one of txt, csv, lua, json, json_pretty (structures may be subject to change).=Формат может быть одним из txt, csv, lua, json, json_pretty (структуры могут быть изменены).
Values below show absolute/relative times spend per server step by the instrumented function.=Приведенные ниже значения показывают абсолютное/относительное время, затрачиваемое функцией на каждый шаг сервера.
A total of @1 sample(s) were taken.=Всего было взято @1 образец(ов).
The output is limited to '@1'.=Вывод ограничен значением '@1'.
Saving of profile failed: @1=Не удалось сохранить данные профилирования: @1
Profile saved to @1=Данные профилирования сохранены в @1

View File

@@ -1,4 +1,22 @@
# textdomain: __builtin
Invalid parameters (see /help @1).=
Too many arguments, try using just /help <command>=
Available commands: @1=
Use '/help <cmd>' to get more information, or '/help all' to list everything.=
Available commands:=
Command not available: @1=
[all | privs | <cmd>] [-t]=
Get help for commands or list privileges (-t: output in chat)=
Available privileges:=
Command=
Parameters=
For more information, click on any entry in the list.=
Double-click to copy the entry to the chat history.=
Command: @1 @2=
Available commands: (see also: /help <cmd>)=
Close=
Privilege=
Description=
Empty command.=
Invalid command: @1=
Invalid command usage.=
@@ -43,7 +61,7 @@ Invalid parameters (see /help revoke).=
Revoke privileges from yourself=
Invalid parameters (see /help revokeme).=
<name> <password>=
Set player's password=
Set player's password (sent unencrypted, thus insecure)=
Name field required.=
Your password was cleared by @1.=
Password of player "@1" cleared.=
@@ -189,30 +207,6 @@ You are already dead.=
@1 is already dead.=
@1 has been killed.=
Kill player or yourself=
Invalid parameters (see /help @1).=
Too many arguments, try using just /help <command>=
Available commands: @1=
Use '/help <cmd>' to get more information, or '/help all' to list everything.=
Available commands:=
Command not available: @1=
[all | privs | <cmd>] [-t]=
Get help for commands or list privileges (-t: output in chat)=
Command=
Parameters=
For more information, click on any entry in the list.=
Double-click to copy the entry to the chat history.=
Command: @1 @2=
Available commands: (see also: /help <cmd>)=
Close=
Privilege=
Description=
Available privileges:=
print [<filter>] | dump [<filter>] | save [<format> [<filter>]] | reset=
Handle the profiler and profiling data=
Statistics written to action log.=
Statistics were reset.=
Usage: @1=
Format can be one of txt, csv, lua, json, json_pretty (structures may be subject to change).=
@1 joined the game.=
@1 left the game.=
@1 left the game (timed out).=
@@ -239,6 +233,12 @@ Unknown Item=
Air=
Ignore=
You can't place 'ignore' nodes!=
print [<filter>] | dump [<filter>] | save [<format> [<filter>]] | reset=
Handle the profiler and profiling data=
Statistics written to action log.=
Statistics were reset.=
Usage: @1=
Format can be one of txt, csv, lua, json, json_pretty (structures may be subject to change).=
Values below show absolute/relative times spend per server step by the instrumented function.=
A total of @1 sample(s) were taken.=
The output is limited to '@1'.=

View File

@@ -45,6 +45,27 @@ local function configure_selected_world_params(idx)
end
end
-- retrieved from https://wondernetwork.com/pings with (hopefully) representative cities
-- Amsterdam, Auckland, Brasilia, Denver, Lagos, Singapore
local latency_matrix = {
["AF"] = { ["AS"]=258, ["EU"]=100, ["NA"]=218, ["OC"]=432, ["SA"]=308 },
["AS"] = { ["EU"]=168, ["NA"]=215, ["OC"]=125, ["SA"]=366 },
["EU"] = { ["NA"]=120, ["OC"]=298, ["SA"]=221 },
["NA"] = { ["OC"]=202, ["SA"]=168 },
["OC"] = { ["SA"]=411 },
["SA"] = {}
}
function estimate_continent_latency(own, spec)
local there = spec.geo_continent
if not own or not there then
return nil
end
if own == there then
return 0
end
return latency_matrix[there][own] or latency_matrix[own][there]
end
function render_serverlist_row(spec)
local text = ""
if spec.name then

View File

@@ -23,9 +23,18 @@ if not core.get_http_api then
return
end
-- Unordered preserves the original order of the ContentDB API,
-- before the package list is ordered based on installed state.
local store = { packages = {}, packages_full = {}, packages_full_unordered = {}, aliases = {} }
local store = {
loading = false,
load_ok = false,
load_error = false,
-- Unordered preserves the original order of the ContentDB API,
-- before the package list is ordered based on installed state.
packages = {},
packages_full = {},
packages_full_unordered = {},
aliases = {},
}
local http = core.get_http_api()
@@ -47,6 +56,9 @@ local filter_types_titles = {
fgettext("Texture packs"),
}
-- Automatic package installation
local auto_install_spec = nil
local number_downloading = 0
local download_queue = {}
@@ -62,15 +74,6 @@ local REASON_UPDATE = "update"
local REASON_DEPENDENCY = "dependency"
-- encodes for use as URL parameter or path component
local function urlencode(str)
return str:gsub("[^%a%d()._~-]", function(char)
return string.format("%%%02X", string.byte(char))
end)
end
assert(urlencode("sample text?") == "sample%20text%3F")
local function get_download_url(package, reason)
local base_url = core.settings:get("contentdb_url")
local ret = base_url .. ("/packages/%s/releases/%d/download/"):format(
@@ -89,7 +92,7 @@ local function download_and_extract(param)
if filename == "" or not core.download_file(param.url, filename) then
core.log("error", "Downloading " .. dump(param.url) .. " failed")
return {
msg = fgettext("Failed to download $1", package.name)
msg = fgettext_ne("Failed to download \"$1\"", package.title)
}
end
@@ -105,7 +108,7 @@ local function download_and_extract(param)
os.remove(filename)
if not tempfolder then
return {
msg = fgettext("Install: Unsupported file type or broken archive"),
msg = fgettext_ne("Failed to extract \"$1\" (unsupported file type or broken archive)", package.title),
}
end
@@ -129,7 +132,7 @@ local function start_install(package, reason)
local path, msg = pkgmgr.install_dir(package.type, result.path, package.name, package.path)
core.delete_dir(result.path)
if not path then
gamedata.errormessage = msg
gamedata.errormessage = fgettext_ne("Error installing \"$1\": $2", package.title, msg)
else
core.log("action", "Installed package to " .. path)
@@ -184,12 +187,16 @@ local function start_install(package, reason)
if not core.handle_async(download_and_extract, params, callback) then
core.log("error", "ERROR: async event failed")
gamedata.errormessage = fgettext("Failed to download $1", package.name)
gamedata.errormessage = fgettext_ne("Failed to download $1", package.name)
return
end
end
local function queue_download(package, reason)
if package.queued or package.downloading then
return
end
local max_concurrent_downloads = tonumber(core.settings:get("contentdb_max_concurrent_downloads"))
if number_downloading < math.max(max_concurrent_downloads, 1) then
start_install(package, reason)
@@ -200,6 +207,9 @@ local function queue_download(package, reason)
end
local function get_raw_dependencies(package)
if package.type ~= "mod" then
return {}
end
if package.raw_deps then
return package.raw_deps
end
@@ -207,7 +217,7 @@ local function get_raw_dependencies(package)
local url_fmt = "/api/packages/%s/dependencies/?only_hard=1&protocol_version=%s&engine_version=%s"
local version = core.get_version()
local base_url = core.settings:get("contentdb_url")
local url = base_url .. url_fmt:format(package.url_part, core.get_max_supp_proto(), urlencode(version.string))
local url = base_url .. url_fmt:format(package.url_part, core.get_max_supp_proto(), core.urlencode(version.string))
local response = http.fetch_sync({ url = url })
if not response.succeeded then
@@ -278,7 +288,7 @@ local function resolve_dependencies_2(raw_deps, installed_mods, out)
end
end
-- Otherwise, find the first mod that fulfils it
-- Otherwise, find the first mod that fulfills it
if fallback then
return {
is_optional = dep.is_optional,
@@ -346,22 +356,21 @@ end
local install_dialog = {}
function install_dialog.get_formspec()
local selected_game, selected_game_idx = pkgmgr.find_by_gameid(core.settings:get("menu_last_game"))
if not selected_game_idx then
selected_game_idx = 1
selected_game = pkgmgr.games[1]
end
local game_list = {}
for i, game in ipairs(pkgmgr.games) do
game_list[i] = core.formspec_escape(game.title)
end
local package = install_dialog.package
local raw_deps = install_dialog.raw_deps
local will_install_deps = install_dialog.will_install_deps
local selected_game_idx = 1
local selected_gameid = core.settings:get("menu_last_game")
local games = table.copy(pkgmgr.games)
for i=1, #games do
if selected_gameid and games[i].id == selected_gameid then
selected_game_idx = i
end
games[i] = core.formspec_escape(games[i].title)
end
local selected_game = pkgmgr.games[selected_game_idx]
local deps_to_install = 0
local deps_not_found = 0
@@ -408,7 +417,7 @@ function install_dialog.get_formspec()
"container[0.375,0.70]",
"label[0,0.25;", fgettext("Base Game:"), "]",
"dropdown[2,0;4.25,0.5;selected_game;", table.concat(games, ","), ";", selected_game_idx, "]",
"dropdown[2,0;4.25,0.5;selected_game;", table.concat(game_list, ","), ";", selected_game_idx, "]",
"label[0,0.8;", fgettext("Dependencies:"), "]",
@@ -430,7 +439,7 @@ function install_dialog.get_formspec()
"container_end[]",
}
return table.concat(formspec, "")
return table.concat(formspec)
end
function install_dialog.handle_submit(this, fields)
@@ -521,6 +530,50 @@ function confirm_overwrite.create(package, callback)
nil)
end
local function install_or_update_package(this, package)
local install_parent
if package.type == "mod" then
install_parent = core.get_modpath()
elseif package.type == "game" then
install_parent = core.get_gamepath()
elseif package.type == "txp" then
install_parent = core.get_texturepath()
else
error("Unknown package type: " .. package.type)
end
if package.queued or package.downloading then
return
end
local function on_confirm()
local deps = get_raw_dependencies(package)
if deps and has_hard_deps(deps) then
local dlg = install_dialog.create(package, deps)
dlg:set_parent(this)
this:hide()
dlg:show()
else
queue_download(package, package.path and REASON_UPDATE or REASON_NEW)
end
end
if package.type == "mod" and #pkgmgr.games == 0 then
local dlg = messagebox("install_game",
fgettext("You need to install a game before you can install a mod"))
dlg:set_parent(this)
this:hide()
dlg:show()
elseif not package.path and core.is_dir(install_parent .. DIR_DELIM .. package.name) then
local dlg = confirm_overwrite.create(package, on_confirm)
dlg:set_parent(this)
this:hide()
dlg:show()
else
on_confirm()
end
end
local function get_file_extension(path)
local parts = path:split(".")
@@ -575,29 +628,33 @@ local function get_screenshot(package)
return defaulttexturedir .. "loading_screenshot.png"
end
function store.load()
local function fetch_pkgs()
local version = core.get_version()
local base_url = core.settings:get("contentdb_url")
local url = base_url ..
"/api/packages/?type=mod&type=game&type=txp&protocol_version=" ..
core.get_max_supp_proto() .. "&engine_version=" .. urlencode(version.string)
core.get_max_supp_proto() .. "&engine_version=" .. core.urlencode(version.string)
for _, item in pairs(core.settings:get("contentdb_flag_blacklist"):split(",")) do
item = item:trim()
if item ~= "" then
url = url .. "&hide=" .. urlencode(item)
url = url .. "&hide=" .. core.urlencode(item)
end
end
local http = core.get_http_api()
local response = http.fetch_sync({ url = url })
if not response.succeeded then
return
end
store.packages_full = core.parse_json(response.data) or {}
store.aliases = {}
local packages = core.parse_json(response.data)
if not packages or #packages == 0 then
return
end
local aliases = {}
for _, package in pairs(store.packages_full) do
for _, package in pairs(packages) do
local name_len = #package.name
-- This must match what store.update_paths() does!
package.id = package.author:lower() .. "/"
@@ -607,48 +664,137 @@ function store.load()
package.id = package.id .. package.name
end
package.url_part = urlencode(package.author) .. "/" .. urlencode(package.name)
package.url_part = core.urlencode(package.author) .. "/" .. core.urlencode(package.name)
if package.aliases then
for _, alias in ipairs(package.aliases) do
-- We currently don't support name changing
local suffix = "/" .. package.name
if alias:sub(-#suffix) == suffix then
store.aliases[alias:lower()] = package.id
aliases[alias:lower()] = package.id
end
end
end
end
store.packages_full_unordered = store.packages_full
store.packages = store.packages_full
store.loaded = true
return { packages = packages, aliases = aliases }
end
local function sort_and_filter_pkgs()
store.update_paths()
store.sort_packages()
store.filter_packages(search_string)
end
-- Resolves the package specification stored in auto_install_spec into an actual package.
-- May only be called after the package list has been loaded successfully.
local function resolve_auto_install_spec()
assert(store.load_ok)
if not auto_install_spec then
return nil
end
local spec = store.aliases[auto_install_spec] or auto_install_spec
local resolved = nil
for _, pkg in ipairs(store.packages_full_unordered) do
if pkg.id == spec then
resolved = pkg
break
end
end
if not resolved then
gamedata.errormessage = fgettext("The package $1 was not found.", auto_install_spec)
ui.update()
auto_install_spec = nil
end
return resolved
end
-- Installs the package specified by auto_install_spec.
-- Only does something if:
-- a. The package list has been loaded successfully.
-- b. The store dialog is currently visible.
local function do_auto_install()
if not store.load_ok then
return
end
local pkg = resolve_auto_install_spec()
if not pkg then
return
end
local store_dlg = ui.find_by_name("store")
if not store_dlg or store_dlg.hidden then
return
end
install_or_update_package(store_dlg, pkg)
auto_install_spec = nil
end
function store.load()
if store.load_ok then
sort_and_filter_pkgs()
return
end
if store.loading then
return
end
store.loading = true
core.handle_async(
fetch_pkgs,
nil,
function(result)
if result then
store.load_ok = true
store.load_error = false
store.packages = result.packages
store.packages_full = result.packages
store.packages_full_unordered = result.packages
store.aliases = result.aliases
sort_and_filter_pkgs()
do_auto_install()
else
store.load_error = true
end
store.loading = false
ui.update()
end
)
end
function store.update_paths()
local mod_hash = {}
pkgmgr.refresh_globals()
for _, mod in pairs(pkgmgr.global_mods:get_list()) do
if mod.author and mod.release > 0 then
local id = mod.author:lower() .. "/" .. mod.name
mod_hash[store.aliases[id] or id] = mod
local cdb_id = pkgmgr.get_contentdb_id(mod)
if cdb_id then
mod_hash[store.aliases[cdb_id] or cdb_id] = mod
end
end
local game_hash = {}
pkgmgr.update_gamelist()
for _, game in pairs(pkgmgr.games) do
if game.author ~= "" and game.release > 0 then
local id = game.author:lower() .. "/" .. game.id
game_hash[store.aliases[id] or id] = game
local cdb_id = pkgmgr.get_contentdb_id(game)
if cdb_id then
game_hash[store.aliases[cdb_id] or cdb_id] = game
end
end
local txp_hash = {}
for _, txp in pairs(pkgmgr.get_texture_packs()) do
if txp.author and txp.release > 0 then
local id = txp.author:lower() .. "/" .. txp.name
txp_hash[store.aliases[id] or id] = txp
local cdb_id = pkgmgr.get_contentdb_id(txp)
if cdb_id then
txp_hash[store.aliases[cdb_id] or cdb_id] = txp
end
end
@@ -667,6 +813,7 @@ function store.update_paths()
package.installed_release = content.release or 0
else
package.path = nil
package.installed_release = nil
end
end
end
@@ -674,27 +821,40 @@ end
function store.sort_packages()
local ret = {}
local auto_install_pkg = resolve_auto_install_spec() -- can be nil
-- Add installed content
for i=1, #store.packages_full_unordered do
local package = store.packages_full_unordered[i]
if package.path then
ret[#ret + 1] = package
for _, pkg in ipairs(store.packages_full_unordered) do
if pkg.path and pkg ~= auto_install_pkg then
ret[#ret + 1] = pkg
end
end
-- Sort installed content by title
-- Sort installed content first by "is there an update available?", then by title
table.sort(ret, function(a, b)
local a_updatable = a.installed_release < a.release
local b_updatable = b.installed_release < b.release
if a_updatable and not b_updatable then
return true
elseif b_updatable and not a_updatable then
return false
end
return a.title < b.title
end)
-- Add uninstalled content
for i=1, #store.packages_full_unordered do
local package = store.packages_full_unordered[i]
if not package.path then
ret[#ret + 1] = package
for _, pkg in ipairs(store.packages_full_unordered) do
if not pkg.path and pkg ~= auto_install_pkg then
ret[#ret + 1] = pkg
end
end
-- Put the package that will be auto-installed at the very top
if auto_install_pkg then
table.insert(ret, 1, auto_install_pkg)
end
store.packages_full = ret
end
@@ -733,7 +893,29 @@ function store.filter_packages(query)
end
end
local function get_info_formspec(text)
local H = 9.5
return table.concat({
"formspec_version[6]",
"size[15.75,9.5]",
TOUCHSCREEN_GUI and "padding[0.01,0.01]" or "position[0.5,0.55]",
"label[4,4.35;", text, "]",
"container[0,", H - 0.8 - 0.375, "]",
"button[0.375,0;5,0.8;back;", fgettext("Back to Main Menu"), "]",
"container_end[]",
})
end
function store.get_formspec(dlgdata)
if store.loading then
return get_info_formspec(fgettext("Loading..."))
end
if store.load_error then
return get_info_formspec(fgettext("No packages could be retrieved"))
end
assert(store.load_ok)
store.update_paths()
dlgdata.pagemax = math.max(math.ceil(#store.packages / num_per_page), 1)
@@ -743,82 +925,70 @@ function store.get_formspec(dlgdata)
local W = 15.75
local H = 9.5
local formspec
if #store.packages_full > 0 then
formspec = {
"formspec_version[3]",
"size[15.75,9.5]",
"position[0.5,0.55]",
local formspec = {
"formspec_version[6]",
"size[15.75,9.5]",
TOUCHSCREEN_GUI and "padding[0.01,0.01]" or "position[0.5,0.55]",
"style[status,downloading,queued;border=false]",
"style[status,downloading,queued;border=false]",
"container[0.375,0.375]",
"field[0,0;7.225,0.8;search_string;;", core.formspec_escape(search_string), "]",
"field_close_on_enter[search_string;false]",
"image_button[7.3,0;0.8,0.8;", core.formspec_escape(defaulttexturedir .. "search.png"), ";search;]",
"image_button[8.125,0;0.8,0.8;", core.formspec_escape(defaulttexturedir .. "clear.png"), ";clear;]",
"dropdown[9.6,0;2.4,0.8;type;", table.concat(filter_types_titles, ","), ";", filter_type, "]",
"container_end[]",
"container[0.375,0.375]",
"field[0,0;7.225,0.8;search_string;;", core.formspec_escape(search_string), "]",
"field_enter_after_edit[search_string;true]",
"image_button[7.3,0;0.8,0.8;", core.formspec_escape(defaulttexturedir .. "search.png"), ";search;]",
"image_button[8.125,0;0.8,0.8;", core.formspec_escape(defaulttexturedir .. "clear.png"), ";clear;]",
"dropdown[9.175,0;2.7875,0.8;type;", table.concat(filter_types_titles, ","), ";", filter_type, "]",
"container_end[]",
-- Page nav buttons
"container[0,", H - 0.8 - 0.375, "]",
"button[0.375,0;4,0.8;back;", fgettext("Back to Main Menu"), "]",
-- Page nav buttons
"container[0,", H - 0.8 - 0.375, "]",
"button[0.375,0;5,0.8;back;", fgettext("Back to Main Menu"), "]",
"container[", W - 0.375 - 0.8*4 - 2, ",0]",
"image_button[0,0;0.8,0.8;", core.formspec_escape(defaulttexturedir), "start_icon.png;pstart;]",
"image_button[0.8,0;0.8,0.8;", core.formspec_escape(defaulttexturedir), "prev_icon.png;pback;]",
"style[pagenum;border=false]",
"button[1.6,0;2,0.8;pagenum;", tonumber(cur_page), " / ", tonumber(dlgdata.pagemax), "]",
"image_button[3.6,0;0.8,0.8;", core.formspec_escape(defaulttexturedir), "next_icon.png;pnext;]",
"image_button[4.4,0;0.8,0.8;", core.formspec_escape(defaulttexturedir), "end_icon.png;pend;]",
"container_end[]",
"container[", W - 0.375 - 0.8*4 - 2, ",0]",
"image_button[0,0;0.8,0.8;", core.formspec_escape(defaulttexturedir), "start_icon.png;pstart;]",
"image_button[0.8,0;0.8,0.8;", core.formspec_escape(defaulttexturedir), "prev_icon.png;pback;]",
"style[pagenum;border=false]",
"button[1.6,0;2,0.8;pagenum;", tonumber(cur_page), " / ", tonumber(dlgdata.pagemax), "]",
"image_button[3.6,0;0.8,0.8;", core.formspec_escape(defaulttexturedir), "next_icon.png;pnext;]",
"image_button[4.4,0;0.8,0.8;", core.formspec_escape(defaulttexturedir), "end_icon.png;pend;]",
"container_end[]",
"container_end[]",
}
"container_end[]",
}
if number_downloading > 0 then
formspec[#formspec + 1] = "button[12.75,0.375;2.625,0.8;downloading;"
if #download_queue > 0 then
formspec[#formspec + 1] = fgettext("$1 downloading,\n$2 queued", number_downloading, #download_queue)
else
formspec[#formspec + 1] = fgettext("$1 downloading...", number_downloading)
if number_downloading > 0 then
formspec[#formspec + 1] = "button[12.5875,0.375;2.7875,0.8;downloading;"
if #download_queue > 0 then
formspec[#formspec + 1] = fgettext("$1 downloading,\n$2 queued", number_downloading, #download_queue)
else
formspec[#formspec + 1] = fgettext("$1 downloading...", number_downloading)
end
formspec[#formspec + 1] = "]"
else
local num_avail_updates = 0
for i=1, #store.packages_full do
local package = store.packages_full[i]
if package.path and package.installed_release < package.release and
not (package.downloading or package.queued) then
num_avail_updates = num_avail_updates + 1
end
end
if num_avail_updates == 0 then
formspec[#formspec + 1] = "button[12.5875,0.375;2.7875,0.8;status;"
formspec[#formspec + 1] = fgettext("No updates")
formspec[#formspec + 1] = "]"
else
local num_avail_updates = 0
for i=1, #store.packages_full do
local package = store.packages_full[i]
if package.path and package.installed_release < package.release and
not (package.downloading or package.queued) then
num_avail_updates = num_avail_updates + 1
end
end
if num_avail_updates == 0 then
formspec[#formspec + 1] = "button[12.75,0.375;2.625,0.8;status;"
formspec[#formspec + 1] = fgettext("No updates")
formspec[#formspec + 1] = "]"
else
formspec[#formspec + 1] = "button[12.75,0.375;2.625,0.8;update_all;"
formspec[#formspec + 1] = fgettext("Update All [$1]", num_avail_updates)
formspec[#formspec + 1] = "]"
end
end
if #store.packages == 0 then
formspec[#formspec + 1] = "label[4,3;"
formspec[#formspec + 1] = fgettext("No results")
formspec[#formspec + 1] = "button[12.5875,0.375;2.7875,0.8;update_all;"
formspec[#formspec + 1] = fgettext("Update All [$1]", num_avail_updates)
formspec[#formspec + 1] = "]"
end
else
formspec = {
"size[12,7]",
"position[0.5,0.55]",
"label[4,3;", fgettext("No packages could be retrieved"), "]",
"container[0,", H - 0.8 - 0.375, "]",
"button[0,0;4,0.8;back;", fgettext("Back to Main Menu"), "]",
"container_end[]",
}
end
if #store.packages == 0 then
formspec[#formspec + 1] = "label[4,4.75;"
formspec[#formspec + 1] = fgettext("No results")
formspec[#formspec + 1] = "]"
end
-- download/queued tooltips always have the same message
@@ -847,7 +1017,10 @@ function store.get_formspec(dlgdata)
formspec[#formspec + 1] = "]"
-- buttons
local left_base = "image_button[-1.55,0;0.7,0.7;" .. core.formspec_escape(defaulttexturedir)
local description_width = W - 2.625 - 2 * 0.7 - 2 * 0.15
local second_base = "image_button[-1.55,0;0.7,0.7;" .. core.formspec_escape(defaulttexturedir)
local third_base = "image_button[-2.4,0;0.7,0.7;" .. core.formspec_escape(defaulttexturedir)
formspec[#formspec + 1] = "container["
formspec[#formspec + 1] = W - 0.375*2
formspec[#formspec + 1] = ",0.1]"
@@ -857,28 +1030,28 @@ function store.get_formspec(dlgdata)
formspec[#formspec + 1] = core.formspec_escape(defaulttexturedir)
formspec[#formspec + 1] = "cdb_downloading.png;3;400;]"
elseif package.queued then
formspec[#formspec + 1] = left_base
formspec[#formspec + 1] = second_base
formspec[#formspec + 1] = "cdb_queued.png;queued;]"
elseif not package.path then
local elem_name = "install_" .. i .. ";"
formspec[#formspec + 1] = "style[" .. elem_name .. "bgcolor=#71aa34]"
formspec[#formspec + 1] = left_base .. "cdb_add.png;" .. elem_name .. "]"
formspec[#formspec + 1] = second_base .. "cdb_add.png;" .. elem_name .. "]"
formspec[#formspec + 1] = "tooltip[" .. elem_name .. fgettext("Install") .. tooltip_colors
else
if package.installed_release < package.release then
-- The install_ action also handles updating
local elem_name = "install_" .. i .. ";"
formspec[#formspec + 1] = "style[" .. elem_name .. "bgcolor=#28ccdf]"
formspec[#formspec + 1] = left_base .. "cdb_update.png;" .. elem_name .. "]"
formspec[#formspec + 1] = third_base .. "cdb_update.png;" .. elem_name .. "]"
formspec[#formspec + 1] = "tooltip[" .. elem_name .. fgettext("Update") .. tooltip_colors
else
local elem_name = "uninstall_" .. i .. ";"
formspec[#formspec + 1] = "style[" .. elem_name .. "bgcolor=#a93b3b]"
formspec[#formspec + 1] = left_base .. "cdb_clear.png;" .. elem_name .. "]"
formspec[#formspec + 1] = "tooltip[" .. elem_name .. fgettext("Uninstall") .. tooltip_colors
description_width = description_width - 0.7 - 0.15
end
local elem_name = "uninstall_" .. i .. ";"
formspec[#formspec + 1] = "style[" .. elem_name .. "bgcolor=#a93b3b]"
formspec[#formspec + 1] = second_base .. "cdb_clear.png;" .. elem_name .. "]"
formspec[#formspec + 1] = "tooltip[" .. elem_name .. fgettext("Uninstall") .. tooltip_colors
end
local web_elem_name = "view_" .. i .. ";"
@@ -889,7 +1062,6 @@ function store.get_formspec(dlgdata)
formspec[#formspec + 1] = "container_end[]"
-- description
local description_width = W - 0.375*5 - 0.85 - 2*0.7
formspec[#formspec + 1] = "textarea[1.855,0.3;"
formspec[#formspec + 1] = tostring(description_width)
formspec[#formspec + 1] = ",0.8;;;"
@@ -899,7 +1071,7 @@ function store.get_formspec(dlgdata)
formspec[#formspec + 1] = "container_end[]"
end
return table.concat(formspec, "")
return table.concat(formspec)
end
function store.handle_submit(this, fields)
@@ -953,6 +1125,7 @@ function store.handle_submit(this, fields)
local new_type = table.indexof(filter_types_titles, fields.type)
if new_type ~= filter_type then
filter_type = new_type
cur_page = 1
store.filter_packages(search_string)
return true
end
@@ -976,39 +1149,7 @@ function store.handle_submit(this, fields)
assert(package)
if fields["install_" .. i] then
local install_parent
if package.type == "mod" then
install_parent = core.get_modpath()
elseif package.type == "game" then
install_parent = core.get_gamepath()
elseif package.type == "txp" then
install_parent = core.get_texturepath()
else
error("Unknown package type: " .. package.type)
end
local function on_confirm()
local deps = get_raw_dependencies(package)
if deps and has_hard_deps(deps) then
local dlg = install_dialog.create(package, deps)
dlg:set_parent(this)
this:hide()
dlg:show()
else
queue_download(package, package.path and REASON_UPDATE or REASON_NEW)
end
end
if not package.path and core.is_dir(install_parent .. DIR_DELIM .. package.name) then
local dlg = confirm_overwrite.create(package, on_confirm)
dlg:set_parent(this)
this:hide()
dlg:show()
else
on_confirm()
end
install_or_update_package(this, package)
return true
end
@@ -1032,17 +1173,30 @@ function store.handle_submit(this, fields)
return false
end
function create_store_dlg(type)
if not store.loaded or #store.packages_full == 0 then
store.load()
function store.handle_events(event)
if event == "DialogShow" then
-- On mobile, don't show the "MINETEST" header behind the dialog.
mm_game_theme.set_engine(TOUCHSCREEN_GUI)
-- If the store is already loaded, auto-install packages here.
do_auto_install()
return true
end
store.update_paths()
store.sort_packages()
return false
end
--- Creates a ContentDB dialog.
---
--- @param type string | nil
--- Sets initial package filter. "game", "mod", "txp" or nil (no filter).
--- @param install_spec table | nil
--- ContentDB ID of package as returned by pkgmgr.get_contentdb_id().
--- Sets package to install or update automatically.
function create_store_dlg(type, install_spec)
search_string = ""
cur_page = 1
if type then
-- table.indexof does not work on tables that contain `nil`
for i, v in pairs(filter_types_type) do
@@ -1051,12 +1205,19 @@ function create_store_dlg(type)
break
end
end
else
filter_type = 1
end
store.filter_packages(search_string)
-- Keep the old auto_install_spec if the caller doesn't specify one.
if install_spec then
auto_install_spec = install_spec
end
store.load()
return dialog_create("store",
store.get_formspec,
store.handle_submit,
nil)
store.handle_events)
end

View File

@@ -0,0 +1,22 @@
--Minetest
--Copyright (C) 2023 rubenwardy
--
--This program is free software; you can redistribute it and/or modify
--it under the terms of the GNU Lesser General Public License as published by
--the Free Software Foundation; either version 2.1 of the License, or
--(at your option) any later version.
--
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--GNU Lesser General Public License for more details.
--
--You should have received a copy of the GNU Lesser General Public License along
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
local path = core.get_mainmenu_path() .. DIR_DELIM .. "content"
dofile(path .. DIR_DELIM .. "pkgmgr.lua")
dofile(path .. DIR_DELIM .. "update_detector.lua")
dofile(path .. DIR_DELIM .. "dlg_contentstore.lua")

View File

@@ -100,7 +100,15 @@ local function load_texture_packs(txtpath, retval)
end
end
function get_mods(path, virtual_path, retval, modpack)
--modmanager implementation
pkgmgr = {}
--- Scans a directory recursively for mods and adds them to `listing`
-- @param path Absolute directory path to scan recursively
-- @param virtual_path Prettified unique path (e.g. "mods", "mods/mt_modpack")
-- @param listing Input. Flat array to insert located mods and modpacks
-- @param modpack Currently processing modpack or nil/"" if none (recursion)
function pkgmgr.get_mods(path, virtual_path, listing, modpack)
local mods = core.get_dir_list(path, true)
for _, name in ipairs(mods) do
@@ -111,7 +119,7 @@ function get_mods(path, virtual_path, retval, modpack)
dir_name = name,
parent_dir = path,
}
retval[#retval + 1] = toadd
listing[#listing + 1] = toadd
-- Get config file
local mod_conf
@@ -156,15 +164,20 @@ function get_mods(path, virtual_path, retval, modpack)
elseif toadd.is_modpack then
toadd.type = "modpack"
toadd.is_modpack = true
get_mods(mod_path, mod_virtual_path, retval, name)
pkgmgr.get_mods(mod_path, mod_virtual_path, listing, name)
end
end
end
if not modpack then
-- Sort all when the recursion is done
table.sort(listing, function(a, b)
return a.virtual_path:lower() < b.virtual_path:lower()
end)
end
end
--modmanager implementation
pkgmgr = {}
--------------------------------------------------------------------------------
function pkgmgr.get_texture_packs()
local txtpath = core.get_texturepath()
local txtpath_system = core.get_texturepath_share()
@@ -177,12 +190,29 @@ function pkgmgr.get_texture_packs()
end
table.sort(retval, function(a, b)
return a.name > b.name
return a.title:lower() < b.title:lower()
end)
return retval
end
--------------------------------------------------------------------------------
function pkgmgr.get_all()
local result = {}
for _, mod in pairs(pkgmgr.global_mods:get_list()) do
result[#result + 1] = mod
end
for _, game in pairs(pkgmgr.games) do
result[#result + 1] = game
end
for _, txp in pairs(pkgmgr.get_texture_packs()) do
result[#result + 1] = txp
end
return result
end
--------------------------------------------------------------------------------
function pkgmgr.get_folder_type(path)
local testfile = io.open(path .. DIR_DELIM .. "init.lua","r")
@@ -243,101 +273,15 @@ function pkgmgr.get_base_folder(temppath)
end
--------------------------------------------------------------------------------
function pkgmgr.isValidModname(modpath)
if modpath:find("-") ~= nil then
return false
end
return true
function pkgmgr.is_valid_modname(modpath)
return modpath:match("[^a-z0-9_]") == nil
end
--------------------------------------------------------------------------------
function pkgmgr.parse_register_line(line)
local pos1 = line:find("\"")
local pos2 = nil
if pos1 ~= nil then
pos2 = line:find("\"",pos1+1)
end
if pos1 ~= nil and pos2 ~= nil then
local item = line:sub(pos1+1,pos2-1)
if item ~= nil and
item ~= "" then
local pos3 = item:find(":")
if pos3 ~= nil then
local retval = item:sub(1,pos3-1)
if retval ~= nil and
retval ~= "" then
return retval
end
end
end
end
return nil
end
--------------------------------------------------------------------------------
function pkgmgr.parse_dofile_line(modpath,line)
local pos1 = line:find("\"")
local pos2 = nil
if pos1 ~= nil then
pos2 = line:find("\"",pos1+1)
end
if pos1 ~= nil and pos2 ~= nil then
local filename = line:sub(pos1+1,pos2-1)
if filename ~= nil and
filename ~= "" and
filename:find(".lua") then
return pkgmgr.identify_modname(modpath,filename)
end
end
return nil
end
--------------------------------------------------------------------------------
function pkgmgr.identify_modname(modpath,filename)
local testfile = io.open(modpath .. DIR_DELIM .. filename,"r")
if testfile ~= nil then
local line = testfile:read()
while line~= nil do
local modname = nil
if line:find("minetest.register_tool") then
modname = pkgmgr.parse_register_line(line)
end
if line:find("minetest.register_craftitem") then
modname = pkgmgr.parse_register_line(line)
end
if line:find("minetest.register_node") then
modname = pkgmgr.parse_register_line(line)
end
if line:find("dofile") then
modname = pkgmgr.parse_dofile_line(modpath,line)
end
if modname ~= nil then
testfile:close()
return modname
end
line = testfile:read()
end
testfile:close()
end
return nil
end
--------------------------------------------------------------------------------
function pkgmgr.render_packagelist(render_list, use_technical_names, with_error)
--- @param render_list filterlist
--- @param use_technical_names boolean to show technical names instead of human-readable titles
--- @param with_icon table or nil, from virtual path to icon object
function pkgmgr.render_packagelist(render_list, use_technical_names, with_icon)
if not render_list then
if not pkgmgr.global_mods then
pkgmgr.refresh_globals()
@@ -350,10 +294,10 @@ function pkgmgr.render_packagelist(render_list, use_technical_names, with_error)
for i, v in ipairs(list) do
local color = ""
local icon = 0
local error = with_error and with_error[v.virtual_path]
local function update_error(val)
if val and (not error or (error.type == "warning" and val.type == "error")) then
error = val
local icon_info = with_icon and with_icon[v.virtual_path or v.path]
local function update_icon_info(val)
if val and (not icon_info or (icon_info.type == "warning" and val.type == "error")) then
icon_info = val
end
end
@@ -363,8 +307,8 @@ function pkgmgr.render_packagelist(render_list, use_technical_names, with_error)
for j = 1, #rawlist do
if rawlist[j].modpack == list[i].name then
if with_error then
update_error(with_error[rawlist[j].virtual_path])
if with_icon then
update_icon_info(with_icon[rawlist[j].virtual_path or rawlist[j].path])
end
if rawlist[j].enabled then
@@ -380,10 +324,10 @@ function pkgmgr.render_packagelist(render_list, use_technical_names, with_error)
color = mt_color_blue
local rawlist = render_list:get_raw_list()
if v.type == "game" and with_error then
if v.type == "game" and with_icon then
for j = 1, #rawlist do
if rawlist[j].is_game_content then
update_error(with_error[rawlist[j].virtual_path])
update_icon_info(with_icon[rawlist[j].virtual_path or rawlist[j].path])
end
end
end
@@ -392,13 +336,17 @@ function pkgmgr.render_packagelist(render_list, use_technical_names, with_error)
color = mt_color_green
end
if error then
if error.type == "warning" then
if icon_info then
if icon_info.type == "warning" then
color = mt_color_orange
icon = 2
else
elseif icon_info.type == "error" then
color = mt_color_red
icon = 3
elseif icon_info.type == "update" then
icon = 4
else
error("Unknown icon type " .. icon_info.type)
end
end
@@ -409,7 +357,7 @@ function pkgmgr.render_packagelist(render_list, use_technical_names, with_error)
retval[#retval + 1] = "0"
end
if with_error then
if with_icon then
retval[#retval + 1] = icon
end
@@ -597,102 +545,70 @@ function pkgmgr.get_worldconfig(worldpath)
end
--------------------------------------------------------------------------------
function pkgmgr.install_dir(type, path, basename, targetpath)
function pkgmgr.install_dir(expected_type, path, basename, targetpath)
assert(type(expected_type) == "string")
assert(type(path) == "string")
assert(basename == nil or type(basename) == "string")
assert(targetpath == nil or type(targetpath) == "string")
local basefolder = pkgmgr.get_base_folder(path)
-- There's no good way to detect a texture pack, so let's just assume
-- it's correct for now.
if type == "txp" then
if expected_type == "txp" then
assert(basename)
-- There's no good way to detect a texture pack, so let's just assume
-- it's correct for now.
if basefolder and basefolder.type ~= "invalid" and basefolder.type ~= "txp" then
return nil, fgettext("Unable to install a $1 as a texture pack", basefolder.type)
return nil, fgettext_ne("Unable to install a $1 as a texture pack", basefolder.type)
end
local from = basefolder and basefolder.path or path
if targetpath then
core.delete_dir(targetpath)
else
if not targetpath then
targetpath = core.get_texturepath() .. DIR_DELIM .. basename
end
core.delete_dir(targetpath)
if not core.copy_dir(from, targetpath, false) then
return nil,
fgettext("Failed to install $1 to $2", basename, targetpath)
fgettext_ne("Failed to install $1 to $2", basename, targetpath)
end
return targetpath, nil
elseif not basefolder then
return nil, fgettext("Unable to find a valid mod or modpack")
return nil, fgettext_ne("Unable to find a valid mod, modpack, or game")
end
--
-- Get destination
--
if basefolder.type == "modpack" then
if type ~= "mod" then
return nil, fgettext("Unable to install a modpack as a $1", type)
end
-- Check type
if basefolder.type ~= expected_type and (basefolder.type ~= "modpack" or expected_type ~= "mod") then
return nil, fgettext_ne("Unable to install a $1 as a $2", basefolder.type, expected_type)
end
-- Get destination name for modpack
if targetpath then
core.delete_dir(targetpath)
-- Set targetpath if not predetermined
if not targetpath then
local content_path
if basefolder.type == "modpack" or basefolder.type == "mod" then
if not basename then
basename = get_last_folder(cleanup_path(basefolder.path))
end
content_path = core.get_modpath()
elseif basefolder.type == "game" then
content_path = core.get_gamepath()
else
local clean_path = nil
if basename ~= nil then
clean_path = basename
end
if not clean_path then
clean_path = get_last_folder(cleanup_path(basefolder.path))
end
if clean_path then
targetpath = core.get_modpath() .. DIR_DELIM .. clean_path
else
return nil,
fgettext("Install Mod: Unable to find suitable folder name for modpack $1",
path)
end
end
elseif basefolder.type == "mod" then
if type ~= "mod" then
return nil, fgettext("Unable to install a mod as a $1", type)
error("Unknown content type")
end
if targetpath then
core.delete_dir(targetpath)
if basename and (basefolder.type ~= "mod" or pkgmgr.is_valid_modname(basename)) then
targetpath = content_path .. DIR_DELIM .. basename
else
local targetfolder = basename
if targetfolder == nil then
targetfolder = pkgmgr.identify_modname(basefolder.path, "init.lua")
end
-- If heuristic failed try to use current foldername
if targetfolder == nil then
targetfolder = get_last_folder(basefolder.path)
end
if targetfolder ~= nil and pkgmgr.isValidModname(targetfolder) then
targetpath = core.get_modpath() .. DIR_DELIM .. targetfolder
else
return nil, fgettext("Install Mod: Unable to find real mod name for: $1", path)
end
return nil,
fgettext_ne("Install: Unable to find suitable folder name for $1", path)
end
elseif basefolder.type == "game" then
if type ~= "game" then
return nil, fgettext("Unable to install a game as a $1", type)
end
if targetpath then
core.delete_dir(targetpath)
else
targetpath = core.get_gamepath() .. DIR_DELIM .. basename
end
else
error("basefolder didn't return a recognised type, this shouldn't happen")
end
-- Copy it
core.delete_dir(targetpath)
if not core.copy_dir(basefolder.path, targetpath, false) then
return nil,
fgettext("Failed to install $1 to $2", basename, targetpath)
fgettext_ne("Failed to install $1 to $2", basename, targetpath)
end
if basefolder.type == "game" then
@@ -714,7 +630,7 @@ function pkgmgr.preparemodlist(data)
--read global mods
local modpaths = core.get_modpaths()
for key, modpath in pairs(modpaths) do
get_mods(modpath, key, global_mods)
pkgmgr.get_mods(modpath, key, global_mods)
end
for i=1,#global_mods,1 do
@@ -821,35 +737,6 @@ function pkgmgr.comparemod(elem1,elem2)
return true
end
--------------------------------------------------------------------------------
function pkgmgr.mod_exists(basename)
if pkgmgr.global_mods == nil then
pkgmgr.refresh_globals()
end
if pkgmgr.global_mods:raw_index_by_uid(basename) > 0 then
return true
end
return false
end
--------------------------------------------------------------------------------
function pkgmgr.get_global_mod(idx)
if pkgmgr.global_mods == nil then
return nil
end
if idx == nil or idx < 1 or
idx > pkgmgr.global_mods:size() then
return nil
end
return pkgmgr.global_mods:get_list()[idx]
end
--------------------------------------------------------------------------------
function pkgmgr.refresh_globals()
local function is_equal(element,uid) --uid match
@@ -865,9 +752,9 @@ end
--------------------------------------------------------------------------------
function pkgmgr.find_by_gameid(gameid)
for i=1,#pkgmgr.games,1 do
if pkgmgr.games[i].id == gameid then
return pkgmgr.games[i], i
for i, game in ipairs(pkgmgr.games) do
if game.id == gameid then
return game, i
end
end
return nil, nil
@@ -878,51 +765,42 @@ function pkgmgr.get_game_mods(gamespec, retval)
if gamespec ~= nil and
gamespec.gamemods_path ~= nil and
gamespec.gamemods_path ~= "" then
get_mods(gamespec.gamemods_path, ("games/%s/mods"):format(gamespec.id), retval)
pkgmgr.get_mods(gamespec.gamemods_path, ("games/%s/mods"):format(gamespec.id), retval)
end
end
--------------------------------------------------------------------------------
function pkgmgr.get_game_modlist(gamespec)
local retval = ""
local game_mods = {}
pkgmgr.get_game_mods(gamespec, game_mods)
for i=1,#game_mods,1 do
if retval ~= "" then
retval = retval..","
function pkgmgr.update_gamelist()
pkgmgr.games = core.get_games()
table.sort(pkgmgr.games, function(a, b)
return a.title:lower() < b.title:lower()
end)
end
--------------------------------------------------------------------------------
-- Returns the ContentDB ID for an installed piece of content.
function pkgmgr.get_contentdb_id(content)
-- core.get_games() will return "" instead of nil if there is no "author" field.
if content.author and content.author ~= "" and content.release > 0 then
if content.type == "game" then
return content.author:lower() .. "/" .. content.id
end
retval = retval .. game_mods[i].name
return content.author:lower() .. "/" .. content.name
end
return retval
end
--------------------------------------------------------------------------------
function pkgmgr.get_game(index)
if index > 0 and index <= #pkgmgr.games then
return pkgmgr.games[index]
-- Until Minetest 5.8.0, Minetest Game was bundled with Minetest.
-- Unfortunately, the bundled MTG was not versioned (missing "release"
-- field in game.conf).
-- Therefore, we consider any installation of MTG that is not versioned,
-- has not been cloned from Git, and is not system-wide to be updatable.
if content.type == "game" and content.id == "minetest" and content.release == 0 and
not core.is_dir(content.path .. "/.git") and core.may_modify_path(content.path) then
return "minetest/minetest"
end
return nil
end
--------------------------------------------------------------------------------
function pkgmgr.update_gamelist()
pkgmgr.games = core.get_games()
end
--------------------------------------------------------------------------------
function pkgmgr.gamelist()
local retval = ""
if #pkgmgr.games > 0 then
retval = retval .. core.formspec_escape(pkgmgr.games[1].title)
for i=2,#pkgmgr.games,1 do
retval = retval .. "," .. core.formspec_escape(pkgmgr.games[i].title)
end
end
return retval
end
--------------------------------------------------------------------------------
-- read initial data
--------------------------------------------------------------------------------

View File

@@ -0,0 +1,243 @@
--Minetest
--Copyright (C) 2022 rubenwardy
--
--This program is free software; you can redistribute it and/or modify
--it under the terms of the GNU Lesser General Public License as published by
--the Free Software Foundation; either version 2.1 of the License, or
--(at your option) any later version.
--
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--GNU Lesser General Public License for more details.
--
--You should have received a copy of the GNU Lesser General Public License along
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
local mods_dir = "/tmp/.minetest/mods"
local games_dir = "/tmp/.minetest/games"
local txp_dir = "/tmp/.minetest/textures"
local function reset()
local env = {
core = {},
unpack = table.unpack or unpack,
pkgmgr = {},
DIR_DELIM = "/",
}
env._G = env
setmetatable(env, { __index = _G })
local core = env.core
local calls = {}
function core.get_games()
return {}
end
function core.delete_dir(...)
table.insert(calls, { "delete_dir", ... })
return true
end
function core.copy_dir(...)
table.insert(calls, { "copy_dir", ... })
return true
end
function core.get_texturepath()
return txp_dir
end
function core.get_modpath()
return mods_dir
end
function core.get_gamepath()
return games_dir
end
function env.fgettext_ne(fmt, ...)
return fmt
end
setfenv(loadfile("builtin/common/misc_helpers.lua"), env)()
setfenv(loadfile("builtin/mainmenu/content/pkgmgr.lua"), env)()
function env.pkgmgr.update_gamelist()
table.insert(calls, { "update_gamelist" })
end
function env.pkgmgr.refresh_globals()
table.insert(calls, { "refresh_globals" })
end
function env.assert_calls(list)
assert.are.same(list, calls)
end
return env
end
describe("install_dir", function()
it("installs texture pack", function()
local env = reset()
env.pkgmgr.get_base_folder = function()
return { type = "invalid", path = "/tmp/123" }
end
local path, message = env.pkgmgr.install_dir("txp", "/tmp/123", "mytxp", nil)
assert.is.equal(txp_dir .. "/mytxp", path)
assert.is._nil(message)
env.assert_calls({
{ "delete_dir", txp_dir .. "/mytxp" },
{ "copy_dir", "/tmp/123", txp_dir .. "/mytxp", false },
})
end)
it("prevents installing other as texture pack", function()
local env = reset()
env.pkgmgr.get_base_folder = function()
return { type = "mod", path = "/tmp/123" }
end
local path, message = env.pkgmgr.install_dir("txp", "/tmp/123", "mytxp", nil)
assert.is._nil(path)
assert.is.equal("Unable to install a $1 as a texture pack", message)
end)
it("installs mod", function()
local env = reset()
env.pkgmgr.get_base_folder = function()
return { type = "mod", path = "/tmp/123" }
end
local path, message = env.pkgmgr.install_dir("mod", "/tmp/123", "mymod", nil)
assert.is.equal(mods_dir .. "/mymod", path)
assert.is._nil(message)
env.assert_calls({
{ "delete_dir", mods_dir .. "/mymod" },
{ "copy_dir", "/tmp/123", mods_dir .. "/mymod", false },
{ "refresh_globals" },
})
end)
it("installs modpack", function()
local env = reset()
env.pkgmgr.get_base_folder = function()
return { type = "modpack", path = "/tmp/123" }
end
local path, message = env.pkgmgr.install_dir("mod", "/tmp/123", "mymod", nil)
assert.is.equal(mods_dir .. "/mymod", path)
assert.is._nil(message)
env.assert_calls({
{ "delete_dir", mods_dir .. "/mymod" },
{ "copy_dir", "/tmp/123", mods_dir .. "/mymod", false },
{ "refresh_globals" },
})
end)
it("installs game", function()
local env = reset()
env.pkgmgr.get_base_folder = function()
return { type = "game", path = "/tmp/123" }
end
local path, message = env.pkgmgr.install_dir("game", "/tmp/123", "mygame", nil)
assert.is.equal(games_dir .. "/mygame", path)
assert.is._nil(message)
env.assert_calls({
{ "delete_dir", games_dir .. "/mygame" },
{ "copy_dir", "/tmp/123", games_dir .. "/mygame", false },
{ "update_gamelist" },
})
end)
it("installs mod detects name", function()
local env = reset()
env.pkgmgr.get_base_folder = function()
return { type = "mod", path = "/tmp/123" }
end
local path, message = env.pkgmgr.install_dir("mod", "/tmp/123", nil, nil)
assert.is.equal(mods_dir .. "/123", path)
assert.is._nil(message)
env.assert_calls({
{ "delete_dir", mods_dir .. "/123" },
{ "copy_dir", "/tmp/123", mods_dir .. "/123", false },
{ "refresh_globals" },
})
end)
it("installs mod detects invalid name", function()
local env = reset()
env.pkgmgr.get_base_folder = function()
return { type = "mod", path = "/tmp/hi!" }
end
local path, message = env.pkgmgr.install_dir("mod", "/tmp/hi!", nil, nil)
assert.is._nil(path)
assert.is.equal("Install: Unable to find suitable folder name for $1", message)
end)
it("installs mod to target (update)", function()
local env = reset()
env.pkgmgr.get_base_folder = function()
return { type = "mod", path = "/tmp/123" }
end
local path, message = env.pkgmgr.install_dir("mod", "/tmp/123", "mymod", "/tmp/alt-target")
assert.is.equal("/tmp/alt-target", path)
assert.is._nil(message)
env.assert_calls({
{ "delete_dir", "/tmp/alt-target" },
{ "copy_dir", "/tmp/123", "/tmp/alt-target", false },
{ "refresh_globals" },
})
end)
it("checks expected types", function()
local actual_type = "modpack"
local env = reset()
env.pkgmgr.get_base_folder = function()
return { type = actual_type, path = "/tmp/123" }
end
local path, message = env.pkgmgr.install_dir("mod", "/tmp/123", "name", nil)
assert.is._not._nil(path)
assert.is._nil(message)
path, message = env.pkgmgr.install_dir("game", "/tmp/123", "name", nil)
assert.is._nil(path)
assert.is.equal("Unable to install a $1 as a $2", message)
path, message = env.pkgmgr.install_dir("txp", "/tmp/123", "name", nil)
assert.is._nil(path)
assert.is.equal("Unable to install a $1 as a texture pack", message)
actual_type = "game"
path, message = env.pkgmgr.install_dir("mod", "/tmp/123", "name", nil)
assert.is._nil(path)
assert.is.equal("Unable to install a $1 as a $2", message)
path, message = env.pkgmgr.install_dir("game", "/tmp/123", "name", nil)
assert.is._not._nil(path)
assert.is._nil(message)
path, message = env.pkgmgr.install_dir("txp", "/tmp/123", "name", nil)
assert.is._nil(path)
assert.is.equal("Unable to install a $1 as a texture pack", message)
actual_type = "txp"
path, message = env.pkgmgr.install_dir("mod", "/tmp/123", "name", nil)
assert.is._nil(path)
assert.is.equal("Unable to install a $1 as a $2", message)
path, message = env.pkgmgr.install_dir("game", "/tmp/123", "name", nil)
assert.is._nil(path)
assert.is.equal("Unable to install a $1 as a $2", message)
path, message = env.pkgmgr.install_dir("txp", "/tmp/123", "name", nil)
assert.is._not._nil(path)
assert.is._nil(message)
end)
end)

View File

@@ -0,0 +1,139 @@
--Minetest
--Copyright (C) 2023 rubenwardy
--
--This program is free software; you can redistribute it and/or modify
--it under the terms of the GNU Lesser General Public License as published by
--the Free Software Foundation; either version 2.1 of the License, or
--(at your option) any later version.
--
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--GNU Lesser General Public License for more details.
--
--You should have received a copy of the GNU Lesser General Public License along
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
update_detector = {}
if not core.get_http_api then
update_detector.get_all = function() return {} end
update_detector.get_count = function() return 0 end
return
end
local has_fetched = false
local latest_releases
local function fetch_latest_releases()
local version = core.get_version()
local base_url = core.settings:get("contentdb_url")
local url = base_url ..
"/api/updates/?type=mod&type=game&type=txp&protocol_version=" ..
core.get_max_supp_proto() .. "&engine_version=" .. core.urlencode(version.string)
local http = core.get_http_api()
local response = http.fetch_sync({ url = url })
if not response.succeeded then
return
end
return core.parse_json(response.data)
end
--- Get a table from package key (author/name) to latest release id
---
--- @param callback function that takes a single argument, table or nil
local function get_latest_releases(callback)
core.handle_async(fetch_latest_releases, nil, callback)
end
local function has_packages_from_cdb()
pkgmgr.refresh_globals()
pkgmgr.update_gamelist()
for _, content in pairs(pkgmgr.get_all()) do
if pkgmgr.get_contentdb_id(content) then
return true
end
end
return false
end
--- @returns a new table with all keys lowercase
local function lowercase_keys(tab)
local ret = {}
for key, value in pairs(tab) do
ret[key:lower()] = value
end
return ret
end
local function fetch()
if has_fetched or not has_packages_from_cdb() then
return
end
has_fetched = true
get_latest_releases(function(releases)
if not releases then
has_fetched = false
return
end
latest_releases = lowercase_keys(releases)
if update_detector.get_count() > 0 then
local maintab = ui.find_by_name("maintab")
if not maintab.hidden then
ui.update()
end
end
end)
end
--- @returns a list of content with an update available
function update_detector.get_all()
if latest_releases == nil then
fetch()
return {}
end
pkgmgr.refresh_globals()
pkgmgr.update_gamelist()
local ret = {}
local all_content = pkgmgr.get_all()
for _, content in ipairs(all_content) do
local cdb_id = pkgmgr.get_contentdb_id(content)
if cdb_id then
-- The backend will account for aliases in `latest_releases`
local latest_release = latest_releases[cdb_id]
if not latest_release and content.type == "game" then
latest_release = latest_releases[cdb_id .. "_game"]
end
if latest_release and latest_release > content.release then
ret[#ret + 1] = content
end
end
end
return ret
end
--- @return number of packages with updates available
function update_detector.get_count()
return #update_detector.get_all()
end

View File

@@ -57,8 +57,7 @@ local function init_data(data)
hide_game = data.hide_gamemods,
hide_modpackcontents = data.hide_modpackcontents
})
data.list:add_sort_mechanism("alphabetic", sort_mod_list)
data.list:set_sortmode("alphabetic")
-- Sorting is already done by pgkmgr.get_mods
end
@@ -246,7 +245,7 @@ local function get_formspec(data)
return retval ..
"tablecolumns[color;tree;image,align=inline,width=1.5,0=" .. core.formspec_escape(defaulttexturedir .. "blank.png") ..
",1=" .. core.formspec_escape(defaulttexturedir .. "checkbox_16_white.png") ..
",1=" .. core.formspec_escape(defaulttexturedir .. "checkbox_16.png") ..
",2=" .. core.formspec_escape(defaulttexturedir .. "error_icon_orange.png") ..
",3=" .. core.formspec_escape(defaulttexturedir .. "error_icon_red.png") .. ";text]" ..
"table[5.5,0.75;5.75,6;world_config_modlist;" ..

View File

@@ -91,27 +91,15 @@ local mgv6_biomes = {
local function create_world_formspec(dialogdata)
-- Point the player to ContentDB when no games are found
if #pkgmgr.games == 0 then
return "size[8,2.5,true]" ..
"style[label_button;border=false]" ..
"button[0.5,0.5;7,0.5;label_button;" ..
fgettext("You have no games installed.") .. "]" ..
"button[0.5,1.5;2.5,0.5;world_create_open_cdb;" .. fgettext("Install a game") .. "]" ..
"button[5.0,1.5;2.5,0.5;world_create_cancel;" .. fgettext("Cancel") .. "]"
end
local current_mg = dialogdata.mg
local mapgens = core.get_mapgen_names()
local gameid = core.settings:get("menu_last_game")
local flags = dialogdata.flags
local game = pkgmgr.find_by_gameid(gameid)
local game = pkgmgr.find_by_gameid(core.settings:get("menu_last_game"))
if game == nil then
-- should never happen but just pick the first game
game = pkgmgr.get_game(1)
game = pkgmgr.games[1]
core.settings:set("menu_last_game", game.id)
end
@@ -312,8 +300,8 @@ local function create_world_formspec(dialogdata)
"label[0,2;" .. fgettext("Mapgen") .. "]"..
"dropdown[0,2.5;6.3;dd_mapgen;" .. mglist .. ";" .. selindex .. "]"
-- Warning if only devtest is installed
if #pkgmgr.games == 1 and pkgmgr.games[1].id == "devtest" then
-- Warning when making a devtest world
if game.id == "devtest" then
retval = retval ..
"container[0,3.5]" ..
"box[0,0;5.8,1.7;#ff8800]" ..
@@ -354,12 +342,18 @@ local function create_world_buttonhandler(this, fields)
if fields["world_create_confirm"] or
fields["key_enter"] then
if fields["key_enter"] then
-- HACK: This timestamp prevents double-triggering when pressing Enter on an input box
-- and releasing it on a button[] or textlist[] due to instant formspec updates.
this.parent.dlg_create_world_closed_at = core.get_us_time()
end
local worldname = fields["te_world_name"]
local game, gameindex = pkgmgr.find_by_gameid(core.settings:get("menu_last_game"))
local game, _ = pkgmgr.find_by_gameid(core.settings:get("menu_last_game"))
local message
if game == nil then
message = fgettext("No game selected")
message = fgettext_ne("No game selected")
end
if message == nil then
@@ -378,7 +372,7 @@ local function create_world_buttonhandler(this, fields)
end
if menudata.worldlist:uid_exists_raw(worldname) then
message = fgettext("A world named \"$1\" already exists", worldname)
message = fgettext_ne("A world named \"$1\" already exists", worldname)
end
end
@@ -399,7 +393,7 @@ local function create_world_buttonhandler(this, fields)
mgvalleys_spflags = table_to_flags(this.data.flags.valleys),
mgflat_spflags = table_to_flags(this.data.flags.flat),
}
message = core.create_world(worldname, gameindex, settings)
message = core.create_world(worldname, game.id, settings)
end
if message == nil then

View File

@@ -34,7 +34,7 @@ local function delete_content_buttonhandler(this, fields)
this.data.content.path ~= core.get_gamepath() and
this.data.content.path ~= core.get_texturepath() then
if not core.delete_dir(this.data.content.path) then
gamedata.errormessage = fgettext("pkgmgr: failed to delete \"$1\"", this.data.content.path)
gamedata.errormessage = fgettext_ne("pkgmgr: failed to delete \"$1\"", this.data.content.path)
end
if this.data.content.type == "game" then
@@ -43,7 +43,7 @@ local function delete_content_buttonhandler(this, fields)
pkgmgr.refresh_globals()
end
else
gamedata.errormessage = fgettext("pkgmgr: invalid path \"$1\"", this.data.content.path)
gamedata.errormessage = fgettext_ne("pkgmgr: invalid path \"$1\"", this.data.content.path)
end
this:delete()
return true

View File

@@ -0,0 +1,115 @@
--Minetest
--Copyright (C) 2023 Gregor Parzefall
--
--This program is free software; you can redistribute it and/or modify
--it under the terms of the GNU Lesser General Public License as published by
--the Free Software Foundation; either version 2.1 of the License, or
--(at your option) any later version.
--
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--GNU Lesser General Public License for more details.
--
--You should have received a copy of the GNU Lesser General Public License along
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
function check_reinstall_mtg()
if core.settings:get_bool("no_mtg_notification") then
return
end
local games = core.get_games()
for _, game in ipairs(games) do
if game.id == "minetest" then
core.settings:set_bool("no_mtg_notification", true)
return
end
end
local mtg_world_found = false
local worlds = core.get_worlds()
for _, world in ipairs(worlds) do
if world.gameid == "minetest" then
mtg_world_found = true
break
end
end
if not mtg_world_found then
core.settings:set_bool("no_mtg_notification", true)
return
end
local maintab = ui.find_by_name("maintab")
local dlg = create_reinstall_mtg_dlg()
dlg:set_parent(maintab)
maintab:hide()
dlg:show()
ui.update()
end
local function get_formspec(dialogdata)
local markup = table.concat({
"<big>", fgettext("Minetest Game is no longer installed by default"), "</big>\n",
fgettext("For a long time, the Minetest engine shipped with a default game called \"Minetest Game\". " ..
"Since Minetest 5.8.0, Minetest ships without a default game."), "\n",
fgettext("If you want to continue playing in your Minetest Game worlds, you need to reinstall Minetest Game."),
})
return table.concat({
"formspec_version[6]",
"size[12.8,7]",
"hypertext[0.375,0.375;12.05,5.2;text;", minetest.formspec_escape(markup), "]",
"container[0.375,5.825]",
"style[dismiss;bgcolor=red]",
"button[0,0;4,0.8;dismiss;", fgettext("Dismiss"), "]",
"button[4.25,0;8,0.8;reinstall;", fgettext("Reinstall Minetest Game"), "]",
"container_end[]",
})
end
local function buttonhandler(this, fields)
if fields.reinstall then
-- Don't set "no_mtg_notification" here so that the dialog will be shown
-- again if downloading MTG fails for whatever reason.
this:delete()
local maintab = ui.find_by_name("maintab")
local dlg = create_store_dlg(nil, "minetest/minetest")
dlg:set_parent(maintab)
maintab:hide()
dlg:show()
return true
end
if fields.dismiss then
core.settings:set_bool("no_mtg_notification", true)
this:delete()
return true
end
end
local function eventhandler(event)
if event == "DialogShow" then
mm_game_theme.set_engine()
return true
elseif event == "MenuQuit" then
-- Don't allow closing the dialog with ESC, but still allow exiting
-- Minetest.
core.close()
return true
end
return false
end
function create_reinstall_mtg_dlg()
local dlg = dialog_create("dlg_reinstall_mtg", get_formspec,
buttonhandler, eventhandler)
return dlg
end

File diff suppressed because it is too large Load Diff

View File

@@ -36,9 +36,8 @@ local function version_info_formspec(data)
"formspec_version[3]",
"size[12.8,7]",
"style_type[label;textcolor=#0E0]",
"label[0.5,0.8;", core.formspec_escape(title), "]",
"textarea[0.4,1.6;12,3.4;;;",
core.formspec_escape(message), "]",
"label[0.5,0.8;", title, "]",
"textarea[0.4,1.6;12,3.4;;;", message, "]",
"container[0.4,5.8]",
"button[0.0,0;4.0,0.8;version_check_visit;", fgettext("Visit website"), "]",
"button[4.5,0;3.5,0.8;version_check_remind;", fgettext("Later"), "]",
@@ -72,6 +71,15 @@ local function version_info_buttonhandler(this, fields)
return false
end
local function version_info_eventhandler(event)
if event == "DialogShow" then
mm_game_theme.set_engine()
return true
end
return false
end
local function create_version_info_dlg(new_version, url)
assert(type(new_version) == "string")
assert(type(url) == "string")
@@ -79,7 +87,7 @@ local function create_version_info_dlg(new_version, url)
local retval = dialog_create("version_info",
version_info_formspec,
version_info_buttonhandler,
nil)
version_info_eventhandler)
retval.data.new_version = new_version
retval.data.url = url

View File

@@ -20,10 +20,6 @@ mm_game_theme = {}
--------------------------------------------------------------------------------
function mm_game_theme.init()
mm_game_theme.defaulttexturedir = core.get_texturepath_share() .. DIR_DELIM .. "base" ..
DIR_DELIM .. "pack" .. DIR_DELIM
mm_game_theme.basetexturedir = mm_game_theme.defaulttexturedir
mm_game_theme.texturepack = core.settings:get("texture_path")
mm_game_theme.gameid = nil
@@ -32,35 +28,27 @@ function mm_game_theme.init()
end
--------------------------------------------------------------------------------
function mm_game_theme.update(tab,gamedetails)
if tab ~= "singleplayer" then
mm_game_theme.reset()
return
end
if gamedetails == nil then
return
end
mm_game_theme.update_game(gamedetails)
end
--------------------------------------------------------------------------------
function mm_game_theme.reset()
function mm_game_theme.set_engine(hide_decorations)
mm_game_theme.gameid = nil
mm_game_theme.stop_music()
core.set_topleft_text("")
local have_bg = false
local have_overlay = mm_game_theme.set_generic("overlay")
local have_overlay = mm_game_theme.set_engine_single("overlay")
if not have_overlay then
have_bg = mm_game_theme.set_generic("background")
have_bg = mm_game_theme.set_engine_single("background")
end
mm_game_theme.clear("header")
mm_game_theme.clear("footer")
mm_game_theme.clear_single("header")
mm_game_theme.clear_single("footer")
core.set_clouds(false)
mm_game_theme.set_generic("footer")
mm_game_theme.set_generic("header")
if not hide_decorations then
mm_game_theme.set_engine_single("header")
mm_game_theme.set_engine_single("footer")
end
if not have_bg then
if core.settings:get_bool("menu_clouds") then
@@ -69,51 +57,50 @@ function mm_game_theme.reset()
mm_game_theme.set_dirt_bg()
end
end
if mm_game_theme.music_handle ~= nil then
core.sound_stop(mm_game_theme.music_handle)
end
end
--------------------------------------------------------------------------------
function mm_game_theme.update_game(gamedetails)
function mm_game_theme.set_game(gamedetails)
assert(gamedetails ~= nil)
if mm_game_theme.gameid == gamedetails.id then
return
end
mm_game_theme.gameid = gamedetails.id
mm_game_theme.set_music(gamedetails)
core.set_topleft_text(gamedetails.name)
local have_bg = false
local have_overlay = mm_game_theme.set_game("overlay",gamedetails)
local have_overlay = mm_game_theme.set_game_single("overlay", gamedetails)
if not have_overlay then
have_bg = mm_game_theme.set_game("background",gamedetails)
have_bg = mm_game_theme.set_game_single("background", gamedetails)
end
mm_game_theme.clear("header")
mm_game_theme.clear("footer")
mm_game_theme.clear_single("header")
mm_game_theme.clear_single("footer")
core.set_clouds(false)
if not have_bg then
mm_game_theme.set_game_single("header", gamedetails)
mm_game_theme.set_game_single("footer", gamedetails)
if not have_bg then
if core.settings:get_bool("menu_clouds") then
core.set_clouds(true)
else
mm_game_theme.set_dirt_bg()
end
end
mm_game_theme.set_game("footer",gamedetails)
mm_game_theme.set_game("header",gamedetails)
mm_game_theme.gameid = gamedetails.id
end
--------------------------------------------------------------------------------
function mm_game_theme.clear(identifier)
function mm_game_theme.clear_single(identifier)
core.set_background(identifier,"")
end
--------------------------------------------------------------------------------
function mm_game_theme.set_generic(identifier)
function mm_game_theme.set_engine_single(identifier)
--try texture pack first
if mm_game_theme.texturepack ~= nil then
local path = mm_game_theme.texturepack .. DIR_DELIM .."menu_" ..
@@ -123,25 +110,17 @@ function mm_game_theme.set_generic(identifier)
end
end
if mm_game_theme.defaulttexturedir ~= nil then
local path = mm_game_theme.defaulttexturedir .. DIR_DELIM .."menu_" ..
identifier .. ".png"
if core.set_background(identifier,path) then
return true
end
local path = defaulttexturedir .. DIR_DELIM .. "menu_" .. identifier .. ".png"
if core.set_background(identifier, path) then
return true
end
return false
end
--------------------------------------------------------------------------------
function mm_game_theme.set_game(identifier, gamedetails)
if gamedetails == nil then
return false
end
mm_game_theme.set_music(gamedetails)
function mm_game_theme.set_game_single(identifier, gamedetails)
assert(gamedetails ~= nil)
if mm_game_theme.texturepack ~= nil then
local path = mm_game_theme.texturepack .. DIR_DELIM ..
@@ -194,10 +173,18 @@ function mm_game_theme.set_dirt_bg()
end
--------------------------------------------------------------------------------
function mm_game_theme.set_music(gamedetails)
function mm_game_theme.stop_music()
if mm_game_theme.music_handle ~= nil then
core.sound_stop(mm_game_theme.music_handle)
end
end
--------------------------------------------------------------------------------
function mm_game_theme.set_music(gamedetails)
mm_game_theme.stop_music()
assert(gamedetails ~= nil)
local music_path = gamedetails.path .. DIR_DELIM .. "menu" .. DIR_DELIM .. "theme"
mm_game_theme.music_handle = core.sound_play(music_path, true)
end

View File

@@ -28,6 +28,8 @@ local basepath = core.get_builtin_path()
defaulttexturedir = core.get_texturepath_share() .. DIR_DELIM .. "base" ..
DIR_DELIM .. "pack" .. DIR_DELIM
dofile(menupath .. DIR_DELIM .. "misc.lua")
dofile(basepath .. "common" .. DIR_DELIM .. "filterlist.lua")
dofile(basepath .. "fstk" .. DIR_DELIM .. "buttonbar.lua")
dofile(basepath .. "fstk" .. DIR_DELIM .. "dialog.lua")
@@ -35,27 +37,26 @@ dofile(basepath .. "fstk" .. DIR_DELIM .. "tabview.lua")
dofile(basepath .. "fstk" .. DIR_DELIM .. "ui.lua")
dofile(menupath .. DIR_DELIM .. "async_event.lua")
dofile(menupath .. DIR_DELIM .. "common.lua")
dofile(menupath .. DIR_DELIM .. "pkgmgr.lua")
dofile(menupath .. DIR_DELIM .. "serverlistmgr.lua")
dofile(menupath .. DIR_DELIM .. "game_theme.lua")
dofile(menupath .. DIR_DELIM .. "content" .. DIR_DELIM .. "init.lua")
dofile(menupath .. DIR_DELIM .. "dlg_config_world.lua")
dofile(menupath .. DIR_DELIM .. "dlg_settings_advanced.lua")
dofile(menupath .. DIR_DELIM .. "dlg_contentstore.lua")
dofile(menupath .. DIR_DELIM .. "settings" .. DIR_DELIM .. "init.lua")
dofile(menupath .. DIR_DELIM .. "dlg_create_world.lua")
dofile(menupath .. DIR_DELIM .. "dlg_delete_content.lua")
dofile(menupath .. DIR_DELIM .. "dlg_delete_world.lua")
dofile(menupath .. DIR_DELIM .. "dlg_register.lua")
dofile(menupath .. DIR_DELIM .. "dlg_rename_modpack.lua")
dofile(menupath .. DIR_DELIM .. "dlg_version_info.lua")
dofile(menupath .. DIR_DELIM .. "dlg_reinstall_mtg.lua")
local tabs = {}
tabs.settings = dofile(menupath .. DIR_DELIM .. "tab_settings.lua")
tabs.content = dofile(menupath .. DIR_DELIM .. "tab_content.lua")
tabs.about = dofile(menupath .. DIR_DELIM .. "tab_about.lua")
tabs.local_game = dofile(menupath .. DIR_DELIM .. "tab_local.lua")
tabs.play_online = dofile(menupath .. DIR_DELIM .. "tab_online.lua")
local tabs = {
content = dofile(menupath .. DIR_DELIM .. "tab_content.lua"),
about = dofile(menupath .. DIR_DELIM .. "tab_about.lua"),
local_game = dofile(menupath .. DIR_DELIM .. "tab_local.lua"),
play_online = dofile(menupath .. DIR_DELIM .. "tab_online.lua")
}
--------------------------------------------------------------------------------
local function main_event_handler(tabview, event)
@@ -86,23 +87,16 @@ local function init_globals()
menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic)
menudata.worldlist:set_sortmode("alphabetic")
if not core.settings:get("menu_last_game") then
local default_game = core.settings:get("default_game") or "minetest"
core.settings:set("menu_last_game", default_game)
end
mm_game_theme.init()
mm_game_theme.set_engine() -- This is just a fallback.
-- Create main tabview
local tv_main = tabview_create("maintab", {x = 12, y = 5.4}, {x = 0, y = 0})
-- note: size would be 15.5,7.1 in real coordinates mode
local tv_main = tabview_create("maintab", {x = 15.5, y = 7.1}, {x = 0, y = 0})
tv_main:set_autosave_tab(true)
tv_main:add(tabs.local_game)
tv_main:add(tabs.play_online)
tv_main:add(tabs.content)
tv_main:add(tabs.settings)
tv_main:add(tabs.about)
tv_main:set_global_event_handler(main_event_handler)
@@ -113,19 +107,25 @@ local function init_globals()
tv_main:set_tab(last_tab)
end
-- In case the folder of the last selected game has been deleted,
-- display "Minetest" as a header
if tv_main.current_tab == "local" then
local game = pkgmgr.find_by_gameid(core.settings:get("menu_last_game"))
if game == nil then
mm_game_theme.reset()
end
end
tv_main:set_end_button({
icon = defaulttexturedir .. "settings_btn.png",
label = fgettext("Settings"),
name = "open_settings",
on_click = function(tabview)
local dlg = create_settings_dlg()
dlg:set_parent(tabview)
tabview:hide()
dlg:show()
return true
end,
})
ui.set_default("maintab")
check_new_version()
tv_main:show()
ui.update()
check_reinstall_mtg()
check_new_version()
end
init_globals()

View File

@@ -0,0 +1,6 @@
-- old non-method sound function
function core.sound_stop(handle, ...)
return handle:stop(...)
end

View File

@@ -15,28 +15,101 @@
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
serverlistmgr = {}
serverlistmgr = {
-- continent code we detected for ourselves
my_continent = core.get_once("continent"),
-- list of locally favorites servers
favorites = nil,
-- list of servers fetched from public list
servers = nil,
}
--------------------------------------------------------------------------------
-- Efficient data structure for normalizing arbitrary scores attached to objects
-- e.g. {{"a", 3.14}, {"b", 3.14}, {"c", 20}, {"d", 0}}
-- -> {["d"] = 0, ["a"] = 0.5, ["b"] = 0.5, ["c"] = 1}
local Normalizer = {}
function Normalizer:new()
local t = {
map = {}
}
setmetatable(t, self)
self.__index = self
return t
end
function Normalizer:push(obj, score)
if not self.map[score] then
self.map[score] = {}
end
local t = self.map[score]
t[#t + 1] = obj
end
function Normalizer:calc()
local list = {}
for k, _ in pairs(self.map) do
list[#list + 1] = k
end
table.sort(list)
local ret = {}
for i, k in ipairs(list) do
local score = #list == 1 and 1 or ( (i - 1) / (#list - 1) )
for _, obj in ipairs(self.map[k]) do
ret[obj] = score
end
end
return ret
end
--------------------------------------------------------------------------------
-- how much the pre-sorted server list contributes to the final ranking
local WEIGHT_SORT = 2
-- how much the estimated latency contributes to the final ranking
local WEIGHT_LATENCY = 1
local function order_server_list(list)
local res = {}
--orders the favorite list after support
-- calculate the scores
local s1 = Normalizer:new()
local s2 = Normalizer:new()
for i, fav in ipairs(list) do
-- first: the original position
s1:push(fav, #list - i)
-- second: estimated latency
local ping = (fav.ping or 0) * 1000
if ping < 400 then
-- If ping is under 400ms replace it with our own estimate,
-- we assume the server has latency issues anyway otherwise
ping = estimate_continent_latency(serverlistmgr.my_continent, fav) or 0
end
s2:push(fav, -ping)
end
s1 = s1:calc()
s2 = s2:calc()
-- make a shallow copy and pre-calculate ordering
local res, order = {}, {}
for i = 1, #list do
local fav = list[i]
if is_server_protocol_compat(fav.proto_min, fav.proto_max) then
res[#res + 1] = fav
end
end
for i = 1, #list do
local fav = list[i]
if not is_server_protocol_compat(fav.proto_min, fav.proto_max) then
res[#res + 1] = fav
end
res[i] = fav
local n = s1[fav] * WEIGHT_SORT + s2[fav] * WEIGHT_LATENCY
order[fav] = n
end
-- now sort the list
table.sort(res, function(fav1, fav2)
return order[fav1] > order[fav2]
end)
return res
end
local public_downloading = false
local geoip_downloading = false
--------------------------------------------------------------------------------
function serverlistmgr.sync()
@@ -56,6 +129,39 @@ function serverlistmgr.sync()
return
end
-- only fetched once per MT instance
if not serverlistmgr.my_continent and not geoip_downloading then
geoip_downloading = true
core.handle_async(
function(param)
local http = core.get_http_api()
local url = core.settings:get("serverlist_url") .. "/geoip"
local response = http.fetch_sync({ url = url })
if not response.succeeded then
return
end
local retval = core.parse_json(response.data)
return retval and type(retval.continent) == "string" and retval.continent
end,
nil,
function(result)
geoip_downloading = false
if not result then
return
end
serverlistmgr.my_continent = result
core.set_once("continent", result)
-- reorder list if we already have it
if serverlistmgr.servers then
serverlistmgr.servers = order_server_list(serverlistmgr.servers)
core.event_handler("Refresh")
end
end
)
end
if public_downloading then
return
end
@@ -79,7 +185,7 @@ function serverlistmgr.sync()
end,
nil,
function(result)
public_downloading = nil
public_downloading = false
local favs = order_server_list(result)
if favs[1] then
serverlistmgr.servers = favs

View File

@@ -0,0 +1,407 @@
--Minetest
--Copyright (C) 2022 rubenwardy
--
--This program is free software; you can redistribute it and/or modify
--it under the terms of the GNU Lesser General Public License as published by
--the Free Software Foundation; either version 2.1 of the License, or
--(at your option) any later version.
--
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--GNU Lesser General Public License for more details.
--
--You should have received a copy of the GNU Lesser General Public License along
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
local make = {}
-- This file defines various component constructors, of the form:
--
-- make.component(setting)
--
-- `setting` is a table representing the settingtype.
--
-- A component is a table with the following:
--
-- * `full_width`: (Optional) true if the component shouldn't reserve space for info / reset.
-- * `info_text`: (Optional) string, informational text shown in an info icon.
-- * `setting`: (Optional) the setting.
-- * `max_w`: (Optional) maximum width, `avail_w` will never exceed this.
-- * `resettable`: (Optional) if this is true, a reset button is shown.
-- * `get_formspec = function(self, avail_w)`:
-- * `avail_w` is the available width for the component.
-- * Returns `fs, used_height`.
-- * `fs` is a string for the formspec.
-- Components should be relative to `0,0`, and not exceed `avail_w` or the returned `used_height`.
-- * `used_height` is the space used by components in `fs`.
-- * `on_submit = function(self, fields, parent)`:
-- * `fields`: submitted formspec fields
-- * `parent`: the fstk element for the settings UI, use to show dialogs
-- * Return true if the event was handled, to prevent future components receiving it.
local function get_label(setting)
local show_technical_names = core.settings:get_bool("show_technical_names")
if not show_technical_names and setting.readable_name then
return fgettext(setting.readable_name)
end
return setting.name
end
local function is_valid_number(value)
return type(value) == "number" and not (value ~= value or value >= math.huge or value <= -math.huge)
end
function make.heading(text)
return {
full_width = true,
get_formspec = function(self, avail_w)
return ("label[0,0.6;%s]box[0,0.9;%f,0.05;#ccc6]"):format(core.formspec_escape(text), avail_w), 1.2
end,
}
end
--- Used for string and numeric style fields
---
--- @param converter Function to coerce values from strings.
--- @param validator Validator function, optional. Returns true when valid.
--- @param stringifier Function to convert values to strings, optional.
local function make_field(converter, validator, stringifier)
return function(setting)
return {
info_text = setting.comment,
setting = setting,
get_formspec = function(self, avail_w)
local value = core.settings:get(setting.name) or setting.default
self.resettable = core.settings:has(setting.name)
local fs = ("field[0,0.3;%f,0.8;%s;%s;%s]"):format(
avail_w - 1.5, setting.name, get_label(setting), core.formspec_escape(value))
fs = fs .. ("field_enter_after_edit[%s;true]"):format(setting.name)
fs = fs .. ("button[%f,0.3;1.5,0.8;%s;%s]"):format(avail_w - 1.5, "set_" .. setting.name, fgettext("Set"))
return fs, 1.1
end,
on_submit = function(self, fields)
if fields["set_" .. setting.name] or fields.key_enter_field == setting.name then
local value = converter(fields[setting.name])
if value == nil or (validator and not validator(value)) then
return true
end
if setting.min then
value = math.max(value, setting.min)
end
if setting.max then
value = math.min(value, setting.max)
end
core.settings:set(setting.name, (stringifier or tostring)(value))
return true
end
end,
}
end
end
make.float = make_field(tonumber, is_valid_number, function(x)
local str = tostring(x)
if str:match("^[+-]?%d+$") then
str = str .. ".0"
end
return str
end)
make.int = make_field(function(x)
local value = tonumber(x)
return value and math.floor(value)
end, is_valid_number)
make.string = make_field(tostring, nil)
function make.bool(setting)
return {
info_text = setting.comment,
setting = setting,
get_formspec = function(self, avail_w)
local value = core.settings:get_bool(setting.name, core.is_yes(setting.default))
self.resettable = core.settings:has(setting.name)
local fs = ("checkbox[0,0.25;%s;%s;%s]"):format(
setting.name, get_label(setting), tostring(value))
return fs, 0.5
end,
on_submit = function(self, fields)
if fields[setting.name] == nil then
return false
end
core.settings:set_bool(setting.name, core.is_yes(fields[setting.name]))
return true
end,
}
end
function make.enum(setting)
return {
info_text = setting.comment,
setting = setting,
max_w = 4.5,
get_formspec = function(self, avail_w)
local value = core.settings:get(setting.name) or setting.default
self.resettable = core.settings:has(setting.name)
local labels = setting.option_labels or {}
local items = {}
for i, option in ipairs(setting.values) do
items[i] = core.formspec_escape(labels[option] or option)
end
local selected_idx = table.indexof(setting.values, value)
local fs = "label[0,0.1;" .. get_label(setting) .. "]"
fs = fs .. ("dropdown[0,0.3;%f,0.8;%s;%s;%d;true]"):format(
avail_w, setting.name, table.concat(items, ","), selected_idx, value)
return fs, 1.1
end,
on_submit = function(self, fields)
local old_value = core.settings:get(setting.name) or setting.default
local idx = tonumber(fields[setting.name]) or 0
local value = setting.values[idx]
if value == nil or value == old_value then
return false
end
core.settings:set(setting.name, value)
return true
end,
}
end
local function make_path(setting)
return {
info_text = setting.comment,
setting = setting,
get_formspec = function(self, avail_w)
local value = core.settings:get(setting.name) or setting.default
self.resettable = core.settings:has(setting.name)
local fs = ("field[0,0.3;%f,0.8;%s;%s;%s]"):format(
avail_w - 3, setting.name, get_label(setting), core.formspec_escape(value))
fs = fs .. ("button[%f,0.3;1.5,0.8;%s;%s]"):format(avail_w - 3, "pick_" .. setting.name, fgettext("Browse"))
fs = fs .. ("button[%f,0.3;1.5,0.8;%s;%s]"):format(avail_w - 1.5, "set_" .. setting.name, fgettext("Set"))
return fs, 1.1
end,
on_submit = function(self, fields)
local dialog_name = "dlg_path_" .. setting.name
if fields["pick_" .. setting.name] then
local is_file = setting.type ~= "path"
core.show_path_select_dialog(dialog_name,
is_file and fgettext_ne("Select file") or fgettext_ne("Select directory"), is_file)
return true
end
if fields[dialog_name .. "_accepted"] then
local value = fields[dialog_name .. "_accepted"]
if value ~= nil then
core.settings:set(setting.name, value)
end
return true
end
if fields["set_" .. setting.name] or fields.key_enter_field == setting.name then
local value = fields[setting.name]
if value ~= nil then
core.settings:set(setting.name, value)
end
return true
end
end,
}
end
if PLATFORM == "Android" then
-- The Irrlicht file picker doesn't work on Android.
make.path = make.string
make.filepath = make.string
else
make.path = make_path
make.filepath = make_path
end
function make.v3f(setting)
return {
info_text = setting.comment,
setting = setting,
get_formspec = function(self, avail_w)
local value = vector.from_string(core.settings:get(setting.name) or setting.default)
self.resettable = core.settings:has(setting.name)
-- Allocate space for "Set" button
avail_w = avail_w - 1
local fs = "label[0,0.1;" .. get_label(setting) .. "]"
local field_width = (avail_w - 3*0.25) / 3
fs = fs .. ("field[%f,0.6;%f,0.8;%s;%s;%s]"):format(
0, field_width, setting.name .. "_x", "X", value.x)
fs = fs .. ("field[%f,0.6;%f,0.8;%s;%s;%s]"):format(
field_width + 0.25, field_width, setting.name .. "_y", "Y", value.y)
fs = fs .. ("field[%f,0.6;%f,0.8;%s;%s;%s]"):format(
2 * (field_width + 0.25), field_width, setting.name .. "_z", "Z", value.z)
fs = fs .. ("button[%f,0.6;1,0.8;%s;%s]"):format(avail_w, "set_" .. setting.name, fgettext("Set"))
return fs, 1.4
end,
on_submit = function(self, fields)
if fields["set_" .. setting.name] or
fields.key_enter_field == setting.name .. "_x" or
fields.key_enter_field == setting.name .. "_y" or
fields.key_enter_field == setting.name .. "_z" then
local x = tonumber(fields[setting.name .. "_x"])
local y = tonumber(fields[setting.name .. "_y"])
local z = tonumber(fields[setting.name .. "_z"])
if is_valid_number(x) and is_valid_number(y) and is_valid_number(z) then
core.settings:set(setting.name, vector.new(x, y, z):to_string())
else
core.log("error", "Invalid vector: " .. dump({x, y, z}))
end
return true
end
end,
}
end
function make.flags(setting)
local checkboxes = {}
return {
info_text = setting.comment,
setting = setting,
get_formspec = function(self, avail_w)
local fs = {
"label[0,0.1;" .. get_label(setting) .. "]",
}
local value = core.settings:get(setting.name) or setting.default
self.resettable = core.settings:has(setting.name)
checkboxes = {}
for _, name in ipairs(value:split(",")) do
name = name:trim()
if name:sub(1, 2) == "no" then
checkboxes[name:sub(3)] = false
elseif name ~= "" then
checkboxes[name] = true
end
end
local columns = math.max(math.floor(avail_w / 2.5), 1)
local column_width = avail_w / columns
local x = 0
local y = 0.55
for _, possible in ipairs(setting.possible) do
if possible:sub(1, 2) ~= "no" then
if x >= avail_w then
x = 0
y = y + 0.5
end
local is_checked = checkboxes[possible]
fs[#fs + 1] = ("checkbox[%f,%f;%s;%s;%s]"):format(
x, y, setting.name .. "_" .. possible,
core.formspec_escape(possible), tostring(is_checked))
x = x + column_width
end
end
return table.concat(fs, ""), y + 0.25
end,
on_submit = function(self, fields)
local changed = false
for name, _ in pairs(checkboxes) do
local value = fields[setting.name .. "_" .. name]
if value ~= nil then
checkboxes[name] = core.is_yes(value)
changed = true
end
end
if changed then
local values = {}
for _, name in ipairs(setting.possible) do
if name:sub(1, 2) ~= "no" then
if checkboxes[name] then
table.insert(values, name)
else
table.insert(values, "no" .. name)
end
end
end
core.settings:set(setting.name, table.concat(values, ","))
end
return changed
end
}
end
local function make_noise_params(setting)
return {
info_text = setting.comment,
setting = setting,
get_formspec = function(self, avail_w)
-- The "defaults" noise parameter flag doesn't reset a noise
-- setting to its default value, so we offer a regular reset button.
self.resettable = core.settings:has(setting.name)
local fs = "label[0,0.4;" .. get_label(setting) .. "]" ..
("button[%f,0;2.5,0.8;%s;%s]"):format(avail_w - 2.5, "edit_" .. setting.name, fgettext("Edit"))
return fs, 0.8
end,
on_submit = function(self, fields, tabview)
if fields["edit_" .. setting.name] then
local dlg = create_change_mapgen_flags_dlg(setting)
dlg:set_parent(tabview)
tabview:hide()
dlg:show()
return true
end
end,
}
end
make.noise_params_2d = make_noise_params
make.noise_params_3d = make_noise_params
return make

View File

@@ -0,0 +1,252 @@
--Minetest
--Copyright (C) 2015 PilzAdam
--
--This program is free software; you can redistribute it and/or modify
--it under the terms of the GNU Lesser General Public License as published by
--the Free Software Foundation; either version 2.1 of the License, or
--(at your option) any later version.
--
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--GNU Lesser General Public License for more details.
--
--You should have received a copy of the GNU Lesser General Public License along
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
local checkboxes = {}
local function flags_to_table(flags)
return flags:gsub("%s+", ""):split(",", true) -- Remove all spaces and split
end
local function get_current_np_group(setting)
local value = core.settings:get_np_group(setting.name)
if value == nil then
return setting.values
end
local p = "%g"
return {
p:format(value.offset),
p:format(value.scale),
p:format(value.spread.x),
p:format(value.spread.y),
p:format(value.spread.z),
p:format(value.seed),
p:format(value.octaves),
p:format(value.persistence),
p:format(value.lacunarity),
value.flags
}
end
local function get_formspec(dialogdata)
local setting = dialogdata.setting
-- Final formspec will be created at the end of this function
-- Default values below, may be changed depending on setting type
local width = 10
local height = 2
local description_height = 1.5
local t = get_current_np_group(setting)
local dimension = 3
if setting.type == "noise_params_2d" then
dimension = 2
end
local fields = {}
local function add_field(x, name, label, value)
fields[#fields + 1] = ("field[%f,%f;3.3,1;%s;%s;%s]"):format(
x, height, name, label, core.formspec_escape(value or "")
)
end
-- First row
height = height + 0.3
add_field(0.3, "te_offset", fgettext("Offset"), t[1])
add_field(3.6, "te_scale", fgettext("Scale"), t[2])
add_field(6.9, "te_seed", fgettext("Seed"), t[6])
height = height + 1.1
-- Second row
add_field(0.3, "te_spreadx", fgettext("X spread"), t[3])
if dimension == 3 then
add_field(3.6, "te_spready", fgettext("Y spread"), t[4])
else
fields[#fields + 1] = "label[4," .. height - 0.2 .. ";" ..
fgettext("2D Noise") .. "]"
end
add_field(6.9, "te_spreadz", fgettext("Z spread"), t[5])
height = height + 1.1
-- Third row
add_field(0.3, "te_octaves", fgettext("Octaves"), t[7])
add_field(3.6, "te_persist", fgettext("Persistence"), t[8])
add_field(6.9, "te_lacun", fgettext("Lacunarity"), t[9])
height = height + 1.1
local enabled_flags = flags_to_table(t[10])
local flags = {}
for _, name in ipairs(enabled_flags) do
-- Index by name, to avoid iterating over all enabled_flags for every possible flag.
flags[name] = true
end
for _, name in ipairs(setting.flags) do
local checkbox_name = "cb_" .. name
local is_enabled = flags[name] == true -- to get false if nil
checkboxes[checkbox_name] = is_enabled
end
local formspec = table.concat(fields)
.. "checkbox[0.5," .. height - 0.6 .. ";cb_defaults;"
--[[~ "defaults" is a noise parameter flag.
It describes the default processing options
for noise settings in the settings menu. ]]
.. fgettext("defaults") .. ";" -- defaults
.. tostring(flags["defaults"] == true) .. "]" -- to get false if nil
.. "checkbox[5," .. height - 0.6 .. ";cb_eased;"
--[[~ "eased" is a noise parameter flag.
It is used to make the map smoother and
can be enabled in noise settings in
the settings menu. ]]
.. fgettext("eased") .. ";" -- eased
.. tostring(flags["eased"] == true) .. "]"
.. "checkbox[5," .. height - 0.15 .. ";cb_absvalue;"
--[[~ "absvalue" is a noise parameter flag.
It is short for "absolute value".
It can be enabled in noise settings in
the settings menu. ]]
.. fgettext("absvalue") .. ";" -- absvalue
.. tostring(flags["absvalue"] == true) .. "]"
height = height + 1
-- Box good, textarea bad. Calculate textarea size from box.
local function create_textfield(size, label, text, bg_color)
local textarea = {
x = size.x + 0.3,
y = size.y,
w = size.w + 0.25,
h = size.h * 1.16 + 0.12
}
return ("box[%f,%f;%f,%f;%s]textarea[%f,%f;%f,%f;;%s;%s]"):format(
size.x, size.y, size.w, size.h, bg_color or "#000",
textarea.x, textarea.y, textarea.w, textarea.h,
core.formspec_escape(label), core.formspec_escape(text)
)
end
-- When there's an error: Shrink description textarea and add error below
if dialogdata.error_message then
local error_box = {
x = 0,
y = description_height - 0.4,
w = width - 0.25,
h = 0.5
}
formspec = formspec ..
create_textfield(error_box, "", dialogdata.error_message, "#600")
description_height = description_height - 0.75
end
-- Get description field
local description_box = {
x = 0,
y = 0.2,
w = width - 0.25,
h = description_height
}
local setting_name = setting.name
if setting.readable_name then
setting_name = fgettext_ne(setting.readable_name) ..
" (" .. setting.name .. ")"
end
local comment_text
if setting.comment == "" then
comment_text = fgettext_ne("(No description of setting given)")
else
comment_text = fgettext_ne(setting.comment)
end
return (
"size[" .. width .. "," .. height + 0.25 .. ",true]" ..
create_textfield(description_box, setting_name, comment_text) ..
formspec ..
"button[" .. width / 2 - 2.5 .. "," .. height - 0.4 .. ";2.5,1;btn_done;" ..
fgettext("Save") .. "]" ..
"button[" .. width / 2 .. "," .. height - 0.4 .. ";2.5,1;btn_cancel;" ..
fgettext("Cancel") .. "]"
)
end
local function buttonhandler(this, fields)
local setting = this.data.setting
if fields["btn_done"] or fields["key_enter"] then
local np_flags = {}
for _, name in ipairs(setting.flags) do
if checkboxes["cb_" .. name] then
table.insert(np_flags, name)
end
end
checkboxes = {}
if setting.type == "noise_params_2d" then
fields["te_spready"] = fields["te_spreadz"]
end
local new_value = {
offset = fields["te_offset"],
scale = fields["te_scale"],
spread = {
x = fields["te_spreadx"],
y = fields["te_spready"],
z = fields["te_spreadz"]
},
seed = fields["te_seed"],
octaves = fields["te_octaves"],
persistence = fields["te_persist"],
lacunarity = fields["te_lacun"],
flags = table.concat(np_flags, ", ")
}
core.settings:set_np_group(setting.name, new_value)
core.settings:write()
this:delete()
return true
end
if fields["btn_cancel"] then
this:delete()
return true
end
for name, value in pairs(fields) do
if name:sub(1, 3) == "cb_" then
checkboxes[name] = core.is_yes(value)
return false -- Don't update the formspec!
end
end
return false
end
function create_change_mapgen_flags_dlg(setting)
assert(type(setting) == "table")
local retval = dialog_create("dlg_change_mapgen_flags",
get_formspec,
buttonhandler,
nil)
retval.data.setting = setting
return retval
end

View File

@@ -0,0 +1,725 @@
--Minetest
--Copyright (C) 2022 rubenwardy
--
--This program is free software; you can redistribute it and/or modify
--it under the terms of the GNU Lesser General Public License as published by
--the Free Software Foundation; either version 2.1 of the License, or
--(at your option) any later version.
--
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--GNU Lesser General Public License for more details.
--
--You should have received a copy of the GNU Lesser General Public License along
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
local component_funcs = dofile(core.get_mainmenu_path() .. DIR_DELIM ..
"settings" .. DIR_DELIM .. "components.lua")
local shadows_component = dofile(core.get_mainmenu_path() .. DIR_DELIM ..
"settings" .. DIR_DELIM .. "shadows_component.lua")
local full_settings = settingtypes.parse_config_file(false, true)
local info_icon_path = core.formspec_escape(defaulttexturedir .. "settings_info.png")
local reset_icon_path = core.formspec_escape(defaulttexturedir .. "settings_reset.png")
local all_pages = {}
local page_by_id = {}
local filtered_pages = all_pages
local filtered_page_by_id = page_by_id
local function add_page(page)
assert(type(page.id) == "string")
assert(type(page.title) == "string")
assert(page.section == nil or type(page.section) == "string")
assert(type(page.content) == "table")
assert(not page_by_id[page.id], "Page " .. page.id .. " already registered")
all_pages[#all_pages + 1] = page
page_by_id[page.id] = page
return page
end
local change_keys = {
query_text = "Change Keys",
requires = {
keyboard_mouse = true,
},
get_formspec = function(self, avail_w)
local btn_w = math.min(avail_w, 3)
return ("button[0,0;%f,0.8;btn_change_keys;%s]"):format(btn_w, fgettext("Change Keys")), 0.8
end,
on_submit = function(self, fields)
if fields.btn_change_keys then
core.show_keys_menu()
end
end,
}
add_page({
id = "accessibility",
title = fgettext_ne("Accessibility"),
content = {
"language",
{ heading = fgettext_ne("General") },
"font_size",
"chat_font_size",
"gui_scaling",
"hud_scaling",
"show_nametag_backgrounds",
{ heading = fgettext_ne("Chat") },
"console_height",
"console_alpha",
"console_color",
{ heading = fgettext_ne("Controls") },
"autojump",
"safe_dig_and_place",
{ heading = fgettext_ne("Movement") },
"arm_inertia",
"view_bobbing_amount",
"fall_bobbing_amount",
},
})
local function load_settingtypes()
local page = nil
local section = nil
local function ensure_page_started()
if not page then
page = add_page({
id = (section or "general"):lower():gsub(" ", "_"),
title = section or fgettext_ne("General"),
section = section,
content = {},
})
end
end
for _, entry in ipairs(full_settings) do
if entry.type == "category" then
if entry.level == 0 then
section = entry.name
page = nil
elseif entry.level == 1 then
page = {
id = ((section and section .. "_" or "") .. entry.name):lower():gsub(" ", "_"),
title = entry.readable_name or entry.name,
section = section,
content = {},
}
page = add_page(page)
elseif entry.level == 2 then
ensure_page_started()
page.content[#page.content + 1] = {
heading = fgettext_ne(entry.readable_name or entry.name),
}
end
else
ensure_page_started()
page.content[#page.content + 1] = entry.name
end
end
end
load_settingtypes()
table.insert(page_by_id.controls_keyboard_and_mouse.content, 1, change_keys)
do
local content = page_by_id.graphics_and_audio_shaders.content
local idx = table.indexof(content, "enable_dynamic_shadows")
table.insert(content, idx, shadows_component)
end
local function get_setting_info(name)
for _, entry in ipairs(full_settings) do
if entry.type ~= "category" and entry.name == name then
return entry
end
end
return nil
end
-- These must not be translated, as they need to show in the local
-- language no matter the user's current language.
-- This list must be kept in sync with src/unsupported_language_list.txt.
get_setting_info("language").option_labels = {
[""] = fgettext_ne("(Use system language)"),
--ar = " [ar]", blacklisted
be = "Беларуская [be]",
bg = "Български [bg]",
ca = "Català [ca]",
cs = "Česky [cs]",
cy = "Cymraeg [cy]",
da = "Dansk [da]",
de = "Deutsch [de]",
--dv = " [dv]", blacklisted
el = "Ελληνικά [el]",
en = "English [en]",
eo = "Esperanto [eo]",
es = "Español [es]",
et = "Eesti [et]",
eu = "Euskara [eu]",
fi = "Suomi [fi]",
fil = "Wikang Filipino [fil]",
fr = "Français [fr]",
gd = "Gàidhlig [gd]",
gl = "Galego [gl]",
--he = " [he]", blacklisted
--hi = " [hi]", blacklisted
hu = "Magyar [hu]",
id = "Bahasa Indonesia [id]",
it = "Italiano [it]",
ja = "日本語 [ja]",
jbo = "Lojban [jbo]",
kk = "Қазақша [kk]",
--kn = " [kn]", blacklisted
ko = "한국어 [ko]",
ky = "Kırgızca / Кыргызча [ky]",
lt = "Lietuvių [lt]",
lv = "Latviešu [lv]",
mn = "Монгол [mn]",
mr = "मराठी [mr]",
ms = "Bahasa Melayu [ms]",
--ms_Arab = " [ms_Arab]", blacklisted
nb = "Norsk Bokmål [nb]",
nl = "Nederlands [nl]",
nn = "Norsk Nynorsk [nn]",
oc = "Occitan [oc]",
pl = "Polski [pl]",
pt = "Português [pt]",
pt_BR = "Português do Brasil [pt_BR]",
ro = "Română [ro]",
ru = "Русский [ru]",
sk = "Slovenčina [sk]",
sl = "Slovenščina [sl]",
sr_Cyrl = "Српски [sr_Cyrl]",
sr_Latn = "Srpski (Latinica) [sr_Latn]",
sv = "Svenska [sv]",
sw = "Kiswahili [sw]",
--th = " [th]", blacklisted
tr = "Türkçe [tr]",
tt = "Tatarça [tt]",
uk = "Українська [uk]",
vi = "Tiếng Việt [vi]",
zh_CN = "中文 (简体) [zh_CN]",
zh_TW = "正體中文 (繁體) [zh_TW]",
}
-- See if setting matches keywords
local function get_setting_match_weight(entry, query_keywords)
local setting_score = 0
for _, keyword in ipairs(query_keywords) do
if string.find(entry.name:lower(), keyword, 1, true) then
setting_score = setting_score + 1
end
if entry.readable_name and
string.find(fgettext(entry.readable_name):lower(), keyword, 1, true) then
setting_score = setting_score + 1
end
if entry.comment and
string.find(fgettext_ne(entry.comment):lower(), keyword, 1, true) then
setting_score = setting_score + 1
end
end
return setting_score
end
local function filter_page_content(page, query_keywords)
if #query_keywords == 0 then
return page.content, 0
end
local retval = {}
local i = 1
local max_weight = 0
for _, content in ipairs(page.content) do
if type(content) == "string" then
local setting = get_setting_info(content)
assert(setting, "Unknown setting: " .. content)
local weight = get_setting_match_weight(setting, query_keywords)
if weight > 0 then
max_weight = math.max(max_weight, weight)
retval[i] = content
i = i + 1
end
elseif type(content) == "table" and content.query_text then
for _, keyword in ipairs(query_keywords) do
if string.find(fgettext(content.query_text), keyword, 1, true) then
max_weight = math.max(max_weight, 1)
retval[i] = content
i = i + 1
break
end
end
end
end
return retval, max_weight
end
local function update_filtered_pages(query)
filtered_pages = {}
filtered_page_by_id = {}
local query_keywords = {}
for word in query:lower():gmatch("%S+") do
table.insert(query_keywords, word)
end
local best_page = nil
local best_page_weight = -1
for _, page in ipairs(all_pages) do
local content, page_weight = filter_page_content(page, query_keywords)
if page_has_contents(page, content) then
local new_page = table.copy(page)
new_page.content = content
filtered_pages[#filtered_pages + 1] = new_page
filtered_page_by_id[new_page.id] = new_page
if page_weight > best_page_weight then
best_page = new_page
best_page_weight = page_weight
end
end
end
return best_page and best_page.id or nil
end
local function check_requirements(name, requires)
if requires == nil then
return true
end
local video_driver = core.get_active_driver()
local shaders_support = video_driver == "opengl" or video_driver == "ogles2"
local special = {
android = PLATFORM == "Android",
desktop = PLATFORM ~= "Android",
touchscreen_gui = TOUCHSCREEN_GUI,
keyboard_mouse = not TOUCHSCREEN_GUI,
shaders_support = shaders_support,
shaders = core.settings:get_bool("enable_shaders") and shaders_support,
opengl = video_driver == "opengl",
gles = video_driver:sub(1, 5) == "ogles",
}
for req_key, req_value in pairs(requires) do
if special[req_key] == nil then
local required_setting = get_setting_info(req_key)
if required_setting == nil then
core.log("warning", "Unknown setting " .. req_key .. " required by " .. name)
end
local actual_value = core.settings:get_bool(req_key,
required_setting and core.is_yes(required_setting.default))
if actual_value ~= req_value then
return false
end
elseif special[req_key] ~= req_value then
return false
end
end
return true
end
function page_has_contents(page, actual_content)
local is_advanced =
page.id:sub(1, #"client_and_server") == "client_and_server" or
page.id:sub(1, #"mapgen") == "mapgen" or
page.id:sub(1, #"advanced") == "advanced"
local show_advanced = core.settings:get_bool("show_advanced")
if is_advanced and not show_advanced then
return false
end
for _, item in ipairs(actual_content) do
if item == false or item.heading then --luacheck: ignore
-- skip
elseif type(item) == "string" then
local setting = get_setting_info(item)
assert(setting, "Unknown setting: " .. item)
if check_requirements(setting.name, setting.requires) then
return true
end
elseif item.get_formspec then
if check_requirements(item.id, item.requires) then
return true
end
else
error("Unknown content in page: " .. dump(item))
end
end
return false
end
local function build_page_components(page)
-- Filter settings based on requirements
local content = {}
local last_heading
for _, item in ipairs(page.content) do
if item == false then --luacheck: ignore
-- skip
elseif item.heading then
last_heading = item
else
local name, requires
if type(item) == "string" then
local setting = get_setting_info(item)
assert(setting, "Unknown setting: " .. item)
name = setting.name
requires = setting.requires
elseif item.get_formspec then
name = item.id
requires = item.requires
else
error("Unknown content in page: " .. dump(item))
end
if check_requirements(name, requires) then
if last_heading then
content[#content + 1] = last_heading
last_heading = nil
end
content[#content + 1] = item
end
end
end
-- Create components
local retval = {}
for i, item in ipairs(content) do
if type(item) == "string" then
local setting = get_setting_info(item)
local component_func = component_funcs[setting.type]
assert(component_func, "Unknown setting type: " .. setting.type)
retval[i] = component_func(setting)
elseif item.get_formspec then
retval[i] = item
elseif item.heading then
retval[i] = component_funcs.heading(item.heading)
end
end
return retval
end
--- Creates a scrollbaroptions for a scroll_container
--
-- @param visible_l the length of the scroll_container and scrollbar
-- @param total_l length of the scrollable area
-- @param scroll_factor as passed to scroll_container
local function make_scrollbaroptions_for_scroll_container(visible_l, total_l, scroll_factor)
assert(total_l >= visible_l)
local max = total_l - visible_l
local thumb_size = (visible_l / total_l) * max
return ("scrollbaroptions[min=0;max=%f;thumbsize=%f]"):format(max / scroll_factor, thumb_size / scroll_factor)
end
local formspec_show_hack = false
local function get_formspec(dialogdata)
local page_id = dialogdata.page_id or "accessibility"
local page = filtered_page_by_id[page_id]
local extra_h = 1 -- not included in tabsize.height
local tabsize = {
width = TOUCHSCREEN_GUI and 16.5 or 15.5,
height = TOUCHSCREEN_GUI and (10 - extra_h) or 12,
}
local scrollbar_w = TOUCHSCREEN_GUI and 0.6 or 0.4
local left_pane_width = TOUCHSCREEN_GUI and 4.5 or 4.25
local search_width = left_pane_width + scrollbar_w - (0.75 * 2)
local back_w = 3
local checkbox_w = (tabsize.width - back_w - 2*0.2) / 2
local show_technical_names = core.settings:get_bool("show_technical_names")
local show_advanced = core.settings:get_bool("show_advanced")
formspec_show_hack = not formspec_show_hack
local fs = {
"formspec_version[6]",
"size[", tostring(tabsize.width), ",", tostring(tabsize.height + extra_h), "]",
TOUCHSCREEN_GUI and "padding[0.01,0.01]" or "",
"bgcolor[#0000]",
-- HACK: this is needed to allow resubmitting the same formspec
formspec_show_hack and " " or "",
"box[0,0;", tostring(tabsize.width), ",", tostring(tabsize.height), ";#0000008C]",
("button[0,%f;%f,0.8;back;%s]"):format(
tabsize.height + 0.2, back_w, fgettext("Back")),
("box[%f,%f;%f,0.8;#0000008C]"):format(
back_w + 0.2, tabsize.height + 0.2, checkbox_w),
("checkbox[%f,%f;show_technical_names;%s;%s]"):format(
back_w + 2*0.2, tabsize.height + 0.6,
fgettext("Show technical names"), tostring(show_technical_names)),
("box[%f,%f;%f,0.8;#0000008C]"):format(
back_w + 2*0.2 + checkbox_w, tabsize.height + 0.2, checkbox_w),
("checkbox[%f,%f;show_advanced;%s;%s]"):format(
back_w + 3*0.2 + checkbox_w, tabsize.height + 0.6,
fgettext("Show advanced settings"), tostring(show_advanced)),
"field[0.25,0.25;", tostring(search_width), ",0.75;search_query;;",
core.formspec_escape(dialogdata.query or ""), "]",
"field_enter_after_edit[search_query;true]",
"container[", tostring(search_width + 0.25), ", 0.25]",
"image_button[0,0;0.75,0.75;", core.formspec_escape(defaulttexturedir .. "search.png"), ";search;]",
"image_button[0.75,0;0.75,0.75;", core.formspec_escape(defaulttexturedir .. "clear.png"), ";search_clear;]",
"tooltip[search;", fgettext("Search"), "]",
"tooltip[search_clear;", fgettext("Clear"), "]",
"container_end[]",
"scroll_container[0.25,1.25;", tostring(left_pane_width), ",",
tostring(tabsize.height - 1.5), ";leftscroll;vertical;0.1]",
"style_type[button;border=false;bgcolor=#3333]",
"style_type[button:hover;border=false;bgcolor=#6663]",
}
local y = 0
local last_section = nil
for _, other_page in ipairs(filtered_pages) do
if other_page.section ~= last_section then
fs[#fs + 1] = ("label[0.1,%f;%s]"):format(
y + 0.41, core.colorize("#ff0", fgettext(other_page.section)))
last_section = other_page.section
y = y + 0.82
end
fs[#fs + 1] = ("box[0,%f;%f,0.8;%s]"):format(
y, left_pane_width, other_page.id == page_id and "#467832FF" or "#3339")
fs[#fs + 1] = ("button[0,%f;%f,0.8;page_%s;%s]")
:format(y, left_pane_width, other_page.id, fgettext(other_page.title))
y = y + 0.82
end
if #filtered_pages == 0 then
fs[#fs + 1] = "label[0.1,0.41;"
fs[#fs + 1] = fgettext("No results")
fs[#fs + 1] = "]"
end
fs[#fs + 1] = "scroll_container_end[]"
if y >= tabsize.height - 1.25 then
fs[#fs + 1] = make_scrollbaroptions_for_scroll_container(tabsize.height - 1.5, y, 0.1)
fs[#fs + 1] = ("scrollbar[%f,1.25;%f,%f;vertical;leftscroll;%f]"):format(
left_pane_width + 0.25, scrollbar_w, tabsize.height - 1.5, dialogdata.leftscroll or 0)
end
fs[#fs + 1] = "style_type[button;border=;bgcolor=]"
if not dialogdata.components then
dialogdata.components = page and build_page_components(page) or {}
end
local right_pane_width = tabsize.width - left_pane_width - 0.375 - 2*scrollbar_w - 0.25
fs[#fs + 1] = ("scroll_container[%f,0;%f,%f;rightscroll;vertical;0.1]"):format(
tabsize.width - right_pane_width - scrollbar_w, right_pane_width, tabsize.height)
y = 0.25
for i, comp in ipairs(dialogdata.components) do
fs[#fs + 1] = ("container[0,%f]"):format(y)
local avail_w = right_pane_width - 0.25
if not comp.full_width then
avail_w = avail_w - 1.4
end
if comp.max_w then
avail_w = math.min(avail_w, comp.max_w)
end
local comp_fs, used_h = comp:get_formspec(avail_w)
fs[#fs + 1] = comp_fs
fs[#fs + 1] = "style_type[image_button;border=false;padding=]"
local show_reset = comp.resettable and comp.setting
local show_info = comp.info_text and comp.info_text ~= ""
if show_reset or show_info then
-- ensure there's enough space for reset/info
used_h = math.max(used_h, 0.5)
end
local info_reset_y = used_h / 2 - 0.25
if show_reset then
local default = comp.setting.default
local reset_tooltip = default and
fgettext("Reset setting to default ($1)", tostring(default)) or
fgettext("Reset setting to default")
fs[#fs + 1] = ("image_button[%f,%f;0.5,0.5;%s;%s;]"):format(
right_pane_width - 1.4, info_reset_y, reset_icon_path, "reset_" .. i)
fs[#fs + 1] = ("tooltip[%s;%s]"):format("reset_" .. i, reset_tooltip)
end
if show_info then
local info_x = right_pane_width - 0.75
fs[#fs + 1] = ("image[%f,%f;0.5,0.5;%s]"):format(info_x, info_reset_y, info_icon_path)
fs[#fs + 1] = ("tooltip[%f,%f;0.5,0.5;%s]"):format(info_x, info_reset_y, fgettext(comp.info_text))
end
fs[#fs + 1] = "style_type[image_button;border=;padding=]"
fs[#fs + 1] = "container_end[]"
if used_h > 0 then
y = y + used_h + 0.25
end
end
fs[#fs + 1] = "scroll_container_end[]"
if y >= tabsize.height then
fs[#fs + 1] = make_scrollbaroptions_for_scroll_container(tabsize.height, y + 0.375, 0.1)
fs[#fs + 1] = ("scrollbar[%f,0;%f,%f;vertical;rightscroll;%f]"):format(
tabsize.width - scrollbar_w, scrollbar_w, tabsize.height, dialogdata.rightscroll or 0)
end
return table.concat(fs, "")
end
-- On Android, closing the app via the "Recents screen" won't result in a clean
-- exit, discarding any setting changes made by the user.
-- To avoid that, we write the settings file in more cases on Android.
function write_settings_early()
if PLATFORM == "Android" then
core.settings:write()
end
end
local function buttonhandler(this, fields)
local dialogdata = this.data
dialogdata.leftscroll = core.explode_scrollbar_event(fields.leftscroll).value or dialogdata.leftscroll
dialogdata.rightscroll = core.explode_scrollbar_event(fields.rightscroll).value or dialogdata.rightscroll
dialogdata.query = fields.search_query
if fields.back then
this:delete()
return true
end
if fields.show_technical_names ~= nil then
local value = core.is_yes(fields.show_technical_names)
core.settings:set_bool("show_technical_names", value)
write_settings_early()
return true
end
if fields.show_advanced ~= nil then
local value = core.is_yes(fields.show_advanced)
core.settings:set_bool("show_advanced", value)
write_settings_early()
local suggested_page_id = update_filtered_pages(dialogdata.query)
if not filtered_page_by_id[dialogdata.page_id] then
dialogdata.components = nil
dialogdata.leftscroll = 0
dialogdata.rightscroll = 0
dialogdata.page_id = suggested_page_id
end
return true
end
if fields.search or fields.key_enter_field == "search_query" then
dialogdata.components = nil
dialogdata.leftscroll = 0
dialogdata.rightscroll = 0
dialogdata.page_id = update_filtered_pages(dialogdata.query)
return true
end
if fields.search_clear then
dialogdata.query = ""
dialogdata.components = nil
dialogdata.leftscroll = 0
dialogdata.rightscroll = 0
dialogdata.page_id = update_filtered_pages("")
return true
end
for _, page in ipairs(all_pages) do
if fields["page_" .. page.id] then
dialogdata.page_id = page.id
dialogdata.components = nil
dialogdata.rightscroll = 0
return true
end
end
for i, comp in ipairs(dialogdata.components) do
if comp.on_submit and comp:on_submit(fields, this) then
write_settings_early()
-- Clear components so they regenerate
dialogdata.components = nil
return true
end
if comp.setting and fields["reset_" .. i] then
core.settings:remove(comp.setting.name)
write_settings_early()
-- Clear components so they regenerate
dialogdata.components = nil
return true
end
end
return false
end
local function eventhandler(event)
if event == "DialogShow" then
-- Don't show the "MINETEST" header behind the dialog.
mm_game_theme.set_engine(true)
return true
end
return false
end
function create_settings_dlg()
local dlg = dialog_create("dlg_settings", get_formspec, buttonhandler, eventhandler)
dlg.data.page_id = update_filtered_pages("")
return dlg
end

View File

@@ -1,5 +1,3 @@
local settings = ...
local concat = table.concat
local insert = table.insert
local sprintf = string.format
@@ -18,7 +16,7 @@ local minetest_example_header = [[
# to the program, eg. "minetest.exe --config ../minetest.conf.example".
# Further documentation:
# http://wiki.minetest.net/
# https://wiki.minetest.net/
]]
@@ -36,7 +34,7 @@ local group_format_template = [[
]]
local function create_minetest_conf_example()
local function create_minetest_conf_example(settings)
local result = { minetest_example_header }
for _, entry in ipairs(settings) do
if entry.type == "category" then
@@ -62,6 +60,10 @@ local function create_minetest_conf_example()
end
end
end
if entry.type == "key" then
local line = "See https://github.com/minetest/irrlicht/blob/master/include/Keycodes.h"
insert(result, "# " .. line .. "\n")
end
insert(result, "# type: " .. entry.type)
if entry.min then
insert(result, " min: " .. entry.min)
@@ -104,7 +106,7 @@ local translation_file_header = [[
fake_function() {]]
local function create_translation_file()
local function create_translation_file(settings)
local result = { translation_file_header }
for _, entry in ipairs(settings) do
if entry.type == "category" then
@@ -125,12 +127,13 @@ local function create_translation_file()
end
local file = assert(io.open("minetest.conf.example", "w"))
file:write(create_minetest_conf_example())
file:write(create_minetest_conf_example(settingtypes.parse_config_file(true, false)))
file:close()
file = assert(io.open("src/settings_translation_file.cpp", "w"))
-- If 'minetest.conf.example' appears in the 'bin' folder, the line below may have to be
-- used instead. The file will also appear in the 'bin' folder.
--file = assert(io.open("settings_translation_file.cpp", "w"))
file:write(create_translation_file())
-- We don't want hidden settings to be translated, so we set read_all to false.
file:write(create_translation_file(settingtypes.parse_config_file(false, false)))
file:close()

View File

@@ -0,0 +1,28 @@
--Minetest
--Copyright (C) 2022 rubenwardy
--
--This program is free software; you can redistribute it and/or modify
--it under the terms of the GNU Lesser General Public License as published by
--the Free Software Foundation; either version 2.1 of the License, or
--(at your option) any later version.
--
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--GNU Lesser General Public License for more details.
--
--You should have received a copy of the GNU Lesser General Public License along
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
local path = core.get_mainmenu_path() .. DIR_DELIM .. "settings"
dofile(path .. DIR_DELIM .. "settingtypes.lua")
dofile(path .. DIR_DELIM .. "dlg_change_mapgen_flags.lua")
dofile(path .. DIR_DELIM .. "dlg_settings.lua")
-- Uncomment to generate 'minetest.conf.example' and 'settings_translation_file.cpp'.
-- For RUN_IN_PLACE the generated files may appear in the 'bin' folder.
-- See comment and alternative line at the end of 'generate_from_settingtypes.lua'.
-- dofile(path .. DIR_DELIM .. "generate_from_settingtypes.lua")

View File

@@ -0,0 +1,507 @@
--Minetest
--Copyright (C) 2015 PilzAdam
--
--This program is free software; you can redistribute it and/or modify
--it under the terms of the GNU Lesser General Public License as published by
--the Free Software Foundation; either version 2.1 of the License, or
--(at your option) any later version.
--
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--GNU Lesser General Public License for more details.
--
--You should have received a copy of the GNU Lesser General Public License along
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
settingtypes = {}
-- A Setting type is a table with the following keys:
--
-- name: Identifier
-- readable_name: Readable title
-- type: Category
--
-- name = mod.name,
-- readable_name = mod.title,
-- level = 1,
-- type = "category", "int", "string", ""
-- }
local FILENAME = "settingtypes.txt"
local CHAR_CLASSES = {
SPACE = "[%s]",
VARIABLE = "[%w_%-%.]",
INTEGER = "[+-]?[%d]",
FLOAT = "[+-]?[%d%.]",
FLAGS = "[%w_%-%.,]",
}
local function flags_to_table(flags)
return flags:gsub("%s+", ""):split(",", true) -- Remove all spaces and split
end
-- returns error message, or nil
local function parse_setting_line(settings, line, read_all, base_level, allow_secure)
-- strip carriage returns (CR, /r)
line = line:gsub("\r", "")
-- comment
local comment_match = line:match("^#" .. CHAR_CLASSES.SPACE .. "*(.*)$")
if comment_match then
settings.current_comment[#settings.current_comment + 1] = comment_match
return
end
-- clear current_comment so only comments directly above a setting are bound to it
-- but keep a local reference to it for variables in the current line
local current_comment = settings.current_comment
settings.current_comment = {}
-- empty lines
if line:match("^" .. CHAR_CLASSES.SPACE .. "*$") then
return
end
-- category
local stars, category = line:match("^%[([%*]*)([^%]]+)%]$")
if category then
local category_level = stars:len() + base_level
if settings.current_hide_level then
if settings.current_hide_level < category_level then
-- Skip this category, it's inside a hidden category.
return
else
-- The start of this category marks the end of a hidden category.
settings.current_hide_level = nil
end
end
if not read_all and category:sub(1, 5) == "Hide:" then
-- This category is hidden.
settings.current_hide_level = category_level
return
end
table.insert(settings, {
name = category,
level = category_level,
type = "category",
})
return
end
if settings.current_hide_level then
-- Ignore this line, we're inside a hidden category.
return
end
-- settings
local first_part, name, readable_name, setting_type = line:match("^"
-- this first capture group matches the whole first part,
-- so we can later strip it from the rest of the line
.. "("
.. "([" .. CHAR_CLASSES.VARIABLE .. "+)" -- variable name
.. CHAR_CLASSES.SPACE .. "*"
.. "%(([^%)]*)%)" -- readable name
.. CHAR_CLASSES.SPACE .. "*"
.. "(" .. CHAR_CLASSES.VARIABLE .. "+)" -- type
.. CHAR_CLASSES.SPACE .. "*"
.. ")")
if not first_part then
return "Invalid line"
end
if name:match("secure%.[.]*") and not allow_secure then
return "Tried to add \"secure.\" setting"
end
local requires = {}
local last_line = #current_comment > 0 and current_comment[#current_comment]:trim()
if last_line and last_line:lower():sub(1, 9) == "requires:" then
local parts = last_line:sub(10):split(",")
current_comment[#current_comment] = nil
for _, part in ipairs(parts) do
part = part:trim()
local value = true
if part:sub(1, 1) == "!" then
value = false
part = part:sub(2):trim()
end
requires[part] = value
end
end
if readable_name == "" then
readable_name = nil
end
local remaining_line = line:sub(first_part:len() + 1)
local comment = table.concat(current_comment, "\n"):trim()
if setting_type == "int" then
local default, min, max = remaining_line:match("^"
-- first int is required, the last 2 are optional
.. "(" .. CHAR_CLASSES.INTEGER .. "+)" .. CHAR_CLASSES.SPACE .. "*"
.. "(" .. CHAR_CLASSES.INTEGER .. "*)" .. CHAR_CLASSES.SPACE .. "*"
.. "(" .. CHAR_CLASSES.INTEGER .. "*)"
.. "$")
if not default or not tonumber(default) then
return "Invalid integer setting"
end
min = tonumber(min)
max = tonumber(max)
table.insert(settings, {
name = name,
readable_name = readable_name,
type = "int",
default = default,
min = min,
max = max,
requires = requires,
comment = comment,
})
return
end
if setting_type == "string"
or setting_type == "key" or setting_type == "v3f" then
local default = remaining_line:match("^(.*)$")
if not default then
return "Invalid string setting"
end
if setting_type == "key" and not read_all then
-- ignore key type if read_all is false
return
end
table.insert(settings, {
name = name,
readable_name = readable_name,
type = setting_type,
default = default,
requires = requires,
comment = comment,
})
return
end
if setting_type == "noise_params_2d"
or setting_type == "noise_params_3d" then
local default = remaining_line:match("^(.*)$")
if not default then
return "Invalid string setting"
end
local values = {}
local ti = 1
local index = 1
for match in default:gmatch("[+-]?[%d.-e]+") do -- All numeric characters
index = default:find("[+-]?[%d.-e]+", index) + match:len()
table.insert(values, match)
ti = ti + 1
if ti > 9 then
break
end
end
index = default:find("[^, ]", index)
local flags = ""
if index then
flags = default:sub(index)
end
table.insert(values, flags)
table.insert(settings, {
name = name,
readable_name = readable_name,
type = setting_type,
default = default,
default_table = {
offset = values[1],
scale = values[2],
spread = {
x = values[3],
y = values[4],
z = values[5]
},
seed = values[6],
octaves = values[7],
persistence = values[8],
lacunarity = values[9],
flags = values[10]
},
values = values,
requires = requires,
comment = comment,
noise_params = true,
flags = flags_to_table("defaults,eased,absvalue")
})
return
end
if setting_type == "bool" then
if remaining_line ~= "false" and remaining_line ~= "true" then
return "Invalid boolean setting"
end
table.insert(settings, {
name = name,
readable_name = readable_name,
type = "bool",
default = remaining_line,
requires = requires,
comment = comment,
})
return
end
if setting_type == "float" then
local default, min, max = remaining_line:match("^"
-- first float is required, the last 2 are optional
.. "(" .. CHAR_CLASSES.FLOAT .. "+)" .. CHAR_CLASSES.SPACE .. "*"
.. "(" .. CHAR_CLASSES.FLOAT .. "*)" .. CHAR_CLASSES.SPACE .. "*"
.. "(" .. CHAR_CLASSES.FLOAT .. "*)"
.."$")
if not default or not tonumber(default) then
return "Invalid float setting"
end
min = tonumber(min)
max = tonumber(max)
table.insert(settings, {
name = name,
readable_name = readable_name,
type = "float",
default = default,
min = min,
max = max,
requires = requires,
comment = comment,
})
return
end
if setting_type == "enum" then
local default, values = remaining_line:match("^"
-- first value (default) may be empty (i.e. is optional)
.. "(" .. CHAR_CLASSES.VARIABLE .. "*)" .. CHAR_CLASSES.SPACE .. "*"
.. "(" .. CHAR_CLASSES.FLAGS .. "+)"
.. "$")
if not default or values == "" then
return "Invalid enum setting"
end
table.insert(settings, {
name = name,
readable_name = readable_name,
type = "enum",
default = default,
values = values:split(",", true),
requires = requires,
comment = comment,
})
return
end
if setting_type == "path" or setting_type == "filepath" then
local default = remaining_line:match("^(.*)$")
if not default then
return "Invalid path setting"
end
table.insert(settings, {
name = name,
readable_name = readable_name,
type = setting_type,
default = default,
requires = requires,
comment = comment,
})
return
end
if setting_type == "flags" then
local default, possible = remaining_line:match("^"
-- first value (default) may be empty (i.e. is optional)
-- this is implemented by making the last value optional, and
-- swapping them around if it turns out empty.
.. "(" .. CHAR_CLASSES.FLAGS .. "+)" .. CHAR_CLASSES.SPACE .. "*"
.. "(" .. CHAR_CLASSES.FLAGS .. "*)"
.. "$")
if not default or not possible then
return "Invalid flags setting"
end
if possible == "" then
possible = default
default = ""
end
table.insert(settings, {
name = name,
readable_name = readable_name,
type = "flags",
default = default,
possible = flags_to_table(possible),
requires = requires,
comment = comment,
})
return
end
return "Invalid setting type \"" .. setting_type .. "\""
end
local function parse_single_file(file, filepath, read_all, result, base_level, allow_secure)
-- store this helper variable in the table so it's easier to pass to parse_setting_line()
result.current_comment = {}
result.current_hide_level = nil
local line = file:read("*line")
while line do
local error_msg = parse_setting_line(result, line, read_all, base_level, allow_secure)
if error_msg then
core.log("error", error_msg .. " in " .. filepath .. " \"" .. line .. "\"")
end
line = file:read("*line")
end
result.current_comment = nil
result.current_hide_level = nil
end
--- Returns table of setting types
--
-- @param read_all Whether to ignore certain setting types for GUI or not
-- @parse_mods Whether to parse settingtypes.txt in mods and games
function settingtypes.parse_config_file(read_all, parse_mods)
local settings = {}
do
local builtin_path = core.get_builtin_path() .. FILENAME
local file = io.open(builtin_path, "r")
if not file then
core.log("error", "Can't load " .. FILENAME)
return settings
end
parse_single_file(file, builtin_path, read_all, settings, 0, true)
file:close()
end
if parse_mods then
-- Parse games
local games_category_initialized = false
for _, game in ipairs(pkgmgr.games) do
local path = game.path .. DIR_DELIM .. FILENAME
local file = io.open(path, "r")
if file then
if not games_category_initialized then
fgettext_ne("Content: Games") -- not used, but needed for xgettext
table.insert(settings, {
name = "Content: Games",
level = 0,
type = "category",
})
games_category_initialized = true
end
table.insert(settings, {
name = game.path,
readable_name = game.title,
level = 1,
type = "category",
})
parse_single_file(file, path, read_all, settings, 2, false)
file:close()
end
end
-- Parse mods
local mods_category_initialized = false
local mods = {}
pkgmgr.get_mods(core.get_modpath(), "mods", mods)
table.sort(mods, function(a, b) return a.name < b.name end)
for _, mod in ipairs(mods) do
local path = mod.path .. DIR_DELIM .. FILENAME
local file = io.open(path, "r")
if file then
if not mods_category_initialized then
fgettext_ne("Content: Mods") -- not used, but needed for xgettext
table.insert(settings, {
name = "Content: Mods",
level = 0,
type = "category",
})
mods_category_initialized = true
end
table.insert(settings, {
name = mod.path,
readable_name = mod.title or mod.name,
level = 1,
type = "category",
})
parse_single_file(file, path, read_all, settings, 2, false)
file:close()
end
end
-- Parse client mods
local clientmods_category_initialized = false
local clientmods = {}
pkgmgr.get_mods(core.get_clientmodpath(), "clientmods", clientmods)
for _, mod in ipairs(clientmods) do
local path = mod.path .. DIR_DELIM .. FILENAME
local file = io.open(path, "r")
if file then
if not clientmods_category_initialized then
fgettext_ne("Client Mods") -- not used, but needed for xgettext
table.insert(settings, {
name = "Client Mods",
level = 0,
type = "category",
})
clientmods_category_initialized = true
end
table.insert(settings, {
name = mod.path,
readable_name = mod.title or mod.name,
level = 1,
type = "category",
})
parse_single_file(file, path, read_all, settings, 2, false)
file:close()
end
end
end
return settings
end

View File

@@ -0,0 +1,121 @@
--Minetest
--Copyright (C) 2021-2 x2048
--Copyright (C) 2022-3 rubenwardy
--
--This program is free software; you can redistribute it and/or modify
--it under the terms of the GNU Lesser General Public License as published by
--the Free Software Foundation; either version 2.1 of the License, or
--(at your option) any later version.
--
--This program is distributed in the hope that it will be useful,
--but WITHOUT ANY WARRANTY; without even the implied warranty of
--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
--GNU Lesser General Public License for more details.
--
--You should have received a copy of the GNU Lesser General Public License along
--with this program; if not, write to the Free Software Foundation, Inc.,
--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
local shadow_levels_labels = {
fgettext("Disabled"),
fgettext("Very Low"),
fgettext("Low"),
fgettext("Medium"),
fgettext("High"),
fgettext("Very High"),
fgettext("Custom"),
}
local PRESET_DISABLED = 1
local PRESET_CUSTOM = #shadow_levels_labels
-- max distance, texture size, texture_32bit, filters, map color
local shadow_presets = {
[2] = { 62, 512, true, 0, false },
[3] = { 93, 1024, true, 0, false },
[4] = { 140, 2048, true, 1, false },
[5] = { 210, 4096, true, 2, true },
[6] = { 300, 8192, true, 2, true },
}
local function detect_mapping_idx()
if not core.settings:get_bool("enable_dynamic_shadows", false) then
return PRESET_DISABLED
end
local shadow_map_max_distance = tonumber(core.settings:get("shadow_map_max_distance"))
local shadow_map_texture_size = tonumber(core.settings:get("shadow_map_texture_size"))
local shadow_map_texture_32bit = core.settings:get_bool("shadow_map_texture_32bit", false)
local shadow_filters = tonumber(core.settings:get("shadow_filters"))
local shadow_map_color = core.settings:get_bool("shadow_map_color", false)
for i = 2, 6 do
local preset = shadow_presets[i]
if preset[1] == shadow_map_max_distance and
preset[2] == shadow_map_texture_size and
preset[3] == shadow_map_texture_32bit and
preset[4] == shadow_filters and
preset[5] == shadow_map_color then
return i
end
end
return PRESET_CUSTOM
end
local function apply_preset(preset)
if preset then
core.settings:set_bool("enable_dynamic_shadows", true)
core.settings:set("shadow_map_max_distance", preset[1])
core.settings:set("shadow_map_texture_size", preset[2])
core.settings:set_bool("shadow_map_texture_32bit", preset[3])
core.settings:set("shadow_filters", preset[4])
core.settings:set_bool("shadow_map_color", preset[5])
else
core.settings:set_bool("enable_dynamic_shadows", false)
end
end
return {
query_text = "Shadows",
requires = {
shaders = true,
opengl = true,
},
get_formspec = function(self, avail_w)
local labels = table.copy(shadow_levels_labels)
local idx = detect_mapping_idx()
-- Remove "custom" if not already selected
if idx ~= PRESET_CUSTOM then
table.remove(labels, PRESET_CUSTOM)
end
local fs =
"label[0,0.2;" .. fgettext("Dynamic shadows") .. "]" ..
"dropdown[0,0.4;3,0.8;dd_shadows;" .. table.concat(labels, ",") .. ";" .. idx .. ";true]" ..
"label[0,1.5;" .. core.colorize("#bbb", fgettext("(The game will need to enable shadows as well)")) .. "]"
return fs, 1.8
end,
on_submit = function(self, fields)
if fields.dd_shadows then
local old_shadow_level_idx = detect_mapping_idx()
local shadow_level_idx = tonumber(fields.dd_shadows)
if shadow_level_idx == nil or shadow_level_idx == old_shadow_level_idx then
return false
end
if shadow_level_idx == PRESET_CUSTOM then
core.settings:set_bool("enable_dynamic_shadows", true)
return true
end
local preset = shadow_presets[shadow_level_idx]
apply_preset(preset)
return true
end
end,
}

View File

@@ -27,34 +27,35 @@ local core_developers = {
"Krock/SmallJoker <mk939@ymail.com>",
"Lars Hofhansl <larsh@apache.org>",
"v-rob <robinsonvincent89@gmail.com>",
"hecks",
"Hugues Ross <hugues.ross@gmail.com>",
"Dmitry Kostenko (x2048) <codeforsmile@gmail.com>",
"Desour/DS",
"srifqi",
"Gregor Parzefall (grorp)",
}
-- currently only https://github.com/orgs/minetest/teams/triagers/members
local core_team = {
"Zughy [Issue triager]",
"wsor [Issue triager]",
"Hugo Locurcio (Calinou) [Issue triager]",
}
-- For updating active/previous contributors, see the script in ./util/gather_git_credits.py
local active_contributors = {
"Wuzzy [Features, translations, devtest]",
"Lars Müller [Lua optimizations and fixes]",
"Jude Melton-Houghton [Optimizations, bugfixes]",
"paradust7 [Performance, fixes, Irrlicht refactoring]",
"Desour [Fixes]",
"ROllerozxa [Main menu]",
"Wuzzy [Features, translations, documentation]",
"numzero [Optimizations, work on OpenGL driver]",
"ROllerozxa [Bugfixes, Mainmenu]",
"Lars Müller [Bugfixes]",
"AFCMS [Documentation]",
"savilli [Bugfixes]",
"Lexi Hale [Particlespawner animation]",
"Liso [Shadow Mapping]",
"JosiahWI [Fixes, build system]",
"numzero [Graphics and rendering]",
"HybridDog [Fixes]",
"NeroBurner [Joystick]",
"pecksin [Clickable web links]",
"Daroc Alden [Fixes]",
"Jean-Patrick Guerrero (kilbith) [Fixes]",
"fluxionary [Bugfixes]",
"Bradley Pierce (Thresher) [Documentation]",
"Stvk imension [Android]",
"JosiahWI [Code cleanups]",
"OgelGames [UI, Bugfixes]",
"ndren [Bugfixes]",
"Abdou-31 [Documentation]",
}
local previous_core_developers = {
@@ -73,21 +74,26 @@ local previous_core_developers = {
"Aaron Suen <warr1024@gmail.com>",
"paramat",
"Pierre-Yves Rollo <dev@pyrollo.com>",
"hecks",
"Jude Melton-Houghton (TurkeyMcMac) [RIP]",
"Hugues Ross <hugues.ross@gmail.com>",
"Dmitry Kostenko (x2048) <codeforsmile@gmail.com>",
}
local previous_contributors = {
"Nils Dagsson Moskopp (erlehmann) <nils@dieweltistgarnichtso.net> [Minetest logo]",
"red-001 <red-001@outlook.ie>",
"Giuseppe Bilotta",
"HybridDog",
"ClobberXD",
"Dániel Juhász (juhdanad) <juhdanad@gmail.com>",
"MirceaKitsune <mirceakitsune@gmail.com>",
"Jean-Patrick Guerrero (kilbith)",
"MoNTE48",
"Constantin Wenger (SpeedProg)",
"Ciaran Gultnieks (CiaranG)",
"Paul Ouellette (pauloue)",
"stujones11",
"srifqi",
"Rogier <rogier777@gmail.com>",
"Gregory Currie (gregorycu)",
"JacobF",
@@ -95,77 +101,79 @@ local previous_contributors = {
}
local function prepare_credits(dest, source)
for _, s in ipairs(source) do
-- if there's text inside brackets make it gray-ish
s = s:gsub("%[.-%]", core.colorize("#aaa", "%1"))
dest[#dest+1] = s
end
end
local string = table.concat(source, "\n") .. "\n"
local function build_hacky_list(items, spacing)
spacing = spacing or 0.5
local y = spacing / 2
local ret = {}
for _, item in ipairs(items) do
if item ~= "" then
ret[#ret+1] = ("label[0,%f;%s]"):format(y, core.formspec_escape(item))
end
y = y + spacing
end
return table.concat(ret, ""), y
local hypertext_escapes = {
["\\"] = "\\\\",
["<"] = "\\<",
[">"] = "\\>",
}
string = string:gsub("[\\<>]", hypertext_escapes)
string = string:gsub("%[.-%]", "<gray>%1</gray>")
table.insert(dest, string)
end
return {
name = "about",
caption = fgettext("About"),
cbf_formspec = function(tabview, name, tabdata)
local logofile = defaulttexturedir .. "logo.png"
local version = core.get_version()
local credit_list = {}
table.insert_all(credit_list, {
core.colorize("#ff0", fgettext("Core Developers"))
local hypertext = {
"<tag name=heading color=#ff0>",
"<tag name=gray color=#aaa>",
}
table.insert_all(hypertext, {
"<heading>", fgettext_ne("Core Developers"), "</heading>\n",
})
prepare_credits(credit_list, core_developers)
table.insert_all(credit_list, {
"",
core.colorize("#ff0", fgettext("Core Team"))
prepare_credits(hypertext, core_developers)
table.insert_all(hypertext, {
"\n",
"<heading>", fgettext_ne("Core Team"), "</heading>\n",
})
prepare_credits(credit_list, core_team)
table.insert_all(credit_list, {
"",
core.colorize("#ff0", fgettext("Active Contributors"))
prepare_credits(hypertext, core_team)
table.insert_all(hypertext, {
"\n",
"<heading>", fgettext_ne("Active Contributors"), "</heading>\n",
})
prepare_credits(credit_list, active_contributors)
table.insert_all(credit_list, {
"",
core.colorize("#ff0", fgettext("Previous Core Developers"))
prepare_credits(hypertext, active_contributors)
table.insert_all(hypertext, {
"\n",
"<heading>", fgettext_ne("Previous Core Developers"), "</heading>\n",
})
prepare_credits(credit_list, previous_core_developers)
table.insert_all(credit_list, {
"",
core.colorize("#ff0", fgettext("Previous Contributors"))
prepare_credits(hypertext, previous_core_developers)
table.insert_all(hypertext, {
"\n",
"<heading>", fgettext_ne("Previous Contributors"), "</heading>\n",
})
prepare_credits(credit_list, previous_contributors)
local credit_fs, scroll_height = build_hacky_list(credit_list)
-- account for the visible portion
scroll_height = math.max(0, scroll_height - 6.9)
prepare_credits(hypertext, previous_contributors)
hypertext = table.concat(hypertext):sub(1, -2)
local fs = "image[1.5,0.6;2.5,2.5;" .. core.formspec_escape(logofile) .. "]" ..
"style[label_button;border=false]" ..
"button[0.1,3.4;5.3,0.5;label_button;" ..
core.formspec_escape(version.project .. " " .. version.string) .. "]" ..
"button[1.5,4.1;2.5,0.8;homepage;minetest.net]" ..
"scroll_container[5.5,0.1;9.5,6.9;scroll_credits;vertical;" ..
tostring(scroll_height / 1000) .. "]" .. credit_fs ..
"scroll_container_end[]"..
"scrollbar[15,0.1;0.4,6.9;vertical;scroll_credits;0]"
"hypertext[5.5,0.25;9.75,6.6;credits;" .. minetest.formspec_escape(hypertext) .. "]"
-- Render information
local active_renderer_info = fgettext("Active renderer:") .. " " ..
core.formspec_escape(core.get_active_renderer())
fs = fs .. "style[label_button2;border=false]" ..
"button[0.1,6;5.3,1;label_button2;" ..
fgettext("Active renderer:") .. "\n" ..
core.formspec_escape(core.get_screen_info().render_info) .. "]"
"button[0.1,6;5.3,0.5;label_button2;" .. active_renderer_info .. "]"..
"tooltip[label_button2;" .. active_renderer_info .. "]"
-- Irrlicht device information
local irrlicht_device_info = fgettext("Irrlicht device:") .. " " ..
core.formspec_escape(core.get_active_irrlicht_device())
fs = fs .. "style[label_button3;border=false]" ..
"button[0.1,6.5;5.3,0.5;label_button3;" .. irrlicht_device_info .. "]"..
"tooltip[label_button3;" .. irrlicht_device_info .. "]"
if PLATFORM == "Android" then
fs = fs .. "button[0.5,5.1;4.5,0.8;share_debug;" .. fgettext("Share debug log") .. "]"
@@ -176,8 +184,9 @@ return {
fs = fs .. "button[0.5,5.1;4.5,0.8;userdata;" .. fgettext("Open User Data Directory") .. "]"
end
return fs, "size[15.5,7.1,false]real_coordinates[true]"
return fs
end,
cbf_button_handler = function(this, fields, name, tabdata)
if fields.homepage then
core.open_url("https://www.minetest.net")
@@ -192,4 +201,10 @@ return {
core.open_dir(core.get_user_path())
end
end,
on_change = function(type)
if type == "ENTER" then
mm_game_theme.set_engine()
end
end,
}

Some files were not shown because too many files have changed in this diff Show More