Compare commits

...

384 commits

Author SHA1 Message Date
sfan5
7892541383 Various random code cleanups 2025-03-04 19:53:01 +01:00
sfan5
358658fa34 Fix cloud-related bugs
First, this reverts 56123b2fbe,
which un-fixes #15031 but fixes #15798 and #15854.

Then we disable culling for the cloud scene node which fixes #15031 again.
2025-03-04 19:53:01 +01:00
sfan5
68602b2eaf Fix shadow flicker on camera offset update (take 2)
The previous fix never did what it was supposed to, so let's do this.
2025-03-04 19:53:01 +01:00
sfan5
e84ac56e35 Don't try to update uninitialized shadow frustum 2025-03-04 19:53:01 +01:00
sfan5
47c000a293 Add unittest that lints builtin JSON files 2025-03-04 19:53:01 +01:00
sfan5
304ce4cd54 Fix syntax error in credits.json
reported at <https://forum.luanti.org/viewtopic.php?p=442729>

As it happens this didn't affect most users as jsoncpp allows trailing commas
by default since 2019.
2025-03-04 19:53:01 +01:00
sfan5
d54646d342 Improve error handling of map database creation 2025-03-04 19:53:01 +01:00
sfan5
7abaa8d4cd Make Irrlicht identity material const 2025-03-04 19:53:01 +01:00
sfan5
2796283550 Remove broken fall bobbing 2025-03-04 19:53:01 +01:00
sfan5
7602308835 Revert "Restrict relative mouse mode to Wayland users (#15697)"
see #15761
SDL is the only device that supports relative mode and
mouse input is actually somewhat broken if it's *not* enabled.

This reverts commit 45c5ef8798
and 88b007907a.
2025-03-04 19:53:01 +01:00
sfan5
bc43019467 Fix TerminalChatConsole crash
this setting was removed in #15633
2025-03-04 19:53:01 +01:00
sfan5
8449f5f6db Make devtest grass use overlay tiles 2025-03-04 19:53:01 +01:00
Medley
0eb047ca33
Disable debug-breaking locale workaround when debugging (#15859) 2025-03-03 20:33:42 +01:00
wrrrzr
98048cb06d
Fix missing includes in skyparams.h 2025-03-03 20:33:19 +01:00
Erich Schubert
6e995972bb check y limits early 2025-03-03 20:33:05 +01:00
Erich Schubert
08fad862aa Code cleanups. Function does not return deco count. 2025-03-03 20:33:05 +01:00
sfan5
c3477a4d08 Adjust Android default view range and mapblock limit 2025-03-01 22:40:10 +01:00
sfan5
062207e696 Enforce minimum client_mapblock_limit depending on view range 2025-03-01 22:40:10 +01:00
SmallJoker
24c1230c7b Client: fix disappearing node inventories on older servers
ee9258ce introduced a logic error, which caused clients to lose
node metadata when they should not and vice-versa.
See also: server.cpp / Server::sendAddNode
2025-03-01 21:05:17 +01:00
sfan5
eb79a76742
Android: update SDL support code (#15853) 2025-03-01 18:27:46 +01:00
millennIumAMbiguity
c0328e5363
Centered title in README.md and added icon 2025-03-01 12:27:43 +01:00
Joshua Gerrish
8d822d8231
Fix compile error with MSVC: string is not a member of std 2025-03-01 12:26:33 +01:00
y5nw
a11b25f3f5 Use fallback font correctly for fonts provided by the server 2025-03-01 12:25:24 +01:00
Lars Mueller
90121dc66f Fix & improve glTF loader matrix decomposition 2025-02-27 12:31:04 +01:00
Lars Mueller
d74af2f1a7 Use matrix4::getRotationRadians 2025-02-27 12:31:04 +01:00
Lars Mueller
b6c71b2379 Improve matrix4::getRotationDegrees a bit, radians 2025-02-27 12:31:04 +01:00
Lars Mueller
c261c26456 Add Irrlicht rotation consistency unit tests 2025-02-27 12:31:04 +01:00
Lars Mueller
5abf220979 Fix random usage in matrix4 tests 2025-02-27 12:31:04 +01:00
Lars Mueller
1ceeea34f4 Extend quaternion tests 2025-02-27 12:31:04 +01:00
Lars Mueller
3ae1fd459a Add quaternion conversion unit tests 2025-02-27 12:31:04 +01:00
Lars Mueller
0e86366324 Add test for matrix4::getRotationDegrees 2025-02-27 12:31:04 +01:00
Erich Schubert
58ad604a4b
Note that core.hash_node_position is not a hash function 2025-02-27 12:30:55 +01:00
guinea7pig
415e96184d
Update copyright date in README 2025-02-26 12:22:19 +01:00
sfan5
8654e16725 Disable shadow force updates with performance_tradeoffs 2025-02-26 12:22:06 +01:00
sfan5
eb8b449817 Fix shadow performance regression due to force update
broken by: b861f0c5c5
2025-02-26 12:22:06 +01:00
sfan5
22c81e5292 Print if sdl2-compat is in use 2025-02-26 12:21:57 +01:00
sfan5
42a35cec83 Allow looking straight up or down 2025-02-26 12:21:57 +01:00
sfan5
fc8c6742c4 Update Wireshark dissector 2025-02-26 12:21:57 +01:00
sfan5
ee9258cefd Clean up some packet-related code 2025-02-26 12:21:57 +01:00
grorp
5e89371ecd
TouchControls: touch_use_crosshair, dig/place simulation refactoring (#15800)
-   get rid of simulated mouse events for digging/placing, use keyboard events
    instead
    -   consistent with other simulated events, less code, no need for a
        pointer position
    -   more correct: touch controls no longer break if you have custom
        dig/place keybindings set
-   move reading of "touch_use_crosshair" setting from Game to TouchControls
2025-02-25 13:19:44 -05:00
Andrii Nemchenko
abcd2e0b81
Re-save active entities more often if they move a certain distance (#15605) 2025-02-22 16:19:19 +01:00
sfan5
d12ce68e64 Show unknown object visuals using unknown_object.png sprite 2025-02-22 16:19:04 +01:00
sfan5
83fd837d75 Clean up TileLayer::applyMaterialOptions 2025-02-22 16:19:04 +01:00
sfan5
7d3f0628c4 Use visual = "node" for builtin falling node entity
This greatly simplifies the code at the expense of some
falling nodes not showing up on older clients.
2025-02-22 16:19:04 +01:00
sfan5
27bbe3a873 CAO 'node' visual (#15683) 2025-02-22 16:19:04 +01:00
sfan5
5a8720a484 Change material sharing for CMeshSceneNode 2025-02-22 16:19:04 +01:00
Andrii Nemchenko
e51221d247
Implement metadata-aware version of InvRef:remove_item() (#15771) 2025-02-22 16:18:48 +01:00
DS
0890125962
SDL Irr device: Ignore +-0.0f y mouse wheel events (#15815)
our code often assumes that it's non-zero, e.g.: `event.MouseInput.Wheel < 0 ? -1 : 1`
2025-02-22 16:17:07 +01:00
DS
0667cbf5a2
Clang-Tidy config: Ignore performance-avoid-endl and performance-inefficient-string-concatenation 2025-02-22 16:16:41 +01:00
sfan5
ba62808fe8
Basic camera control API (#15796) 2025-02-19 18:45:45 +01:00
James Morey
50819ace8f
Move clickable_chat_weblinks to Advanced > Miscellaneous (#15799) 2025-02-19 18:45:31 +01:00
et
ef0219c2ed
Prevent accidental wallmounted_to_dir poisoning (#15810)
Prior to this commit, if you used a function like `core.wallmounted_to_dir`, and modified its output, it would modify all of the output in the future.
2025-02-18 21:51:33 +01:00
sfan5
f4bdf72aa4 Simplify SQLite3 schema types
see: <https://www.sqlite.org/datatype3.html>
2025-02-18 19:29:06 +01:00
sfan5
cc352f3b66 Add unit tests for MapDatabase implementations 2025-02-18 19:29:06 +01:00
sfan5
215b000793 Split blockpos into three columns in sqlite3 map database 2025-02-18 19:29:06 +01:00
sfan5
e8728acc5c Some cleanups in Database_SQLite3 2025-02-18 19:29:06 +01:00
Desour
166e02955e Decrease fps_max_unfocused from 20 to 10
This used to be the default for android.
There's not much issues now with using a lower value, so a lower default on all platforms
is reasonable.
The only downside I know of is that if you re-focus the window, it can up till the
next client step until it goes back to normal fps, but 10 Hz feels fast enough.
2025-02-15 18:21:01 +01:00
Desour
138111a542 Don't use fps_max_unfocused for server step time on non-singleplayer main-menu-hosted servers
It's unreasonable to change server step time when the hosting user unfocuses their window.
(m_is_paused is already not set if it's not singleplayer.)
2025-02-15 18:21:01 +01:00
Desour
191cb117f9 Don't use fps_max_unfocused for the pause menu
Nowadays, we have things like buttons that change appearance on hover, or scoll bars
in the pause menu. These do not work fine with low fps.
2025-02-15 18:21:01 +01:00
Miguel P.L
a57677120a
Correct keycode URL in settingtypes.txt/minetest.conf.example (#15784) 2025-02-15 18:20:45 +01:00
sfan5
75dcd94b90
Optimize add_area_node_boxes in collision code (#15719) 2025-02-15 12:19:17 +01:00
sfan5
d027fc9a88 Enable ipv6_server by default 2025-02-15 12:18:07 +01:00
sfan5
a11d526110 Rework socket IPV6_V6ONLY handling 2025-02-15 12:18:07 +01:00
siliconsniffer
eb797c502a
Tweak main menu server list behavior (#15736)
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
2025-02-15 12:17:56 +01:00
Erich Schubert
567b9a997a
Collision: more accurate computation with acceleration and long dtime (#15408)
Co-authored-by: SmallJoker <mk939@ymail.com>
2025-02-15 12:17:44 +01:00
Lars Müller
319e270664
Clean up Irrlicht matrices a bit more (#15733) 2025-02-15 12:17:30 +01:00
sfan5
d015944f6c Revert "Disable SDL2 for 5.11.0"
This reverts commit 29cfb6efff.
2025-02-15 12:14:12 +01:00
Lars Müller
b7f01b0cc7
Don't save load_mod_* = false lines in world.mt (#15758) 2025-02-14 22:25:39 +01:00
sfan5
54bf5d62f2
Fix fgettext call in dlg_settings.lua
(#15614)
2025-02-14 22:17:10 +01:00
sfan5
849a583f66 Continue with 5.12.0-dev 2025-02-14 19:38:30 +01:00
sfan5
0cb7735125 Bump version to 5.11.0 2025-02-14 19:38:27 +01:00
sfan5
028949beca Delete empty languages 2025-02-14 19:13:14 +01:00
ninjum
6bdeb10c16 Translated using Weblate (Galician)
Currently translated at 99.9% (1391 of 1392 strings)
2025-02-14 19:11:16 +01:00
BlackImpostor
44cbae8fad Translated using Weblate (Russian)
Currently translated at 100.0% (1392 of 1392 strings)
2025-02-14 19:11:16 +01:00
waxtatect
f7b2d4760f Translated using Weblate (French)
Currently translated at 100.0% (1392 of 1392 strings)
2025-02-14 19:11:16 +01:00
109247019824
1ec19c2ad2 Translated using Weblate (Bulgarian)
Currently translated at 51.7% (721 of 1392 strings)
2025-02-14 19:11:12 +01:00
Linerly
9bfd39f036 Translated using Weblate (Indonesian)
Currently translated at 99.6% (1387 of 1392 strings)
2025-02-14 19:11:12 +01:00
Miguel
cfff6c4fd7 Translated using Weblate (Spanish)
Currently translated at 97.9% (1363 of 1392 strings)
2025-02-14 19:11:12 +01:00
Wuzzy
147dd3d372 Translated using Weblate (German)
Currently translated at 100.0% (1392 of 1392 strings)
2025-02-14 19:11:12 +01:00
sfan5
cda3dc08ca
Translated using Weblate (German)
Currently translated at 100.0% (1392 of 1392 strings)
2025-02-14 19:10:19 +01:00
mineplayer
78b4f929ce
Translated using Weblate (German)
Currently translated at 100.0% (1392 of 1392 strings)
2025-02-14 19:10:19 +01:00
Desour
2c50066c16 Keep the game paused in pause menu settings
The button_exit[]s were replaced by regular button[]s, to avoid a very short unpause when you
click the btn_settings (probably because it uses ClientEvent stuff).
2025-02-14 16:31:57 +01:00
ROllerozxa
dd0070a6b8
Expose client version information in non-debug builds (#15708)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
Co-authored-by: sfan5 <sfan5@live.de>
2025-02-09 18:09:07 +01:00
updatepo.sh
e6cf08169e Update translation files 2025-02-09 13:23:37 +01:00
updatepo.sh
0549b6ed0d Update minetest.conf.example and settings_translation_file.cpp 2025-02-09 13:23:22 +01:00
Ilia
3f58def52f Translated using Weblate (Persian)
Currently translated at 9.0% (125 of 1383 strings)
2025-02-09 13:22:18 +01:00
Тарас Арт
0f8723b021 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:18 +01:00
Wuzzy
323b31b89d Translated using Weblate (German)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:18 +01:00
alasa ala
e9574586ea Translated using Weblate (Korean)
Currently translated at 50.0% (692 of 1383 strings)
2025-02-09 13:22:18 +01:00
Negoitescu
584595a78b Translated using Weblate (Romanian)
Currently translated at 55.6% (769 of 1383 strings)
2025-02-09 13:22:18 +01:00
Mateusz Mendel
24452785c2 Translated using Weblate (Polish)
Currently translated at 92.6% (1282 of 1383 strings)
2025-02-09 13:22:18 +01:00
Balázs Kovács
c7dacec94b Translated using Weblate (Hungarian)
Currently translated at 92.9% (1286 of 1383 strings)
2025-02-09 13:22:18 +01:00
Miguel
4255ea42ac Translated using Weblate (Spanish)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:18 +01:00
தமிழ்நேரம்
36f904b705 Translated using Weblate (Tamil)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:18 +01:00
Matyáš Pilz
309a394e06 Translated using Weblate (Czech)
Currently translated at 90.4% (1251 of 1383 strings)
2025-02-09 13:22:18 +01:00
தமிழ்நேரம்
4f855ae3fd Added translation using Weblate (Tamil) 2025-02-09 13:22:18 +01:00
தமிழ்நேரம்
5fcd4bd7d0 Added translation using Weblate (Tamil) 2025-02-09 13:22:18 +01:00
Poesty Li
ae61c66dd2 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 95.1% (1316 of 1383 strings)
2025-02-09 13:22:18 +01:00
Ricky Tigg
4167dc7dfc Translated using Weblate (Finnish)
Currently translated at 24.4% (338 of 1383 strings)
2025-02-09 13:22:18 +01:00
Yof
8f29b8f2ae Translated using Weblate (Ukrainian)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:18 +01:00
Yof
fca69a9b2a Added translation using Weblate (Ukrainian) 2025-02-09 13:22:18 +01:00
BlackImpostor
785b8a2400 Translated using Weblate (Russian)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:18 +01:00
mineplayer
5ed14fe8c4 Translated using Weblate (German)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:18 +01:00
Siber
fa6c61bd69 Translated using Weblate (Turkish)
Currently translated at 83.3% (1153 of 1383 strings)
2025-02-09 13:22:18 +01:00
liu lizhi
61d7dc91c7 Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 92.1% (1275 of 1383 strings)
2025-02-09 13:22:18 +01:00
109247019824
2f95b14f09 Translated using Weblate (Bulgarian)
Currently translated at 39.9% (553 of 1383 strings)
2025-02-09 13:22:18 +01:00
Lukáš Lizák
23527b5263 Translated using Weblate (Slovak)
Currently translated at 92.2% (1276 of 1383 strings)
2025-02-09 13:22:18 +01:00
Emil Faltynek
4cd58b8b04 Translated using Weblate (Czech)
Currently translated at 90.3% (1250 of 1383 strings)
2025-02-09 13:22:18 +01:00
Hugo
ccccfa8d5e Translated using Weblate (Esperanto)
Currently translated at 80.9% (1119 of 1383 strings)
2025-02-09 13:22:18 +01:00
Hugo
fbc3094065 Translated using Weblate (Spanish (American))
Currently translated at 28.4% (394 of 1383 strings)
2025-02-09 13:22:18 +01:00
Kevin Hagen
0f8984be2d Translated using Weblate (Filipino)
Currently translated at 36.5% (506 of 1383 strings)
2025-02-09 13:22:18 +01:00
cat
0bea91a7f5 Translated using Weblate (Danish)
Currently translated at 49.0% (678 of 1383 strings)
2025-02-09 13:22:18 +01:00
reimu105
6adb8f92d4 Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 91.3% (1263 of 1383 strings)
2025-02-09 13:22:18 +01:00
Muhammad Nuruddin
9bd650ada2 Translated using Weblate (Malay)
Currently translated at 96.6% (1337 of 1383 strings)
2025-02-09 13:22:17 +01:00
Linerly
0fbedf828d Translated using Weblate (Indonesian)
Currently translated at 96.3% (1332 of 1383 strings)
2025-02-09 13:22:17 +01:00
ninjum
5a790ad702 Translated using Weblate (Galician)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:17 +01:00
Oleg
a7fe400db9 Translated using Weblate (Ukrainian)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:17 +01:00
ROllerozxa
ea9f8a9349 Translated using Weblate (Swedish)
Currently translated at 64.5% (893 of 1383 strings)
2025-02-09 13:22:17 +01:00
Stepan Bazrov
0db69655e1 Translated using Weblate (Russian)
Currently translated at 100.0% (1383 of 1383 strings)
2025-02-09 13:22:17 +01:00
sfan5
2515a40fff Fix some setting descriptions 2025-02-09 13:22:17 +01:00
wrrrzr
045951b23c
Const correct Thread class (#15741) 2025-02-09 12:20:47 +01:00
sfence
9166b57c2a
Try to fix macOS signature problem 2025-02-09 12:20:30 +01:00
Lars Müller
fd8d04ff76
GUI inventory list: Do not render clipped slots (#15764) 2025-02-09 12:19:25 +01:00
Miguel P.L
6def21b5e3
Rename Minetest to Luanti in CONTRIBUTING.md 2025-02-09 12:19:16 +01:00
grorp
2fb9e4d18a Fix enum setting used as requirement 2025-02-06 19:20:44 +01:00
siliconsniffer
36c9742c0a
Main menu server list: Select first compatible search result (#15755)
Fixes a bug where an incompatible server would be selected instead due to being the "first" result before grouping.
2025-02-06 19:19:38 +01:00
Montandalar
ec83312540
Change main website domain to www.luanti.org (#15748)
Renames all remaining occurences of minetest.net except for the "MS Windows icon resource" file
2025-02-06 19:16:24 +01:00
sfan5
1548b2ae9e
Update credits for 5.11.0 (#15753) 2025-02-05 21:02:09 +01:00
sfan5
0fa56a9f7c Revert "Prefer GL3 driver over legacy GL driver"
This reverts commit 9f52f84f2b
and ded8c25e34.
2025-02-04 12:19:18 +01:00
sfan5
88b007907a
Enable relative mouse mode on Android (#15750)
fixes #15727
2025-02-04 12:19:09 +01:00
Lars Müller
a73e71510a
Clamp client-sent movement speed control (#15721)
Results in the `movement_x` and `movement_y` fields of `player:get_player_control()` being safe to use
(otherwise users would need to compute the length as `(x^2 + y^2)^0.5` and clamp that to 1 themselves).
2025-02-04 12:19:00 +01:00
SmallJoker
b2a6c3ba23 Server: undo inventory client prediction
The affected player inventory list is now marked as modified.
This way, it will also be re-sent if the server denies the action.
2025-02-02 19:05:09 +01:00
SmallJoker
8caf922df6 InvRef: deduplicate code 2025-02-02 19:05:09 +01:00
SmallJoker
5419345dff
PauseMenuScripting: resolve absolute 'builtin' path before substring check (#15720)
In 99% of the cases, this behaviour is identical to before.
With this commit, it is again possible to have 'builtin' a symlink that e.g.
points to the engine source directory, which is helpful for development purposes.
2025-02-02 19:04:50 +01:00
cx384
a8c4c55d58
Document that object properties colors field is unused (#15685) 2025-02-02 19:04:18 +01:00
wrrrzr
f17498b049
Delete irrlichttypes_extrabloated.h (#15723)
Co-authored-by: cx384 <cx384@proton.me>
2025-02-01 13:41:51 +01:00
Stefan Beller
63e9b01f7d COSOperator: Use NSPasteboardTypeString instead of NSStringPboardType
According to https://developer.apple.com/documentation/appkit/nsstringpboardtype?language=objc
we can replace it with NSPasteboardTypeString:

> In apps that adopt App Sandbox, use an NSURL object, a bookmark, or a
> filename pasteboard type instead. In a nonsandboxed app, you can also
> use the NSPasteboardTypeString pasteboard type.
2025-02-01 13:41:17 +01:00
cathanof
db97b2bd93
Updates some Minetest references to Luanti (#15712) 2025-02-01 13:40:45 +01:00
sfan5
c0422b18e7
Propagate peer ID change to outgoing reliables (#15680)
Otherwise a desync could ocurr since the server does strict checking.
fixes #15627
2025-02-01 13:23:00 +01:00
sfan5
29cfb6efff
Disable SDL2 for 5.11.0 (#15704)
see #14545
2025-01-26 19:18:18 +01:00
Mark Wiemer
ffb4a5b565
Rename dev.minetest.net to dev.luanti.org (#15718) 2025-01-26 19:17:36 +01:00
AFCMS
99a27b7495
Fix documentation for the official Docker image (#15713) 2025-01-26 19:17:26 +01:00
cx384
e9826f7819
Move EnumString to separate file and add enum_to_string (#15714) 2025-01-26 19:17:14 +01:00
Erich Schubert
bee541f378
Lua get_biome_data: calc heat and humidity only once (#15715) 2025-01-26 19:17:02 +01:00
sfan5
45c5ef8798
Restrict relative mouse mode to Wayland users (#15697) 2025-01-26 19:16:46 +01:00
Stefan Beller
282c81fe3a
filesys: replace goto by #else to avoid compiler warning 2025-01-25 10:48:15 +01:00
sfan5
b861f0c5c5
Fix shadow flicker on camera offset update (#15709) 2025-01-25 10:47:52 +01:00
Lars Müller
7c6ade0fc5
Restore proper rollback database indexing (#15707) 2025-01-24 16:50:59 +01:00
grorp
41dfac96c1
Add setting callbacks for Camera and TouchControls (#15700) 2025-01-24 16:50:51 +01:00
sfan5
b5e084c9a5
Update github URL references (#15705) 2025-01-24 16:50:39 +01:00
fineless71
f592b57dc6
Fixed serialization_version and version_string key name in docs (#15699) 2025-01-23 12:18:30 +01:00
sfan5
a99e985674
Centralize arbitrary area volume limit and raise it (#15696) 2025-01-23 12:18:20 +01:00
SFENCE
af3f696423 Code style fixes. 2025-01-21 16:29:12 +01:00
SFENCE
24e9db07ec Check for indent spaces and fixed found problems. Lib C/C++ code is not checked. 2025-01-21 16:29:12 +01:00
Lars Müller
547e1476bb
Allow overriding fonts via media files (#15606)
Co-authored-by: sfan5 <sfan5@live.de>
2025-01-19 20:42:40 +01:00
grorp
eeb6cab4c4
In-game settings menu using separate Lua environment (#15614) 2025-01-19 13:07:04 -05:00
sfan5
3cb07d5fb6 Add limited game auto-selection to dedicated server 2025-01-19 18:39:32 +01:00
sfan5
a262be6a47 Move camera offset to consistent point in game loop
fixes #10027
2025-01-19 18:39:32 +01:00
sfan5
e5f276ecee Apply some minor code cleanups 2025-01-19 18:39:32 +01:00
sfan5
94239153b5 Fix map rendering glitches on camera offset update
(regression)
2025-01-19 18:39:32 +01:00
Zughy
f6a0bf915d
Remove built-in knockback in next major release 2025-01-18 00:27:57 +01:00
Lars Müller
8719a816e7
Fix CMatrix<T>::getScale returning negative scale (#15687) 2025-01-18 00:27:27 +01:00
rubenwardy
c8b5e3b741
Update my email in SECURITY.md 2025-01-15 22:15:48 +01:00
sfan5
cf074dd271
Cache grouped sparse buffers (#15594)
continuation of #15531
2025-01-14 23:40:57 +01:00
cosin15
7053348e31
Fix buggy memcpy call in a template (#15672) 2025-01-14 20:26:29 +01:00
DS
2bfcd45b35
Fix always waving semitransparent liquid regression 2025-01-13 09:39:20 +01:00
sfan5
636a734d78
Resolve some quirks with (wield) item meshes for nodes (#15654) 2025-01-13 09:39:06 +01:00
cx384
464cc92521 Main menu server tab mods button (#15561)
Co-authored-by: Lars Müller <appgurulars@gmx.de>
2025-01-12 16:23:56 +01:00
cx384
5aeaf20849 CI png optimized check 2025-01-12 16:15:01 +01:00
cx384
1427a98c59 Optimize png files 2025-01-12 16:15:01 +01:00
sfan5
903d13ffff Make sure mod paths are always absolute 2025-01-12 14:49:25 +01:00
sfan5
d0d7c11fe1 Stop ServerThread immediately on errors 2025-01-12 14:49:25 +01:00
sfan5
9dd09d1056 Prevent VoxelManipulator size overflow 2025-01-12 14:49:25 +01:00
sfan5
2cdf3af1b8 Reduce size of SMaterial struct 2025-01-12 14:49:25 +01:00
Hanicef
be75e42d77
Improve sleep accuracy on FPS limiter (#15648) 2025-01-12 14:49:13 +01:00
chmodsayshello
d4a6df3389
Add chat console scrollbar (#15104) 2025-01-12 14:49:01 +01:00
lhofhansl
d15214af52
Remove shadow direction quantization, increase shadow update frames instead (#15665)
* This removes shadow direction quantization and defaults shadow_update_frames to 16 instead.
2025-01-11 16:41:50 -08:00
Desour
d044c27b5f MeshMakeData: Explain members, and add grid size and minimap flag 2025-01-11 16:43:37 +01:00
Desour
c0ce918d77 Meshgen: Handle enable_water_reflections like smooth_lighting 2025-01-11 16:43:37 +01:00
Desour
9a60b83061 Rename meshgen lighting variables 2025-01-11 16:43:37 +01:00
Desour
7ba5973108 Get rid of MapblockMeshGenerator::cur_node.light 2025-01-11 16:43:37 +01:00
Desour
c4bfa65201 Fix black plantlike_rooted without smoothlighting
There was code to take the light of the node above, but the color was not updated.
To reproduce, don't set paramtype="light", (i.e. not what all the devtest nodes do).
2025-01-11 16:43:37 +01:00
Desour
6a1b4a93c7 MapblockMeshGenerator: Move unsmooth lighting color out of useTile, and instead compute it once per node 2025-01-11 16:43:37 +01:00
Desour
3becbda0aa Get rid of MapblockMeshGenerator::cur_node.scale 2025-01-11 16:43:37 +01:00
Desour
a14b8d0976 Get rid of MapblockMeshGenerator::cur_node.tile
There is more than one tile per node, so it shouldn't be stored like this.
This makes MapblockMeshGenerator less stateful.
2025-01-11 16:43:37 +01:00
Desour
966abc85da transformNodeBox(): Rotate first by facedir 2025-01-11 16:43:37 +01:00
Desour
1e81c454c8 transformNodeBox(): Replace BOXESPUSHBACK macro with a lambda 2025-01-11 16:43:37 +01:00
Desour
cbc074feb5 Remove the unnecessary MeshCollector::append overload 2025-01-11 16:43:37 +01:00
DS
436b391a80
VoxelArea: Fix missing cacheExtent calls in helpers (#15657) 2025-01-11 16:43:20 +01:00
cosin15
37899f7a14
Fix CFileSystem::FileSystemType related UB (#15669) 2025-01-11 16:42:36 +01:00
sfan5
e5542e5b02
Remove or restrict some client settings (#15633) 2025-01-08 10:56:45 +01:00
sfan5
41f7031e49
Fix reduced bloom at 10 bits
forgotten in eb8beb335e
2025-01-08 10:56:28 +01:00
Lars Müller
7f1316236b
Silence failing raycast unit test (#15644)
The cause for the test failure is an edge case bug
in the raycast implementation (perfectly diagonal raycasts).

This is fixed by switching to a continuous random distribution
which makes it extremely unlikely that the buggy edge case occurs.

Additionally, devtest unit test failures now print their random seed
to be easier to reproduce in the future.
2025-01-08 10:56:05 +01:00
sfan5
c346612468
Fix falling nodes digging nodes they aren't supposed to (#15638) 2025-01-06 19:42:11 +01:00
DS
431c5c8b36
Fix wireframe mode in opengl3 driver (#15626)
`GL_LINES` isn't suitable, because it makes lines between pairs of 2 vertices,
not loops around 3 vertices.
Support for OpenGL ES isn't simple, as it has no `glPolygonMode`. And showing broken
wireframe (i.e. with `GL_LINES`) would cause confusion.
2025-01-06 19:39:17 +01:00
Lars Müller
f467bde6ac
Add unit test for raycasts falsely skipping nodes (#15555) 2025-01-05 16:32:09 +01:00
sfan5
06f39e1915 Fix missing bounding box for CAO 'wielditem' visual 2025-01-05 16:30:53 +01:00
sfan5
4774e65ed9 Implement polygon offset in GL3 driver 2025-01-05 16:30:53 +01:00
sfan5
5b14c03301 Use polygon offset to fix z-fighting for overlay tiles 2025-01-05 16:30:53 +01:00
wrrrzr
dfd7628950
Rename getGameMinetestConfig to getGameConfig 2025-01-05 13:20:37 +01:00
DS
4c4918b154
Fix show_debug setting causing inconsistency between debug control and shown debug info 2025-01-05 13:20:21 +01:00
sfan5
5bcb7983ec Fix missing bounding box for upright_sprite
(also simplifies the mesh building)
fixes #15616
2025-01-04 12:40:14 +01:00
sfan5
0614b175b5 Optimize draw3DBox generic case 2025-01-04 12:40:14 +01:00
sfan5
4e2ca05f08 Add debug mode that shows mesh buffer bounding boxes 2025-01-04 12:40:14 +01:00
sfan5
9554e3d43a Add support for glObjectLabel to aid debugging 2025-01-04 12:40:14 +01:00
wrrrzr
d2004d32f6
Move AutoExposure constructor to header 2025-01-04 12:39:52 +01:00
SmallJoker
e8f6127779
Reduce irrlicht_extrabloated.h includes in header files 2025-01-04 12:39:34 +01:00
sfan5
81f51492ff
Don't silence errorstream in tests (#15629) 2025-01-04 12:39:16 +01:00
JosiahWI
eb512cc36a
Eliminate superfluous null check in CGUIEnvironment::getNextElement 2025-01-04 12:38:38 +01:00
cx384
c4d624083d Main menu server tab search improvements 2025-01-02 15:22:49 +01:00
wozrer
a1b8d20f18 Rename getMapSettingNoiseParams to getNoiseParams 2025-01-02 14:59:19 +01:00
sfan5
0a67e6180d Disable failing unit test for the time being
see #15598
2025-01-02 12:42:19 +01:00
lhofhansl
2db4ad8c77
Fix MSAA and bloom flashing artifacts (#15610)
* Mark varColor and nightratio as centroids
* Leave old workaround in place for GLES
2025-01-01 14:18:05 -08:00
grorp
f54d209bc8
Remove normal map leftovers (#15609)
leftovers from #10487 / ed22260822
2024-12-31 19:28:57 +01:00
sfan5
a4d2633ac6 Minor improvements in ImageSource code 2024-12-31 14:47:46 +01:00
sfan5
f37f9a6f0b Optimize getImageAverageColor
also fixes a bug with non-square handling

before:
  getImageAverageColor [us] _____________________  804x  11.253

after:
  imageAverageColorInline [us] __________________  804x   0.557
2024-12-31 14:47:46 +01:00
sfan5
ded8c25e34 Change default post_processing_texture_bits to 10
Since the legacy GL driver is no longer the default,
we don't run into a situation where an unintended fallback to 8-bit happens.
2024-12-31 14:47:46 +01:00
sfan5
1a6ae148b7 Update texture_min_size description 2024-12-31 14:47:46 +01:00
sfan5
8c52d5f2dd Implement LODBias in GL3 driver
(currently unused)
2024-12-31 14:47:46 +01:00
sfan5
1ea8763259 Clean up Irrlicht shader API 2024-12-31 14:47:46 +01:00
sfan5
40afc84597 Replace data structure for HW buffer book-keeping
before
  time in endScene ÷ num hw buf ________________  199x   0.128
after
  time in endScene ÷ num hw buf ________________  199x   0.057
2024-12-31 14:47:46 +01:00
sfan5
a2058f7f3a Avoid some inefficiencies when handling ItemStack(Metadata) 2024-12-31 14:47:46 +01:00
sfan5
d884a1624f Show active HW buffers in profiler 2024-12-31 14:47:46 +01:00
grorp
b50b619be7
Add explanation to touchscreen item tooltip code (#15607)
this explains some cryptic inventory code I wrote in #14029 / 771da80bbb
2024-12-31 14:11:17 +01:00
grorp
27c3aade5d
TouchControls: More methods instead of static functions (#15602) 2024-12-30 19:03:32 +01:00
sfan5
f2b1cc3e61
Fix situation around aabbox3d default constructor (#15586)
Co-authored-by: JosiahWI <41302989+JosiahWI@users.noreply.github.com>
2024-12-29 14:36:30 +01:00
wrrrzr
cca65fde08
Controls: extract init_joysticks (#15597) 2024-12-28 22:05:01 +01:00
SmallJoker
35bc217ba8
IrrlichtMt: Move OpenGL 3+ transformation matrix to shaders (#15591)
This replaces annoying calculations on C++-side and eases the
implementation of 2D geometry batch rendering a lot.
2024-12-28 22:04:05 +01:00
Lars Müller
412cc96bc9
Fix some compiler warnings (#15596) 2024-12-26 11:29:00 +01:00
sfan5
d2a7875b5b Group sparse mesh buffers over entire scene for rendering 2024-12-24 15:27:08 +01:00
sfan5
612d4f9656 Improve quicktune feature a bit 2024-12-24 15:27:08 +01:00
sfan5
33b8307119 OpenGL: allow uploads of buffers to hardware ahead-of-time 2024-12-24 15:27:08 +01:00
sfan5
bb550158fc OpenGL: encapsulate VBOs into a class
internal only for now but this will be handy
2024-12-24 15:27:08 +01:00
Lars Müller
b087e2554f
Add glTF STEP interpolation support (#15525) 2024-12-24 15:25:07 +01:00
SmallJoker
d1dd044455
Reorder client initialization (#15554)
Previously, ServerEnv created a player instance before they're fully initialized.
This commit moves all initialization steps and callbacks into TOSERVER_CLIENT_READY
^ which includes StageTwoClientInit for player loading or creation
2024-12-24 15:24:56 +01:00
sfan5
c49ff76955
IGUIFont / CGUITTFont code cleanups (#15581) 2024-12-23 12:49:47 +01:00
sfan5
0bfd9bc09e Condense renderer information into a single string 2024-12-23 12:49:31 +01:00
sfan5
9f52f84f2b Prefer GL3 driver over legacy GL driver 2024-12-23 12:49:31 +01:00
cx384
83bc27d99d Move formspec code from game.cpp to separate file 2024-12-21 18:43:05 +01:00
sfan5
d4ccc8de79 Fix incorrect handling of skinned meshes as mesh nodes
fixes #15576
2024-12-20 19:04:56 +01:00
siliconsniffer
7bf0b1fc7e
Add server url button to main menu (#15536)
Co-authored-by: Zughy <63455151+Zughy@users.noreply.github.com>
2024-12-20 15:04:26 +01:00
sfan5
a6293b9861 Initial refactoring on shader usage and generation
`IShaderSource` was designed with the idea that if you want a shader,
you must want it for a node. So it depends heavily on being given a tile
material and the node drawtype. But this doesn't make sense neither in theory
nor in practice.
This commit takes a small step towards removing the incorrect abstraction.
2024-12-20 15:04:08 +01:00
sfan5
eb8beb335e Fix bloom with post_processing_texture_bits < 16 2024-12-20 15:04:08 +01:00
sfan5
7354cbe463 Fix core::array::reallocate when shrinking 2024-12-20 15:04:08 +01:00
cx384
f06383f78c
Minor API reference fixes 2024-12-20 15:03:55 +01:00
cx384
b172e67295
Remove game_ui from Client class 2024-12-20 15:03:45 +01:00
sfan5
10f1e142f6
Fix threshold value for imageCleanTransparent
fixes #15401
2024-12-20 15:03:30 +01:00
Lars Müller
a37bdbf8b7
Restore .x models to working state (#15550)
* Add "lava flan" (.x model) smoke test

* Fix double finalize in `.x` mesh loader

* Use reserve instead of resize again

The weights are added indirectly via `AnimatedMesh->addWeight`
2024-12-18 20:29:35 +01:00
Lars Müller
f99a1a7c7c Revert "Optimize raycast performance (#15233)"
This reverts commit f7a695c212.
2024-12-14 19:29:00 +01:00
Lars Müller
52a6673dab
Get rid of obsolete workaround for collision detection bugs (#15540) 2024-12-14 17:04:12 +01:00
Lars Müller
fef28aced9
Irrlicht: Get rid of obsolete setDebugName (#15541)
Co-authored-by: sfan5 <sfan5@live.de>
2024-12-14 17:03:08 +01:00
Lars Müller
23e502fa0e
Test & document conventions used by matrix4::setRotation* (#15542)
Also includes a minor `matrix4::transformVect` refactor to make testing easier.
2024-12-14 17:02:16 +01:00
sfence
f7a695c212
Optimize raycast performance (#15233)
by skipping nodes not on the ray with selection boxes smaller than 1x1x1 early on
2024-12-14 17:01:06 +01:00
Wuzzy
ba63c1505a
Docs: Change translation example from NS to PS (#15476)
The currently established convention uses `NS` for "translation no-ops", i.e., it will be collected by a string-collecting utility but not be translated by Luanti at this place.

We don't want to mislead modders with this example into using `NS` for plural forms instead, breaking with the established convention and making use of automated tools harder.

See also: https://github.com/minetest/modtools/pull/11
2024-12-14 16:59:29 +01:00
y5nw
ac7406c8a1
Fixup parsing for Plural-Forms (#15519) 2024-12-12 15:33:34 +01:00
Lars Müller
1e59b9a756
Refactor SkinnedMesh (#15522) 2024-12-12 15:33:08 +01:00
SmallJoker
d123bc0951
Main menu: show favorite removal button for offline servers (#15530)
This fixes a regression from 6c324cb871.
2024-12-12 15:31:48 +01:00
Timur1324
9f71e74158
Get server list over https (#15538) 2024-12-12 15:31:12 +01:00
DS
bcbee873e8
Use openssl's sha1 and sha256, optionally (#15472) 2024-12-10 22:00:43 +01:00
sfan5
4f800dd2b4 Change VoxelArea volume to be u32 2024-12-10 22:00:28 +01:00
sfan5
67126cbd1b Fix meaning of VoxelArea::hasEmptyExtent() 2024-12-10 22:00:28 +01:00
sfan5
8957739cdf Use appropriate sized type for VoxelArea extent 2024-12-10 22:00:28 +01:00
Lars Mueller
3c5e0d10fc Rotate meshnode normals correctly instead of recalculating 2024-12-10 22:00:18 +01:00
sfan5
21437090b8 Don't recalculate meshnode normals unnecessarily 2024-12-10 22:00:18 +01:00
siliconsniffer
eb6731bdc6
Main menu: Add server favorite button (#15486)
This adopts PR 13446.
2024-12-08 20:28:37 +01:00
SmallJoker
480eb7d816 Mapgen: Fix biome Y calculation regression
BiomeGen::getNextTransitionY(y) did not guarantee the condition (y < biome_y_min)
of the next loop because the function may return the value (biome_y_min - 1).
Hence, the biome was not updated until one Y coordinate after.
2024-12-08 20:27:33 +01:00
SmallJoker
50928b9759 Mapgen: Add rudimentary unittests 2024-12-08 20:27:33 +01:00
cx384
c7fe2ee5c9
Add core.spawn_tree_on_vmanip (#15415)
This function works like `core.spawn_tree`, but spawns an L-system tree onto a VoxelManip object instead on the map.
2024-12-08 20:27:22 +01:00
Lars Müller
8d43ad2522
Migrate rendered Lua API docs CNAME to api.luanti.org 2024-12-08 19:48:52 +01:00
Lars Müller
ae96a8d4fa
Fix mainmenu crash if no servers match search
fixes a regression caused by 6c324cb
2024-12-06 22:01:31 +01:00
veprogames
b857798848
Fix distorted Sun, Moon and Star visuals based on Orbit Tilt (#15459) 2024-12-06 22:00:06 +01:00
SmallJoker
5a8412dd23
Formspec: Move tooltip above cursor when lacking space (#15470) 2024-12-06 21:59:51 +01:00
cx384
88c845166c
Fix L-System trees fruit node regression (#15513) 2024-12-06 18:06:27 +01:00
Lars Müller
05d31222f7
Allow non-normalized weights in glTF models (#15310)
We are being lax here, but the glTF specification just requires that "when the weights are stored using float component type, their linear sum SHOULD be as close as reasonably possible to 1.0 for a given vertex"

In particular weights > 1 and weight sums well below or above 1 can be observed in models exported by Blender if they aren't manually normalized.
These fail the glTF validator but Irrlicht normalizes weights itself so we can support them just fine.

The docs have been updated to recommend normalizing weights (as well as documenting the status of interpolation support).

Weights < 0, most of them close to 0, also occur. Consistent with Irrlicht, we ignore them, but we also raise a warning.
2024-12-06 18:05:03 +01:00
Lars Müller
3e10d9ccf5
Refactor: Merge [IC]SkinnedMesh into SkinnedMesh (#15511) 2024-12-06 18:03:44 +01:00
sfan5
810f39767c Move SMaterial std::hash impl to its header 2024-12-04 18:20:34 +01:00
sfan5
a799a54894 Fix some issues with mt_opengl 2024-12-04 18:20:34 +01:00
sfan5
1fb7202028 GL: fix and clean up some code 2024-12-04 18:20:34 +01:00
sfan5
36edc3f161 Add 10-bit texture format and setting to chose PP color depth
(and move some settings to the advanced category)
2024-12-04 18:20:34 +01:00
AFCMS
e545e96d2b
Make string to v3f parsing consistent, replace core.setting_get_pos() by core.settings:get_pos() (#15438)
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2024-12-04 18:19:46 +01:00
Lars Müller
18caf3a18d
Fix false positive compiler warning 2024-12-04 18:19:12 +01:00
HybridDog
a45b04ffb4
Less explicit memory management in Irrlicht image writer classes (#15493)
CImageWriterPNG::writeImage() and writeJPEGFile() explicitly allocate
and deallocate memory with `new` and `delete`, which is prone to programming errors.
The code also has non-functional error handling:
When memory allocation fails, `new` throws an `std::bad_alloc` exception
and never returns `nullptr`, so the check for `nullptr` is always false.

Co-authored-by: DS <ds.desour@proton.me>
2024-12-03 16:52:48 +01:00
JosiahWI
03813a5b5e
Use CMake list directives where appropriate
I think this communicates the intent a little better than using a `set`
directive, and it makes the code a little less verbose, too.
2024-12-03 16:52:15 +01:00
JosiahWI
818bca68d1
Use add_compile_options where appropriate 2024-12-03 16:51:53 +01:00
sfan5
a4d1b5b155
Fix script security path normalization in presence of links (#15481) 2024-12-03 16:51:34 +01:00
wrrrzr
e9080f91f2
Cleanup ban.cpp/h (#15496)
Make BanManager more const correctly
Delete unused includes
2024-12-01 20:52:13 +01:00
Kevin @ Sesam Solutions
7cc5a6ec68
Add Minetest keyword for backwards compatibility (#15491)
This helps people looking for `minetest`
2024-12-01 20:51:33 +01:00
JosiahWI
c3db9492a7
Update CMakeLists to use add_compile_definitions (#15483)
This is a newer feature introduced in CMake 3.12, which is now our
minimum version. It supercedes `add_definitions`. I've also replaced
some calls to set `CMAKE_<LANG>_FLAGS` that were used to set
definitions. This is a fairly trivial routine build maintenance that
is not intended to have any behavioral effects.
2024-11-29 12:02:48 +01:00
Lars Müller
d068f34753
Get rid of definitelyIdentityMatrix (#15480) 2024-11-29 12:00:09 +01:00
DS
df4e70b2c7
Add a setting to group transparency sorted triangles by buffer (#15115) 2024-11-28 14:22:53 +01:00
SmallJoker
c175046d30
Network: Fix serialization version checks (#15477)
This fixes some incorrect assumptions that the read and write version ranges are identical - whereas they're in fact not.
2024-11-27 18:39:57 +01:00
Lars Müller
6c324cb871
Main menu: Fix server selection (#15466)
Server selections are now always correct (no more arbitrarily changing selections if the order of the serverlist changes) and consistent with the address + port in the sidebar.
2024-11-27 18:39:28 +01:00
lhofhansl
8c56434bd3
Clamp pre-bloom color to valid range (#15453)
That avoids flashing artifacts when combining MSAA and bloom.
2024-11-25 11:56:32 -08:00
Lars Müller
b77ad82fb9
Sanitize invalid particle spawner time (#15465) 2024-11-24 19:23:53 +01:00
veprogames
11b19cd126
Doc: Add missing jpeg package for Arch Linux (#15461) 2024-11-24 19:23:32 +01:00
grorp
6a1d22b2c5
Implement an editor to customize the touchscreen controls (#14933)
- The editor is accessible via the pause menu and the settings menu.
- Buttons can be moved via drag & drop.
- Buttons can be added/removed. The grid menu added by #14918 is used to show
  all buttons not included in the layout.
- Custom layouts are responsive and adapt to changed screen size / DPI /
  hud_scaling.
- The layout is saved as JSON in the "touch_layout" setting.
2024-11-24 11:33:39 +01:00
luk3yx
4faa16fe0d
Clarify behaviour of core.hypertext_escape (#15464) 2024-11-22 17:56:35 +01:00
siliconsniffer
b6eaf7b5a4
Main menu: Player list for public servers (#15425) 2024-11-21 20:34:40 +01:00
Richard Try
946b3a4222
Typo in lua_api.md (#15440)
Duplicate text removed.
2024-11-20 18:36:35 +00:00
Christian Betancourt Dias
b63e988bd6
Fix naming conventions for CMatrix4::set(Inverse)RotationRadians() (#15204) 2024-11-19 13:38:19 +01:00
Lars Müller
15e8f9e6a0
Fix rendering regression with TGA type 1 files with BGRA8 color (#15402)
TGA uses BGR(A)8, stored in memory in that order. Irrlicht typically expects 0xAARRGGBB, which depends on endianness.
(This means that on little endian, no [B][G][R][A] -> 0xAARRGGBB conversion needs to be done, but Irrlicht was swapping the bytes.)

This makes both conversion functions consistently convert from [B][G][R]([A]) to 0xAARRGGBB (SColor), documents them properly and moves them to CImageLoaderTGA.cpp
so no poor soul shall be fooled by them in the near future.

---------

Co-authored-by: Ælla Chiana Moskopp <erle@dieweltistgarnichtso.net>
2024-11-19 13:37:05 +01:00
Lars Müller
138052adfc
Add particle blend mode "clip" (#15444)
This lets modders avoid alpha blending rendering bugs as well as potential (future) performance issues.
The appropriate blend modes are also used for node dig particles.

---------

Co-authored-by: sfan5 <sfan5@live.de>
2024-11-19 13:30:17 +01:00
sfan5
f493e73aeb Fix changing secure settings from mainmenu
forgotten in ea4ae55e24
closes #15454
2024-11-18 23:58:42 +01:00
grorp
9b6a399011
Implement support for FSAA in combination with post-processing (#15392)
- Actually it's MSAA I think, or perhaps the terms are equivalent
- I've made it fit into the existing Irrlicht architecture, but that has resulted in code duplication compared to my original "hacky" approach
- OpenGL 3.2+ and OpenGL ES 3.1+ are supported
- EDT_OPENGL3 is not required, EDT_OPENGL works too
- Helpful tutorial: https://learnopengl.com/Advanced-OpenGL/Anti-Aliasing, section "Off-screen MSAA"
- This may be rough around the edges, but in general it works
2024-11-18 14:06:48 +01:00
veprogames
a8ea165042
Replace occurences of 'wiki.minetest.net' with 'wiki.luanti.org' 2024-11-18 00:04:32 +01:00
HybridDog
7295b6c88c
Remove unused and rarely used irrlicht color functions (#15442)
SColor.h contains many functions which are unused and/or perform linear
operations on non-linear 8 bit sRGB color values, such as the plus operator and
`SColor::getInterpolated()`, and there is no documentation about missing gamma
correction.
Some of these functions are not called or called only once:
* `getAverage(s16 color)`: Unused
* `SColor::getLightness()`: Unused
* `SColor::getAverage()`: Claims to determine a color's average intensity but
  calculates something significantly different since SColor represents
  non-linear sRGB values.
* `SColor::getInterpolated_quadratic()`: Claims to interpolate between colors
  but uses the sRGB color space, which is neither physically nor perceptually
  linear.
* `SColorf::getInterpolated_quadratic()`: Unused
* `SColorf::setColorComponentValue()`: Unused

Removing or inlining these functions can simplify the code and documenting
gamma-incorrect operations can reduce confusion about what the functions do.

This commit does the following:
* Remove the above-mentioned unused functions
* Inline `SColor::getAverage()` into
  `CIrrDeviceLinux::TextureToMonochromeCursor()`
* Rename `SColor::getLuminance()` into `SColor::getBrightness()` since it does
  not determine a color's luminance but calculates something which differs
  significantly from physical luminance since SColor represents non-linear sRGB
  values.
* Inline `SColor::getInterpolated_quadratic()` into `GameUI::update()`,
  where it is only used for the alpha value calculation for fading
* Document gamma-incorrect behaviour in docstrings
2024-11-18 00:02:53 +01:00
sfan5
8d2e770361 Minor corrections in gl3/gles2 drivers 2024-11-16 16:54:22 +01:00
sfan5
cc8c3d501c Don't keep a copy of all texture images around 2024-11-16 16:54:22 +01:00
sfan5
58ccf0ba82 Fix some smaller issues with texture/image handling 2024-11-16 16:54:22 +01:00
sfan5
4aae31ad5e Add support for ECF_D24 texture format
and prefer it over D32 for our depth buffer, this can have performance benefits
2024-11-16 16:54:22 +01:00
sfan5
3c42cc8684 Revive texture download code and fix it on GLES 2024-11-16 16:54:22 +01:00
sfan5
11837d4623
Remove BMP image support (#15434)
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
2024-11-15 12:21:30 +01:00
Erich Schubert
46f0baff09
Improve documentation of liquid_surface (#15012) 2024-11-15 12:19:41 +01:00
SmallJoker
8f03b70584 IrrlichtMt: Document Driver/Device compatibility 2024-11-15 12:18:48 +01:00
SmallJoker
4838eb2f7d Non-SDL: Add opengl3 support 2024-11-15 12:18:48 +01:00
SmallJoker
87ac32edea Dynamic shadows: whitelist the 'opengl3' driver 2024-11-15 12:18:48 +01:00
sfence
58dd42166d
Add some info to compiling README 2024-11-15 11:39:08 +01:00
grorp
a9fe83126a
Get rid of depth buffer workaround in the render pipeline code (#15407)
I originally wanted to get of the legacy IVideoDriver::setRenderTarget altogether,
but that ended up being too much work.
The remaining usage is in "dynamicshadowsrender.cpp".

Here's a comment I wrote about the workaround:

----------------------------------------

Use legacy call when there's single texture without depth texture
This means Irrlicht creates a depth texture for us and binds it to the FBO

This is currently necessary for a working depth buffer in the following cases:

- post-processing disabled, undersampling enabled
  (addUpscaling specifies no depth texture)

- post-processing disabled, 3d_mode = sidebyside / topbottom / crossview
  (populateSideBySidePipeline specifies no depth texture)

- post-processing disabled, 3d_mode = interlaced
  (probably, can't test since it's broken)
  (populateInterlacedPipeline specifies no depth texture)

With post-processing disabled, the world is rendered to the TextureBufferOutput
created in the functions listed above, so a depth buffer is needed
(-> this workaround is needed).
With post-processing enabled, only a fullscreen rectangle is rendered to
this TextureBufferOutput, so a depth buffer isn't actually needed.
But: These pipeline steps shouldn't rely on what ends up being rendered to
the TextureBufferOutput they provide, since that may change.

This workaround was added in 1e96403954 /
https://irc.minetest.net/minetest-dev/2022-10-04#i_6021940

This workaround should be replaced by explicitly configuring depth
textures where needed.

----------------------------------------
2024-11-15 11:38:56 +01:00
cx384
d4378a74d3
Fix register_ore ore_type error handling 2024-11-15 11:37:17 +01:00
sfan5
0c3117f9b3 Fix mainmenu settings crash caused by last commit
closes #15432
2024-11-13 18:39:10 +01:00
sfan5
794aea8e92
Drop fixed pipeline support code (#15421)
OpenGL 2.0 is now mandatory.
2024-11-13 14:24:01 +01:00
veprogames
0fde9ab7e8
Change minetest.net to luanti.org in 'Further documentation' 2024-11-13 14:23:39 +01:00
grorp
11e04ec113
Replace forgotten SEvent memset 2024-11-13 14:23:13 +01:00
sfan5
ea4ae55e24 Implement script sandboxing for main menu 2024-11-13 14:22:41 +01:00
sfan5
1fd4e0b82d Refactor ScriptApiSecurity for cleaner separation of concerns 2024-11-13 14:22:41 +01:00
Erich Schubert
4c44942a39
Add weights to biomes (#15142) 2024-11-12 10:53:17 +01:00
cx384
44b261d136
Luacheck: add VoxelManip to globals 2024-11-12 10:53:04 +01:00
sfan5
c00129360e Remove unused pos_max_d 2024-11-12 10:52:46 +01:00
sfan5
9a44d835d6 Remove redundant CollisionInfo::plane 2024-11-12 10:52:46 +01:00
sfan5
f916f5de78 Add basic unit tests for collisionMoveSimple 2024-11-12 10:52:46 +01:00
wrrrzr
1c92d6243f
MainMenuManager: fix FIXME (#15414) 2024-11-12 10:52:37 +01:00
grorp
af61de7777
Minor rendering code fixes (#15399)
* Fix line numbers in shader errors
* Fix uninitialized variables in shadow code
2024-11-12 10:52:20 +01:00
sfan5
a5e3fca40c Revert "Disable SDL2 for 5.10.0 (#15284)"
This reverts commit 6d7a519740.
2024-11-10 20:56:09 +01:00
sfan5
8503d8de5e Continue with 5.11.0-dev 2024-11-10 19:17:56 +01:00
sfan5
568f7a8e8f Bump version to 5.10.0 2024-11-10 19:17:53 +01:00
ROllerozxa
a983b72713
Add Fastlane metadata for F-Droid (#15411)
Co-authored-by: grorp <grorp@posteo.de>
2024-11-10 19:08:08 +01:00
sfence
e55ba9c390
Support generation of working Xcode project for signature purposes on MacOS (#15303) 2024-11-10 19:06:52 +01:00
sfan5
ec7738934b CI: fix workflows not running on translation update 2024-11-10 18:31:56 +01:00
chocomint
fbab80fced Translated using Weblate (Spanish (American))
Currently translated at 100.0% (8 of 8 strings)

Translation: Minetest/Minetest Android
Translate-URL: https://hosted.weblate.org/projects/minetest/minetest-android/es_US/
2024-11-10 18:15:45 +01:00
chocomint
3b2abbea70 Added translation using Weblate (Spanish (American)) 2024-11-10 18:15:45 +01:00
gallegonovato
998d1a2b8c Translated using Weblate (Spanish)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
chocomint
9a7471c5c0 Translated using Weblate (Spanish)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
chocomint
21c8c141aa Added translation using Weblate (Spanish) 2024-11-10 18:15:45 +01:00
waxtatect
c2e89c5b6f Translated using Weblate (French)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
Yof
cf76dac464 Translated using Weblate (Ukrainian)
Currently translated at 94.6% (1309 of 1383 strings)
2024-11-10 18:15:45 +01:00
ninjum
d9df06cda3 Translated using Weblate (Galician)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
grorp
66a5ddca25 Translated using Weblate (German)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
gallegonovato
0be1fe11ca Translated using Weblate (Spanish)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
chocomint
812abba33b Translated using Weblate (Spanish)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
gallegonovato
2d6592a804 Translated using Weblate (Spanish)
Currently translated at 100.0% (1383 of 1383 strings)
2024-11-10 18:15:45 +01:00
chocomint
e23c191232 Translated using Weblate (Spanish)
Currently translated at 99.7% (1380 of 1383 strings)
2024-11-10 18:15:45 +01:00
gallegonovato
58ebe0a58f Translated using Weblate (Spanish)
Currently translated at 99.7% (1380 of 1383 strings)
2024-11-10 18:15:45 +01:00
chocomint
000f0c78bc Translated using Weblate (Spanish)
Currently translated at 99.3% (1374 of 1383 strings)
2024-11-10 18:15:45 +01:00
gallegonovato
aaf4877730 Translated using Weblate (Spanish)
Currently translated at 99.3% (1374 of 1383 strings)
2024-11-10 18:15:44 +01:00
chocomint
0c61461b07 Translated using Weblate (Spanish)
Currently translated at 99.1% (1371 of 1383 strings)
2024-11-10 18:15:44 +01:00
gallegonovato
31c50c470c Translated using Weblate (Spanish)
Currently translated at 99.1% (1371 of 1383 strings)
2024-11-10 18:15:44 +01:00
chocomint
62bee9f502 Translated using Weblate (Spanish)
Currently translated at 98.7% (1366 of 1383 strings)
2024-11-10 18:15:44 +01:00
y5nw
112c0719cd Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 91.7% (1269 of 1383 strings)
2024-11-10 18:15:44 +01:00
gallegonovato
c96455b2e4 Translated using Weblate (Spanish)
Currently translated at 98.6% (1365 of 1383 strings)
2024-11-10 18:15:44 +01:00
chocomint
eed109c724 Translated using Weblate (Spanish)
Currently translated at 96.6% (1337 of 1383 strings)
2024-11-10 18:15:44 +01:00
BlackImpostor
f25eaf1261 Translated using Weblate (Russian)
Currently translated at 94.7% (1310 of 1383 strings)
2024-11-10 18:15:44 +01:00
BreadW
e1be22a6ff Translated using Weblate (Japanese)
Currently translated at 94.5% (1308 of 1383 strings)
2024-11-10 18:12:48 +01:00
Wuzzy
5891d0f5ec Translated using Weblate (German)
Currently translated at 99.7% (1380 of 1383 strings)
2024-11-10 18:12:48 +01:00
grorp
2424c64099
Translated using Weblate (German)
Currently translated at 99.7% (1380 of 1383 strings)
2024-11-10 18:11:40 +01:00
sfan5
8b27340b2e Work around Intel driver bug on Win 8.1 and older 2024-11-10 17:44:45 +01:00
sfan5
7557a287e5 Update credits for 5.10.0 2024-11-10 13:23:16 +01:00
sfan5
122b2d70d9 Re-fix CAO mesh lighting with shaders disabled
previously: 65af606729
2024-11-10 13:21:19 +01:00
SmallJoker
4bb9c8c61b
Revert "Fix collisions with long dtime, in particular with bouncing" (#15400)
This reverts commit cb6c8eb2f0.
2024-11-10 13:20:30 +01:00
Lars Mueller
0391d91e5d Improve error messages for failed mesh loading 2024-11-09 18:13:56 +01:00
Lars Müller
77e78193a0
Fix set_bone_override documentation (#15353) 2024-11-09 18:13:36 +01:00
Lars Müller
cce4fe5a3f
Fix wrongly documented glTF frame number restriction
The frame numbers can very well be floats since 06907aa
2024-11-09 17:57:37 +01:00
grorp
50b7523336 ogles 2 driver: Delete some dead code
grepping for IRR_COMPILE_GLES2_COMMON gives no other results

COGLESCoreExtensionHandler is only used through COpenGL3ExtensionHandler
2024-11-08 20:43:24 +01:00
grorp
fced6ff240 Fix ECF_D32 support in ogles2 video driver
OES_depth32 only talks about support for render buffers, not textures,
so it's not relevant here:
https://github.com/KhronosGroup/OpenGL-Registry/blob/main/extensions/OES/OES_depth32.txt

This fixes the scene being black with "video_driver = ogles2" and
"enable_post_processing = true" on my desktop computer.
2024-11-08 20:43:24 +01:00
grorp
bafc477919
Revert "2D rendering: Enable bilinear filter for downscaling textures" (#15385)
This reverts commit minetest/irrlicht@fb7a0e4298.
2024-11-08 11:17:15 +01:00
Ælla Chiana Moskopp
60cd1e4529 Correctly render transparency in TGA type 1 with color format A1R5G5B5
The branch removed in this patch handled color format A1R5G5B5 specially
when creating a texture from a TGA type 1 file, i.e. an image that has a
colormap. It did not handle the 1-bit alpha channel correctly, rendering
transparent pixels black instead.

Since the colormap is converted to A8R8G8B8 earlier anyways, the code
for the general case is able to handle this scenario already – at the
expense of making the created texture use twice as much GPU memory as
necessary.
2024-11-06 20:07:05 +01:00
Lars Müller
1fa4ca7c59
Switch to a more neutral ASCII art banner (#15356) 2024-11-06 20:06:39 +01:00
veprogames
db04964697 Content browser: Fix broken forum URLs
Repeated prepending would break these URLs.
This fix uses the freshly added `forum_url` field directly.
2024-11-06 20:06:26 +01:00
sfan5
294a30e445 Fix ScriptApiSecurity::checkPath mangling non-existent paths
bug introduced in 1c1c97cbd1
2024-11-03 19:27:08 +01:00
veprogames
9982c56373
Replace occurences of 'forum.minetest.net' with 'forum.luanti.org' (#15372) 2024-11-03 15:10:58 +01:00
SmallJoker
c884e7181f
JsonCPP: restore '1.0.0+' compatibility (#15368)
Previously, compiling on Ubuntu 20.04 would fail with the system-provided JsonCPP
version (1.7.4). Which would satisfy the documented requirement of "1.0.0+".
2024-11-03 15:10:39 +01:00
Lars Müller
3064f3ccb7
Fix model[] being lit wrongly if shaders are disabled (#15364) 2024-11-03 15:10:21 +01:00
Lars Müller
0e06590ffd
Apply "and" to server list & content search terms (#15365) 2024-11-03 15:09:47 +01:00
sfan5
e952a0807b
Use servers.luanti.org (#15369) 2024-11-02 20:40:45 +00:00
rubenwardy
ba370d9841
Use content.luanti.org (#15360) 2024-11-02 20:40:33 +00:00
746 changed files with 75000 additions and 62998 deletions

View file

@ -1,4 +1,4 @@
Checks: '-*,modernize-use-emplace,modernize-avoid-bind,misc-throw-by-value-catch-by-reference,misc-unconventional-assign-operator,performance-*'
Checks: '-*,modernize-use-emplace,modernize-avoid-bind,misc-throw-by-value-catch-by-reference,misc-unconventional-assign-operator,performance-*,-performance-avoid-endl,performance-inefficient-string-concatenation'
WarningsAsErrors: '-*,modernize-use-emplace,performance-type-promotion-in-math-fn,performance-faster-string-find,performance-implicit-cast-in-loop'
CheckOptions:
- key: performance-unnecessary-value-param.AllowedTypes

1
.gitattributes vendored
View file

@ -5,3 +5,4 @@
*.h diff=cpp
*.gltf binary
*.x binary

View file

@ -14,7 +14,7 @@ Contributions are welcome! Here's how you can help:
[clone](https://help.github.com/articles/cloning-a-repository/) your fork.
2. Before you start coding, consider opening an
[issue at Github](https://github.com/minetest/minetest/issues) to discuss the
[issue on Github](https://github.com/luanti-org/luanti/issues) to discuss the
suitability and implementation of your intended contribution with the core
developers.
@ -25,16 +25,16 @@ Contributions are welcome! Here's how you can help:
the work, to avoid disappointment.
You may also benefit from discussing on our IRC development channel
[#minetest-dev](http://www.minetest.net/irc/). Note that a proper IRC client
[#luanti-dev](http://www.luanti.org/irc/). Note that a proper IRC client
is required to speak on this channel.
3. Start coding!
- Refer to the
[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
[Lua](http://dev.minetest.net/Lua_code_style_guidelines) code style guidelines.
[Lua API](https://github.com/luanti-org/luanti/blob/master/doc/lua_api.md),
[Developer Wiki](https://dev.luanti.org/) and other
[documentation](https://github.com/luanti-org/luanti/tree/master/doc).
- Follow the [C/C++](https://dev.luanti.org/Code_style_guidelines) and
[Lua](https://dev.luanti.org/Lua_code_style_guidelines) code style guidelines.
- Check your code works as expected and document any changes to the Lua API.
- To avoid conflicting changes between contributions, do not do the following manually. They will be done before each release.
- Run `updatepo.sh` or update `luanti.po{,t}` even if your code adds new translatable strings.
@ -53,7 +53,7 @@ Contributions are welcome! Here's how you can help:
- The following lines should describe the commit, starting a new line for each point.
5. Once you are happy with your changes, submit a pull request.
- Open the [pull-request form](https://github.com/minetest/minetest/pull/new/master).
- Open the [pull-request form](https://github.com/luanti-org/luanti/pull/new/master).
- Add a description explaining what you've done (or if it's a
work-in-progress - what you need to do).
- Make sure to fill out the pull request template.
@ -64,8 +64,8 @@ Contributions are welcome! Here's how you can help:
picture of the project.
2. It works.
3. It follows the code style for
[C/C++](http://dev.minetest.net/Code_style_guidelines) or
[Lua](http://dev.minetest.net/Lua_code_style_guidelines).
[C/C++](https://dev.luanti.org/Code_style_guidelines) or
[Lua](https://dev.luanti.org/Lua_code_style_guidelines).
4. The code's interfaces are well designed, regardless of other aspects that
might need more work in the future.
5. It uses protocols and formats which include the required compatibility.
@ -76,9 +76,9 @@ If you experience an issue, we would like to know the details - especially when
a stable release is on the way.
1. Do a quick search on GitHub to check if the issue has already been reported.
2. Is it an issue with the Minetest *engine*? If not, report it
[elsewhere](http://www.minetest.net/development/#reporting-issues).
3. [Open an issue](https://github.com/minetest/minetest/issues/new) and describe
2. Is it an issue with the Luanti *engine*? If not, report it
[elsewhere](http://www.luanti.org/development/#reporting-issues).
3. [Open an issue](https://github.com/luanti-org/luanti/issues/new) and describe
the issue you are having - you could include:
- Error logs (check the bottom of the `debug.txt` file).
- Screenshots.
@ -106,21 +106,21 @@ the project page with a list of current languages
Builtin (the component which contains things like server messages, chat command
descriptions, privilege descriptions) is translated separately; it needs to be
translated by editing a `.tr` text file. See
[Translation](https://dev.minetest.net/Translation) for more information.
[Translation](https://dev.luanti.org/Translation) for more information.
## Donations
If you'd like to monetarily support Luanti development, you can find donation
methods on [our website](http://www.minetest.net/development/#donate).
methods on [our website](http://www.luanti.org/development/#donate).
# Maintaining
* This is a concise version of the
[Rules & Guidelines](http://dev.minetest.net/Category:Rules_and_Guidelines) on the developer wiki.*
[Rules & Guidelines](https://dev.luanti.org/engine-dev-process/) on the developer wiki.*
These notes are for those who have push access Luanti (core developers / maintainers).
- See the [project organisation](http://dev.minetest.net/Organisation) for the people involved.
- See the [project organisation](https://dev.luanti.org/Organisation) for the people involved.
## Concept approvals and roadmaps
@ -159,14 +159,14 @@ Submit a :+1: (+1) or "Looks good" comment to show you believe the pull-request
- The title should follow the commit guidelines (title starts with a capital letter, present tense, descriptive).
- Don't modify history older than 10 minutes.
- Use rebase, not merge to get linear history:
- `curl https://github.com/minetest/minetest/pull/1.patch | git am`
- `curl -Ls https://github.com/luanti-org/luanti/pull/1.patch | git am`
## Reviewing issues and feature requests
- If an issue does not get a response from its author within 1 month (when requiring more details), it can be closed.
- When an issue is a duplicate, refer to the first ones and close the later ones.
- Tag issues with the appropriate [labels](https://github.com/minetest/minetest/labels) for devices, platforms etc.
- Tag issues with the appropriate [labels](https://github.com/luanti-org/luanti/labels) for devices, platforms etc.
## Releasing a new version
*Refer to [dev.minetest.net/Releasing_Luanti](https://dev.minetest.net/Releasing_Luanti)*
*Refer to [dev.luanti.org/Releasing_Luanti](https://dev.luanti.org/Releasing_Luanti)*

View file

@ -6,9 +6,10 @@ body:
attributes:
value: |
Please note the following:
1. **Please update Luanti 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 [in its own repository](https://github.com/minetest/minetest_game/issues).
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.luanti.org/packages/?type=game) and submit a bug report in their issue trackers.
* For example, you can submit issues about the Minetest Game [in its own repository](https://github.com/luanti-org/minetest_game/issues).
3. Please provide as many details as possible for us to spot the problem quicker.
- type: textarea
attributes:
@ -33,13 +34,6 @@ body:
render: "true"
validations:
required: true
- type: input
attributes:
label: Irrlicht device
description:
placeholder: "Example: X11"
validations:
required: false
- type: input
attributes:
label: Operating system and version
@ -68,7 +62,7 @@ body:
attributes:
label: Active renderer
description: You can find this in the "About" tab in the main menu.
placeholder: "Example: OpenGL 4.6.0"
placeholder: "Example: ES 3.2 / ogles2 / X11"
validations:
required: false
- type: textarea

View file

@ -1,8 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Submit issues about Minetest Game
url: https://github.com/minetest/minetest_game/issues/new/choose
url: https://github.com/luanti-org/minetest_game/issues/new
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
url: https://content.luanti.org/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

@ -7,7 +7,7 @@ body:
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.
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.luanti.org/packages/?type=game) and submit a feature request in their issue trackers.
- type: textarea
attributes:
label: Problem

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](https://github.com/minetest/minetest/blob/master/doc/direction.md)?
- Does this relate to a goal in [the roadmap](https://github.com/luanti-org/luanti/blob/master/doc/direction.md)?
- If not a bug fix, why is this PR needed? What usecases does it solve?
## To do

4
.github/SECURITY.md vendored
View file

@ -3,7 +3,7 @@
## Supported Versions
We only support the latest stable version for security issues.
See the [releases page](https://github.com/minetest/minetest/releases).
See the [releases page](https://github.com/luanti-org/luanti/releases).
## Reporting a Vulnerability
@ -11,7 +11,7 @@ We ask that you report vulnerabilities privately, by contacting a core developer
to give us time to fix them. You can do that by emailing one of the following addresses:
* celeron55@gmail.com
* rubenwardy@minetest.net
* rw@rubenwardy.com
Depending on severity, we will either create a private issue for the vulnerability
and release a patch version of Luanti, or give you permission to file the issue publicly.

View file

@ -12,6 +12,7 @@ on:
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'android/**'
- '.github/workflows/android.yml'
pull_request:
@ -24,6 +25,7 @@ on:
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'android/**'
- '.github/workflows/android.yml'

View file

@ -12,9 +12,8 @@ on:
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'util/ci/**'
- 'Dockerfile'
- '.dockerignore'
- '.github/workflows/linux.yml'
pull_request:
paths:
@ -26,9 +25,8 @@ on:
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'util/ci/**'
- 'Dockerfile'
- '.dockerignore'
- '.github/workflows/linux.yml'
env:
@ -51,6 +49,8 @@ jobs:
env:
CC: gcc-7
CXX: g++-7
# Test fallback SHA implementations
CMAKE_FLAGS: '-DENABLE_OPENSSL=0'
- name: Test
run: |

View file

@ -16,7 +16,7 @@ on:
jobs:
build:
if: github.repository == 'minetest/minetest'
if: github.repository == 'luanti-org/luanti'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

View file

@ -13,6 +13,7 @@ on:
- 'irr/**.mm' # Objective-C(++)
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- '.github/workflows/macos.yml'
pull_request:
paths:
@ -25,10 +26,11 @@ on:
- 'irr/**.mm' # Objective-C(++)
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- '.github/workflows/macos.yml'
jobs:
build:
build-intel-macos:
# use lowest possible macOS running on x86_64 supported by brew to support more users
runs-on: macos-13
steps:
@ -68,3 +70,44 @@ jobs:
with:
name: luanti-macos
path: ./build/macos/*.zip
build-arm-macos-xcode:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
source ./util/ci/common.sh
install_macos_deps
# brew jsoncpp do not include libjsoncpp.a, and if installed header conflict caused build failure
brew uninstall jsoncpp
- name: Build with Cmake
run: |
mkdir build
cd build
cmake .. \
-DCMAKE_OSX_DEPLOYMENT_TARGET=14 \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DCMAKE_INSTALL_PREFIX=../build/macos/ \
-DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE \
-DENABLE_SYSTEM_JSONCPP=OFF
cmake --build . -j$(sysctl -n hw.logicalcpu)
make install
- name: Build and Archive with Xcode
run: |
mkdir build_xcode
cd build_xcode
../util/ci/build_xcode.sh
- name: Tests
run: |
mkdir -p "${HOME}/Library/Application Support/minetest/games/"
ln -s "${PWD}/games/devtest" "${HOME}/Library/Application Support/minetest/games/"
./build/macos/luanti.app/Contents/MacOS/luanti --run-unittests
./build_xcode/luanti.xcarchive/Products/Applications/luanti.app/Contents/MacOS/luanti --run-unittests
- name: Diff Resources
run: |
diff -rd ./build/macos/luanti.app/Contents/Resources ./build_xcode/build/Release/luanti.app/Contents/Resources || exit 1
diff -rd ./build/macos/luanti.app/Contents/Resources ./build_xcode/luanti.xcarchive/Products/Applications/luanti.app/Contents/Resources || exit 1

26
.github/workflows/png_file_checks.yml vendored Normal file
View file

@ -0,0 +1,26 @@
name: png_file_checks
# Check whether all png files are in a valid format
on:
push:
paths:
- '**.png'
- '.github/workflows/**.yml'
pull_request:
paths:
- '**.png'
- '.github/workflows/**.yml'
jobs:
png_optimized:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
sudo apt-get update
sudo apt install -y optipng
- name: Check whether all png files are optimized
run: |
./util/ci/check_png_optimized.sh

View file

@ -14,6 +14,7 @@ on:
- '**.sh'
- '**.cmake'
- '**.glsl'
- '**.lua'
pull_request:
paths:
- '**.txt'
@ -24,6 +25,7 @@ on:
- '**.sh'
- '**.cmake'
- '**.glsl'
- '**.lua'
jobs:
trailing_whitespaces:
@ -32,7 +34,72 @@ jobs:
- uses: actions/checkout@v4
# Line endings are already ensured by .gitattributes
- name: Check trailing whitespaces
run: if git ls-files | grep -E '\.txt$|\.md$|\.[ch]$|\.cpp$|\.hpp$|\.sh$|\.cmake$|\.glsl$' | xargs grep -n '\s$'; then echo -e "\033[0;31mFound trailing whitespace"; (exit 1); else (exit 0); fi
run: |
if git ls-files |\
grep -E '\.txt$|\.md$|\.[ch]$|\.cpp$|\.hpp$|\.sh$|\.cmake$|\.glsl$' |\
xargs grep -n '\s$';\
then\
echo -e "\033[0;31mFound trailing whitespace";\
(exit 1);\
else\
(exit 0);\
fi
indent_spaces:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Line endings are already ensured by .gitattributes
# Multiple multline comments in one line is not supported by this check
# and there is no reason to use them
# So lines like: "/* */ /*" or "*/ a = 5; /*" will result in error
- name: Check for unsupported multiline comments
run: |
if git ls-files |\
grep -E '^src/.*\.cpp$|^src/.*\.[ch]$' |\
xargs grep -n '\*/.*/\*';\
then
echo -e "\033[0;31mUnsupported combination of multiline comments. New multiline comment should begin on new line.";\
(exit 1);\
else\
(exit 0);\
fi
if git ls-files |\
grep -E '\.lua$' |\
xargs grep -n -e '\]\].*--\[\[';\
then
echo -e "\033[0;31mUnsupported combination of multiline comments. New multiline comment should begin on new line.";\
(exit 1);\
else\
(exit 0);\
fi
# This prepare files for final check
# See python script ./util/ci/indent_tab_preprocess.py for details.
- name: Preprocess files
run: |
git ls-files |\
grep -E '^src/.*\.cpp$|^src/.*\.[ch]$' |\
xargs -L 1 -P $(($(nproc) + 1)) \
python3 ./util/ci/indent_tab_preprocess.py "/*" "*/"
git ls-files |\
grep -E '\.lua$' |\
xargs -L 1 -P $(($(nproc) + 1)) \
python3 ./util/ci/indent_tab_preprocess.py "--[[" "]]"
# Check for bad indent.
# This runs over preprocessed files.
# If there is any remaining space on line beginning or after tab,
# error is generated
- name: Check indent spaces
run: |
if git ls-files |\
grep -E '^src/.*\.cpp$|^src/.*\.[ch]$|\.lua' |\
xargs grep -n -P '^\t*[ ]';\
then\
echo -e "\033[0;31mFound incorrect indent whitespaces";\
(exit 1);\
else\
(exit 0);\
fi
tabs_lua_api_files:
runs-on: ubuntu-latest
@ -40,6 +107,12 @@ jobs:
- uses: actions/checkout@v4
# Some files should not contain tabs
- name: Check tabs in Lua API files
run: if grep -n $'\t' doc/lua_api.md doc/client_lua_api.md; then echo -e "\033[0;31mFound tab in markdown file"; (exit 1); else (exit 0); fi
run: |
if grep -n $'\t' doc/lua_api.md doc/client_lua_api.md;\
then\
echo -e "\033[0;31mFound tab in markdown file";\
(exit 1);\
else\
(exit 0);\
fi

View file

@ -12,6 +12,7 @@ on:
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'util/buildbot/**'
- 'misc/*.manifest'
- '.github/workflows/windows.yml'
@ -25,6 +26,7 @@ on:
- 'irr/**.cpp'
- '**/CMakeLists.txt'
- 'cmake/Modules/**'
- 'po/**.po'
- 'util/buildbot/**'
- 'misc/*.manifest'
- '.github/workflows/windows.yml'
@ -71,7 +73,7 @@ jobs:
env:
VCPKG_VERSION: 01f602195983451bc83e72f4214af2cbc495aa94
# 2024.05.24
vcpkg_packages: zlib zstd curl[winssl] openal-soft libvorbis libogg libjpeg-turbo sqlite3 freetype luajit gmp jsoncpp opengl-registry
vcpkg_packages: zlib zstd curl[winssl] openal-soft libvorbis libogg libjpeg-turbo sqlite3 freetype luajit gmp jsoncpp sdl2
strategy:
fail-fast: false
matrix:

6
.gitignore vendored
View file

@ -49,13 +49,13 @@ AppDir
# Nix
/result
## Files related to Minetest development cycle
## Files related to Luanti development cycle
/*.patch
*.diff
# GNU Patch reject file
*.rej
## Non-static Minetest directories or symlinks to these
## Non-static Luanti directories or symlinks to these
/bin/
/games/*
!/games/devtest/
@ -80,7 +80,7 @@ minetest.conf
debug.txt
debug.txt.1
## Other files generated by Minetest
## Other files generated by Luanti
screenshot_*.png
testbm.txt

View file

@ -10,11 +10,13 @@ ignore = {
read_globals = {
"ItemStack",
"INIT",
"PLATFORM",
"DIR_DELIM",
"dump", "dump2",
"fgettext", "fgettext_ne",
"vector",
"VoxelArea",
"VoxelManip",
"profiler",
"Settings",
"PerlinNoise", "PerlinNoiseMap",
@ -74,10 +76,6 @@ files["builtin/mainmenu"] = {
globals = {
"gamedata",
},
read_globals = {
"PLATFORM",
},
}
files["builtin/common/tests"] = {

View file

@ -11,7 +11,7 @@ set(CLANG_MINIMUM_VERSION "7.0.1")
# You should not need to edit these manually, use util/bump_version.sh
set(VERSION_MAJOR 5)
set(VERSION_MINOR 10)
set(VERSION_MINOR 12)
set(VERSION_PATCH 0)
set(VERSION_EXTRA "" CACHE STRING "Stuff to append to version string")
@ -48,7 +48,7 @@ endif()
# - win32/gcc: fails to link
# - win32/clang: works
# - macOS on x86: seems to be fine
# - macOS on ARM: crashes, see <https://github.com/minetest/minetest/issues/14397>
# - macOS on ARM: crashes, see <https://github.com/luanti-org/luanti/issues/14397>
# Note: since CMake has no easy architecture detection disabling for Mac entirely
#### ####
if((WIN32 AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") OR APPLE)
@ -272,12 +272,16 @@ endif()
if(APPLE)
install(FILES "misc/luanti-icon.icns" DESTINATION "${SHAREDIR}")
install(FILES "misc/Info.plist" DESTINATION "${BUNDLE_PATH}/Contents")
install(FILES "${CMAKE_BINARY_DIR}/Info.plist" DESTINATION "${BUNDLE_PATH}/Contents")
endif()
if(CMAKE_GENERATOR STREQUAL "Xcode")
set(client_RESOURCES "${CMAKE_SOURCE_DIR}/misc/luanti-icon.icns")
endif()
# Library pack
find_package(GMP REQUIRED)
find_package(Json REQUIRED)
find_package(Json 1.0.0 REQUIRED)
find_package(Lua REQUIRED)
if(NOT USE_LUAJIT)
add_subdirectory(lib/bitop)

2
CNAME
View file

@ -1 +1 @@
api.minetest.net
api.luanti.org

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/
Textures by cx384 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/
@ -63,6 +66,14 @@ Zughy:
textures/base/pack/settings_btn.png
textures/base/pack/settings_info.png
textures/base/pack/settings_reset.png
textures/base/pack/server_url.png
textures/base/pack/server_url_unavailable.png
textures/base/pack/server_view_clients.png
textures/base/pack/server_view_clients_unavailable.png
cx384:
textures/base/pack/server_view_mods.png
textures/base/pack/server_view_mods_unavailable.png
appgurueu:
textures/base/pack/server_incompatible.png

View file

@ -1,13 +1,15 @@
Luanti (formerly Minetest)
==========================
![Build Status](https://github.com/minetest/minetest/workflows/build/badge.svg)
[![Translation status](https://hosted.weblate.org/widgets/minetest/-/svg-badge.svg)](https://hosted.weblate.org/engage/minetest/?utm_source=widget)
[![License](https://img.shields.io/badge/license-LGPLv2.1%2B-blue.svg)](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html)
<div align="center">
<img src="textures/base/pack/logo.png" width="32%">
<h1>Luanti (formerly Minetest)</h1>
<img src="https://github.com/luanti-org/luanti/workflows/build/badge.svg" alt="Build Status">
<a href="https://hosted.weblate.org/engage/minetest/?utm_source=widget"><img src="https://hosted.weblate.org/widgets/minetest/-/svg-badge.svg" alt="Translation status"></a>
<a href="https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html"><img src="https://img.shields.io/badge/license-LGPLv2.1%2B-blue.svg" alt="License"></a>
</div>
<br><br>
Luanti is a free open-source voxel game engine with easy modding and game creation.
Copyright (C) 2010-2024 Perttu Ahola <celeron55@gmail.com>
Copyright (C) 2010-2025 Perttu Ahola <celeron55@gmail.com>
and contributors (see source file comments and the version control log)
Table of Contents
@ -25,10 +27,10 @@ Table of Contents
Further documentation
----------------------
- Website: https://www.minetest.net/
- Wiki: https://wiki.minetest.net/
- Forum: https://forum.minetest.net/
- GitHub: https://github.com/minetest/minetest/
- Website: https://www.luanti.org/
- Wiki: https://wiki.luanti.org/
- Forum: https://forum.luanti.org/
- GitHub: https://github.com/luanti-org/luanti/
- [Developer documentation](doc/developing/)
- [doc/](doc/) directory of source distribution

View file

@ -1,5 +1,4 @@
diff --git a/android/app/src/main/java/org/libsdl/app/SDLActivity.java b/android/app/src/main/java/org/libsdl/app/SDLActivity.java
index fd5a056e3..83e3cf657 100644
--- a/android/app/src/main/java/org/libsdl/app/SDLActivity.java
+++ b/android/app/src/main/java/org/libsdl/app/SDLActivity.java
@@ -1345,7 +1345,12 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
@ -9,7 +8,7 @@ index fd5a056e3..83e3cf657 100644
- if ((source & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE) {
+ if ((source & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE ||
+ /*
+ * CUSTOM ADDITION FOR MINETEST
+ * CUSTOM ADDITION FOR LUANTI
+ * should be upstreamed
+ */
+ (source & InputDevice.SOURCE_MOUSE_RELATIVE) == InputDevice.SOURCE_MOUSE_RELATIVE) {

View file

@ -60,8 +60,8 @@ import java.util.Locale;
public class SDLActivity extends Activity implements View.OnSystemUiVisibilityChangeListener {
private static final String TAG = "SDL";
private static final int SDL_MAJOR_VERSION = 2;
private static final int SDL_MINOR_VERSION = 30;
private static final int SDL_MICRO_VERSION = 8;
private static final int SDL_MINOR_VERSION = 32;
private static final int SDL_MICRO_VERSION = 0;
/*
// Display InputType.SOURCE/CLASS of events and devices
//
@ -790,6 +790,9 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
SDLActivity.mFullscreenModeActive = false;
}
if (Build.VERSION.SDK_INT >= 28 /* Android 9 (Pie) */) {
window.getAttributes().layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
}
}
} else {
Log.e(TAG, "error handling message, getContext() returned no Activity");
@ -1347,7 +1350,7 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
if ((source & InputDevice.SOURCE_MOUSE) == InputDevice.SOURCE_MOUSE ||
/*
* CUSTOM ADDITION FOR MINETEST
* CUSTOM ADDITION FOR LUANTI
* should be upstreamed
*/
(source & InputDevice.SOURCE_MOUSE_RELATIVE) == InputDevice.SOURCE_MOUSE_RELATIVE) {

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="unzip_notification_description">Menos de 1 minuto…</string>
<string name="ime_dialog_done">Hecho</string>
<string name="no_web_browser">No se encontró ningún navegador web</string>
<string name="loading">Cargando…</string>
<string name="notification_channel_name">Notificación General</string>
<string name="label">Luanti</string>
<string name="notification_channel_description">Notificaciones de Luanti</string>
<string name="unzip_notification_title">Cargando Luanti</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="no_web_browser">No se encontró ningún navegador web</string>
<string name="loading">Cargando…</string>
<string name="notification_channel_description">Notificaciones de Luanti</string>
<string name="unzip_notification_description">Menos de 1 minuto…</string>
<string name="ime_dialog_done">Hecho</string>
<string name="label">Luanti</string>
<string name="unzip_notification_title">Cargando Luanti</string>
<string name="notification_channel_name">Notificación General</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="unzip_notification_description">کمتر از 1 دقیقه…</string>
<string name="loading">در حال بارگذاری…</string>
<string name="ime_dialog_done">انجام شد</string>
<string name="label">لوآنتی</string>
<string name="unzip_notification_title">در حال بارگذاری لوآنتی</string>
<string name="notification_channel_name">نوتیفیکیشن عمومی</string>
<string name="notification_channel_description">نوتیفیکیشن از لوآنتی</string>
<string name="no_web_browser">هیچ مرورگری یافت نشد</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Luanti</string>
<string name="loading">Chargement…</string>
<string name="notification_channel_name">Notification générale</string>
<string name="notification_channel_description">Notifications de Luanti</string>
<string name="unzip_notification_title">Chargement de Luanti</string>
<string name="unzip_notification_description">Moins d\'une minute…</string>
<string name="ime_dialog_done">Terminé</string>
<string name="no_web_browser">Aucun navigateur web trouvé</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Luanti</string>
<string name="loading">Cargando…</string>
<string name="notification_channel_name">Notificación xeral</string>
<string name="notification_channel_description">Notificacións de Luanti</string>
<string name="unzip_notification_title">Cargando Luanti</string>
<string name="unzip_notification_description">Menos de 1 minuto…</string>
<string name="ime_dialog_done">Feito</string>
<string name="no_web_browser">Non se atopou ningún navegador web</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="unzip_notification_title">Загрузка Luanti</string>
<string name="unzip_notification_description">Меньше чам за 1 минуту…</string>
<string name="ime_dialog_done">Готово</string>
<string name="label">Luаnti</string>
<string name="notification_channel_description">Уведомления от Luanti</string>
<string name="notification_channel_name">Основные уведомления</string>
<string name="loading">Загрузка…</string>
<string name="no_web_browser">Не найдено веб-браузера</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Luanti</string>
<string name="loading">Laddar…</string>
<string name="unzip_notification_description">Mindre än 1 minut…</string>
<string name="ime_dialog_done">Färdig</string>
<string name="no_web_browser">Ingen webbläsare kunde hittas</string>
<string name="notification_channel_name">Generell notis</string>
<string name="notification_channel_description">Notiser från Luanti</string>
<string name="unzip_notification_title">Laddar Luanti</string>
</resources>

View file

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<resources></resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Luanti</string>
<string name="no_web_browser">Браузерів не знайдено</string>
<string name="loading">Завантаження…</string>
<string name="notification_channel_name">Загальні сповіщення</string>
<string name="unzip_notification_title">Luanti завантажується</string>
<string name="unzip_notification_description">Менше за 1 хвилину…</string>
<string name="ime_dialog_done">Готово</string>
<string name="notification_channel_description">Сповіщення від Luanti</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="label">Luanti</string>
<string name="loading">加载中…</string>
<string name="notification_channel_name">一般通知</string>
<string name="notification_channel_description">Luanti 的通知</string>
<string name="unzip_notification_title">加载 Luanti 中</string>
<string name="unzip_notification_description">不到1分钟…</string>
<string name="ime_dialog_done">完成</string>
<string name="no_web_browser">未找到网页浏览器</string>
</resources>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="loading">載入中…</string>
<string name="notification_channel_name">一般通知</string>
<string name="notification_channel_description">Luanti 的通知</string>
<string name="unzip_notification_description">不到1分鐘…</string>
<string name="ime_dialog_done">完畢</string>
<string name="no_web_browser">未找到任何網頁瀏覽器</string>
<string name="label">Luanti</string>
<string name="unzip_notification_title">載入Luanti中</string>
</resources>

View file

@ -1,7 +1,7 @@
// 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", 10) // Version Minor
project.ext.set("versionMinor", 12) // Version Minor
project.ext.set("versionPatch", 0) // Version Patch
// ^ keep in sync with cmake

View file

@ -52,7 +52,7 @@ if (new File(depsDir, 'armeabi-v7a').exists()) {
task downloadDeps(type: Download) {
def depsZip = new File(buildDir, 'deps.zip')
src 'https://github.com/minetest/minetest_android_deps/releases/download/latest/deps-lite.zip'
src 'https://github.com/luanti-org/luanti_android_deps/releases/download/latest/deps-lite.zip'
dest depsZip
overwrite false

View file

@ -2,7 +2,10 @@ local scriptpath = core.get_builtin_path()
local clientpath = scriptpath.."client"..DIR_DELIM
local commonpath = scriptpath.."common"..DIR_DELIM
dofile(clientpath .. "register.lua")
local builtin_shared = {}
assert(loadfile(commonpath .. "register.lua"))(builtin_shared)
assert(loadfile(clientpath .. "register.lua"))(builtin_shared)
dofile(commonpath .. "after.lua")
dofile(commonpath .. "mod_storage.lua")
dofile(commonpath .. "chatcommands.lua")

View file

@ -1,68 +1,6 @@
core.callback_origins = {}
local builtin_shared = ...
local getinfo = debug.getinfo
debug.getinfo = nil
--- Runs given callbacks.
--
-- Note: this function is also called from C++
-- @tparam table callbacks a table with registered callbacks, like `core.registered_on_*`
-- @tparam number mode a RunCallbacksMode, as defined in src/script/common/c_internal.h
-- @param ... arguments for the callback
-- @return depends on mode
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
for i = 1, cb_len do
local cb_ret = callbacks[i](...)
if mode == 0 and i == 1 or 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
--
-- 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 = 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 make_registration = builtin_shared.make_registration
core.registered_globalsteps, core.register_globalstep = make_registration()
core.registered_on_mods_loaded, core.register_on_mods_loaded = make_registration()

View file

@ -90,7 +90,7 @@ local facedir_to_dir_map = {
1, 4, 3, 2,
}
function core.facedir_to_dir(facedir)
return facedir_to_dir[facedir_to_dir_map[facedir % 32]]
return vector.copy(facedir_to_dir[facedir_to_dir_map[facedir % 32]])
end
function core.dir_to_fourdir(dir)
@ -110,7 +110,7 @@ function core.dir_to_fourdir(dir)
end
function core.fourdir_to_dir(fourdir)
return facedir_to_dir[facedir_to_dir_map[fourdir % 4]]
return vector.copy(facedir_to_dir[facedir_to_dir_map[fourdir % 4]])
end
function core.dir_to_wallmounted(dir)
@ -147,7 +147,7 @@ local wallmounted_to_dir = {
vector.new( 0, -1, 0),
}
function core.wallmounted_to_dir(wallmounted)
return wallmounted_to_dir[wallmounted % 8]
return vector.copy(wallmounted_to_dir[wallmounted % 8])
end
function core.dir_to_yaw(dir)

View file

@ -54,7 +54,8 @@ function builtin_shared.make_registration()
local registerfunc = function(func)
t[#t + 1] = func
core.callback_origins[func] = {
mod = core.get_current_modname() or "??",
-- may be nil or return nil
mod = core.get_current_modname and core.get_current_modname() or "??",
name = debug.getinfo(1, "n").name or "??"
}
end
@ -66,7 +67,8 @@ function builtin_shared.make_registration_reverse()
local registerfunc = function(func)
table.insert(t, 1, func)
core.callback_origins[func] = {
mod = core.get_current_modname() or "??",
-- may be nil or return nil
mod = core.get_current_modname and core.get_current_modname() or "??",
name = debug.getinfo(1, "n").name or "??"
}
end

View file

@ -98,6 +98,7 @@ local function make_field(converter, validator, stringifier)
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 .. ("field_close_on_enter[%s;false]"):format(setting.name) -- for pause menu env
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
@ -217,6 +218,8 @@ local function make_path(setting)
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 .. ("field_enter_after_edit[%s;true]"):format(setting.name)
fs = fs .. ("field_close_on_enter[%s;false]"):format(setting.name) -- for pause menu env
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"))
@ -249,8 +252,11 @@ local function make_path(setting)
}
end
if PLATFORM == "Android" then
if PLATFORM == "Android" or INIT == "pause_menu" then
-- The Irrlicht file picker doesn't work on Android.
-- Access to the Irrlicht file picker isn't implemented in the pause menu.
-- We want to delete the Irrlicht file picker anyway, so any time spent on
-- that would be wasted.
make.path = make.string
make.filepath = make.string
else
@ -282,6 +288,14 @@ function make.v3f(setting)
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 .. ("field_enter_after_edit[%s;true]"):format(setting.name .. "_x")
fs = fs .. ("field_enter_after_edit[%s;true]"):format(setting.name .. "_y")
fs = fs .. ("field_enter_after_edit[%s;true]"):format(setting.name .. "_z")
-- for pause menu env
fs = fs .. ("field_close_on_enter[%s;false]"):format(setting.name .. "_x")
fs = fs .. ("field_close_on_enter[%s;false]"):format(setting.name .. "_y")
fs = fs .. ("field_close_on_enter[%s;false]"):format(setting.name .. "_z")
fs = fs .. ("button[%f,0.6;1,0.8;%s;%s]"):format(avail_w, "set_" .. setting.name, fgettext("Set"))
return fs, 1.4
@ -428,8 +442,22 @@ local function make_noise_params(setting)
}
end
make.noise_params_2d = make_noise_params
make.noise_params_3d = make_noise_params
if INIT == "pause_menu" then
-- Making the noise parameter dialog work in the pause menu settings would
-- require porting "FSTK" (at least the dialog API) from the mainmenu formspec
-- API to the in-game formspec API.
-- There's no reason you'd want to adjust mapgen noise parameter settings
-- in-game (they only apply to new worlds), so there's no reason to implement
-- this.
local empty = function()
return { get_formspec = function() return "", 0 end }
end
make.noise_params_2d = empty
make.noise_params_3d = empty
else
make.noise_params_2d = make_noise_params
make.noise_params_3d = make_noise_params
end
return make

View file

@ -16,13 +16,10 @@
--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 path = core.get_builtin_path() .. "common" .. DIR_DELIM .. "settings" .. DIR_DELIM
local shader_warning_component = dofile(core.get_mainmenu_path() .. DIR_DELIM ..
"settings" .. DIR_DELIM .. "shader_warning_component.lua")
local shadows_component = dofile(core.get_mainmenu_path() .. DIR_DELIM ..
"settings" .. DIR_DELIM .. "shadows_component.lua")
local component_funcs = dofile(path .. "components.lua")
local shadows_component = dofile(path .. "shadows_component.lua")
local loaded = false
local full_settings
@ -112,7 +109,7 @@ local function load()
local change_keys = {
query_text = "Controls",
requires = {
touch_controls = false,
keyboard_mouse = true,
},
get_formspec = function(self, avail_w)
local btn_w = math.min(avail_w, 3)
@ -125,6 +122,22 @@ local function load()
end,
}
local touchscreen_layout = {
query_text = "Touchscreen layout",
requires = {
touchscreen = true,
},
get_formspec = function(self, avail_w)
local btn_w = math.min(avail_w, 6)
return ("button[0,0;%f,0.8;btn_touch_layout;%s]"):format(btn_w, fgettext("Touchscreen layout")), 0.8
end,
on_submit = function(self, fields)
if fields.btn_touch_layout then
core.show_touchscreen_layout()
end
end,
}
add_page({
id = "accessibility",
title = fgettext_ne("Accessibility"),
@ -146,20 +159,16 @@ local function load()
{ heading = fgettext_ne("Movement") },
"arm_inertia",
"view_bobbing_amount",
"fall_bobbing_amount",
},
})
load_settingtypes()
table.insert(page_by_id.controls_keyboard_and_mouse.content, 1, change_keys)
-- insert after "touch_controls"
table.insert(page_by_id.controls_touchscreen.content, 2, touchscreen_layout)
do
local content = page_by_id.graphics_and_audio_graphics.content
table.insert(content, 1, shader_warning_component)
content = page_by_id.graphics_and_audio_effects.content
table.insert(content, 1, shader_warning_component)
local content = page_by_id.graphics_and_audio_effects.content
local idx = table.indexof(content, "enable_dynamic_shadows")
table.insert(content, idx, shadows_component)
@ -348,7 +357,6 @@ local function check_requirements(name, requires)
end
local video_driver = core.get_active_driver()
local shaders_support = video_driver == "opengl" or video_driver == "opengl3" or video_driver == "ogles2"
local touch_support = core.irrlicht_device_supports_touch()
local touch_controls = core.settings:get("touch_controls")
local special = {
@ -359,9 +367,7 @@ local function check_requirements(name, requires)
-- be used, so we show settings for both.
touchscreen = touch_support and (touch_controls == "auto" or core.is_yes(touch_controls)),
keyboard_mouse = not touch_support or (touch_controls == "auto" or not core.is_yes(touch_controls)),
shaders_support = shaders_support,
shaders = core.settings:get_bool("enable_shaders") and shaders_support,
opengl = video_driver == "opengl",
opengl = (video_driver == "opengl" or video_driver == "opengl3"),
gles = video_driver:sub(1, 5) == "ogles",
}
@ -369,7 +375,10 @@ local function check_requirements(name, requires)
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)
core.log("warning", "Unknown setting " .. req_key .. " required by " .. (name or "???"))
elseif required_setting.type ~= "bool" then
core.log("warning", "Setting " .. req_key .. " of type " .. required_setting.type ..
" used as requirement by " .. (name or "???") .. ", only bool is allowed")
end
local actual_value = core.settings:get_bool(req_key,
required_setting and core.is_yes(required_setting.default))
@ -506,7 +515,8 @@ local function get_formspec(dialogdata)
"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")),
tabsize.height + 0.2, back_w,
INIT == "pause_menu" and fgettext("Exit") or fgettext("Back")),
("box[%f,%f;%f,0.8;#0000008C]"):format(
back_w + 0.2, tabsize.height + 0.2, checkbox_w),
@ -523,6 +533,7 @@ local function get_formspec(dialogdata)
"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]",
"field_close_on_enter[search_query;false]", -- for pause menu env
"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;]",
@ -663,7 +674,8 @@ local function buttonhandler(this, fields)
dialogdata.rightscroll = core.explode_scrollbar_event(fields.rightscroll).value or dialogdata.rightscroll
dialogdata.query = fields.search_query
if fields.back then
-- "fields.quit" is for the pause menu env
if fields.back or fields.quit then
this:delete()
return true
end
@ -757,11 +769,44 @@ local function eventhandler(event)
end
function create_settings_dlg()
load()
local dlg = dialog_create("dlg_settings", get_formspec, buttonhandler, eventhandler)
if INIT == "mainmenu" then
function create_settings_dlg()
load()
local dlg = dialog_create("dlg_settings", get_formspec, buttonhandler, eventhandler)
dlg.data.page_id = update_filtered_pages("")
dlg.data.page_id = update_filtered_pages("")
return dlg
return dlg
end
else
assert(INIT == "pause_menu")
local dialog
core.register_on_formspec_input(function(formname, fields)
if dialog and formname == "__builtin:settings" then
-- buttonhandler returning true means we should update the formspec.
-- dialog is re-checked since the buttonhandler may have closed it.
if buttonhandler(dialog, fields) and dialog then
core.show_formspec("__builtin:settings", get_formspec(dialog.data))
end
return true
end
end)
core.open_settings = function()
load()
dialog = {}
dialog.data = {}
dialog.data.page_id = update_filtered_pages("")
dialog.delete = function()
dialog = nil
-- only needed for the "fields.back" case, in the "fields.quit"
-- case it's a no-op
core.show_formspec("__builtin:settings", "")
end
core.show_formspec("__builtin:settings", get_formspec(dialog.data))
end
end

View file

@ -16,7 +16,7 @@ local minetest_example_header = [[
# to the program, eg. "luanti.exe --config ../minetest.conf.example".
# Further documentation:
# https://wiki.minetest.net/
# https://wiki.luanti.org/
]]
@ -61,7 +61,7 @@ local function create_minetest_conf_example(settings)
end
end
if entry.type == "key" then
local line = "See https://github.com/minetest/irrlicht/blob/master/include/Keycodes.h"
local line = "See https://github.com/luanti-org/luanti/blob/master/irr/include/Keycodes.h"
insert(result, "# " .. line .. "\n")
end
insert(result, "# type: " .. entry.type)

View file

@ -15,11 +15,11 @@
--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"
local path = core.get_builtin_path() .. "common" .. DIR_DELIM .. "settings" .. DIR_DELIM
dofile(path .. DIR_DELIM .. "settingtypes.lua")
dofile(path .. DIR_DELIM .. "dlg_change_mapgen_flags.lua")
dofile(path .. DIR_DELIM .. "dlg_settings.lua")
dofile(path .. "settingtypes.lua")
dofile(path .. "dlg_change_mapgen_flags.lua")
dofile(path .. "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.

View file

@ -408,7 +408,16 @@ function settingtypes.parse_config_file(read_all, parse_mods)
file:close()
end
if parse_mods then
-- TODO: Support game/mod settings in the pause menu too
-- Note that this will need to work different from how it's done in the
-- mainmenu:
-- * Only if in singleplayer / on local server, not on remote servers
-- * Only show settings for the active game and mods
-- (add API function to get them, can return nil if on a remote server)
-- (names are probably not enough, will need paths for uniqueness)
-- This means just making "pkgmgr.lua" work won't get you very far.
if INIT == "mainmenu" and parse_mods then
-- Parse games
local games_category_initialized = false
for _, game in ipairs(pkgmgr.games) do

View file

@ -82,7 +82,6 @@ end
return {
query_text = "Shadows",
requires = {
shaders = true,
opengl = true,
},
get_formspec = function(self, avail_w)

View file

@ -389,7 +389,7 @@ function vector.random_direction()
local x, y, z, l2
repeat -- expected less than two attempts on average (volume sphere vs. cube)
x, y, z = math.random() * 2 - 1, math.random() * 2 - 1, math.random() * 2 - 1
l2 = x*x + y*y + z*z
l2 = x*x + y*y + z*z
until l2 <= 1 and l2 >= 1e-6
-- normalize
local l = math.sqrt(l2)

View file

@ -38,7 +38,7 @@ local function buttonbar_formspec(self)
-- `BASE_SPACING` is used as the minimum spacing, like `gap` in CSS Flexbox.
-- The number of buttons per page is always calculated as if the scroll
-- buttons were visible.
-- buttons were visible.
local avail_space = self.size.x - 2*BASE_SPACING - 2*get_scroll_btn_width()
local btns_per_page = math.floor((avail_space - BASE_SPACING) / (btn_size + BASE_SPACING))

View file

@ -1,5 +1,4 @@
local builtin_shared = ...
local SCALE = 0.667
local facedir_to_euler = {
{y = 0, x = 0, z = 0},
@ -36,9 +35,7 @@ local gravity = tonumber(core.settings:get("movement_gravity")) or 9.81
core.register_entity(":__builtin:falling_node", {
initial_properties = {
visual = "item",
visual_size = vector.new(SCALE, SCALE, SCALE),
textures = {},
visual = "node",
physical = true,
is_visible = false,
collide_with_objects = true,
@ -78,43 +75,17 @@ core.register_entity(":__builtin:falling_node", {
self.floats = core.get_item_group(node.name, "float") ~= 0
-- Save liquidtype for falling water
self.liquidtype = def.liquidtype
self.liquidtype = def.liquidtype
-- Set entity visuals
if def.drawtype == "torchlike" or def.drawtype == "signlike" then
local textures
if def.tiles and def.tiles[1] then
local tile = def.tiles[1]
if type(tile) == "table" then
tile = tile.name
end
if def.drawtype == "torchlike" then
textures = { "("..tile..")^[transformFX", tile }
else
textures = { tile, "("..tile..")^[transformFX" }
end
end
local vsize
if def.visual_scale then
local s = def.visual_scale
vsize = vector.new(s, s, s)
end
self.object:set_properties({
is_visible = true,
visual = "upright_sprite",
visual_size = vsize,
textures = textures,
glow = def.light_source,
})
elseif def.drawtype ~= "airlike" then
local itemstring = node.name
if core.is_colored_paramtype(def.paramtype2) then
itemstring = core.itemstring_with_palette(itemstring, node.param2)
end
-- FIXME: solution needed for paramtype2 == "leveled"
-- Set up entity visuals
-- For compatibility with older clients we continue to use "item" visual
-- for simple situations.
local drawtypes = {normal=true, glasslike=true, allfaces=true, nodebox=true}
local p2types = {none=true, facedir=true, ["4dir"]=true}
if drawtypes[def.drawtype] and p2types[def.paramtype2] and def.use_texture_alpha ~= "blend" then
-- Calculate size of falling node
local s = {}
s.x = (def.visual_scale or 1) * SCALE
local s = vector.zero()
s.x = (def.visual_scale or 1) * 0.667
s.y = s.x
s.z = s.x
-- Compensate for wield_scale
@ -125,10 +96,31 @@ core.register_entity(":__builtin:falling_node", {
end
self.object:set_properties({
is_visible = true,
wield_item = itemstring,
visual = "item",
wield_item = node.name,
visual_size = s,
glow = def.light_source,
})
-- Rotate as needed
if def.paramtype2 == "facedir" then
local fdir = node.param2 % 32 % 24
local euler = facedir_to_euler[fdir + 1]
if euler then
self.object:set_rotation(euler)
end
elseif def.paramtype2 == "4dir" then
local fdir = node.param2 % 4
local euler = facedir_to_euler[fdir + 1]
if euler then
self.object:set_rotation(euler)
end
end
elseif def.drawtype ~= "airlike" then
self.object:set_properties({
is_visible = true,
node = node,
glow = def.light_source,
})
end
-- Set collision box (certain nodeboxes only for now)
@ -148,111 +140,6 @@ core.register_entity(":__builtin:falling_node", {
})
end
end
-- Rotate entity
if def.drawtype == "torchlike" then
if (def.paramtype2 == "wallmounted" or def.paramtype2 == "colorwallmounted")
and node.param2 % 8 == 7 then
self.object:set_yaw(-math.pi*0.25)
else
self.object:set_yaw(math.pi*0.25)
end
elseif ((node.param2 ~= 0 or def.drawtype == "nodebox" or def.drawtype == "mesh")
and (def.wield_image == "" or def.wield_image == nil))
or def.drawtype == "signlike"
or def.drawtype == "mesh"
or def.drawtype == "normal"
or def.drawtype == "nodebox" then
if (def.paramtype2 == "facedir" or def.paramtype2 == "colorfacedir") then
local fdir = node.param2 % 32 % 24
-- 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.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
if (def.drawtype == "signlike" and def.paramtype2 ~= "wallmounted" and def.paramtype2 ~= "colorwallmounted") then
-- Change rotation to "floor" by default for non-wallmounted paramtype2
rot = 1
end
local pitch, yaw, roll = 0, 0, 0
if def.drawtype == "nodebox" or def.drawtype == "mesh" then
if rot == 0 then
pitch, yaw = math.pi/2, 0
elseif rot == 1 then
pitch, yaw = -math.pi/2, math.pi
elseif rot == 2 then
pitch, yaw = 0, math.pi/2
elseif rot == 3 then
pitch, yaw = 0, -math.pi/2
elseif rot == 4 then
pitch, yaw = 0, math.pi
elseif rot == 6 then
pitch, yaw = math.pi/2, 0
elseif rot == 7 then
pitch, yaw = -math.pi/2, math.pi
end
else
if rot == 1 then
pitch, yaw = math.pi, math.pi
elseif rot == 2 then
pitch, yaw = math.pi/2, math.pi/2
elseif rot == 3 then
pitch, yaw = math.pi/2, -math.pi/2
elseif rot == 4 then
pitch, yaw = math.pi/2, math.pi
elseif rot == 5 then
pitch, yaw = math.pi/2, 0
elseif rot == 6 then
pitch, yaw = math.pi, -math.pi/2
elseif rot == 7 then
pitch, yaw = 0, -math.pi/2
end
end
if def.drawtype == "signlike" then
pitch = pitch - math.pi/2
if rot == 0 then
yaw = yaw + math.pi/2
elseif rot == 1 then
yaw = yaw - math.pi/2
elseif rot == 6 then
yaw = yaw - math.pi/2
pitch = pitch + math.pi
elseif rot == 7 then
yaw = yaw + math.pi/2
pitch = pitch + math.pi
end
elseif def.drawtype == "mesh" or def.drawtype == "normal" or def.drawtype == "nodebox" then
if rot == 0 or rot == 1 then
roll = roll + math.pi
elseif rot == 6 or rot == 7 then
if def.drawtype ~= "normal" then
roll = roll - math.pi/2
end
else
yaw = yaw + math.pi
end
end
self.object:set_rotation({x=pitch, y=yaw, z=roll})
elseif (def.drawtype == "mesh" and def.paramtype2 == "degrotate") then
local p2 = (node.param2 - (def.place_param2 or 0)) % 240
local yaw = (p2 / 240) * (math.pi * 2)
self.object:set_yaw(yaw)
elseif (def.drawtype == "mesh" and def.paramtype2 == "colordegrotate") then
local p2 = (node.param2 % 32 - (def.place_param2 or 0) % 32) % 24
local yaw = (p2 / 24) * (math.pi * 2)
self.object:set_yaw(yaw)
end
end
end,
get_staticdata = function(self)
@ -308,23 +195,26 @@ core.register_entity(":__builtin:falling_node", {
core.remove_node(bcp)
else
-- We are placing on top so check what's there
np.y = np.y + 1
end
-- Check what's here
local n2 = core.get_node(np)
local nd = core.registered_nodes[n2.name]
-- If it's not air or liquid, remove node and replace it with
-- it's drops
if n2.name ~= "air" and (not nd or nd.liquidtype ~= "source") then
if nd and nd.buildable_to == false then
local n2 = core.get_node(np)
local nd = core.registered_nodes[n2.name]
if not nd or nd.buildable_to then
core.remove_node(np)
else
-- 'walkable' is used to mean "falling nodes can't replace this"
-- here. Normally we would collide with the walkable node itself
-- and place our node on top (so `n2.name == "air"`), but we
-- re-check this in case we ended up inside a node.
if not nd.diggable or nd.walkable then
return false
end
nd.on_dig(np, n2, nil)
-- If it's still there, it might be protected
if core.get_node(np).name == n2.name then
return false
end
else
core.remove_node(np)
end
end

View file

@ -43,6 +43,9 @@ core.features = {
hotbar_hud_element = true,
bulk_lbms = true,
abm_without_neighbors = true,
biome_weights = true,
particle_blend_clip = true,
remove_item_match_meta = true,
}
function core.has_feature(arg)

View file

@ -36,11 +36,7 @@ end
function core.setting_get_pos(name)
local value = core.settings:get(name)
if not value then
return nil
end
return core.string_to_pos(value)
return core.settings:get_pos(name)
end
@ -116,3 +112,25 @@ if core.set_push_moveresult1 then
end)
core.set_push_moveresult1 = nil
end
-- Protocol version table
-- see also src/network/networkprotocol.cpp
core.protocol_versions = {
["5.0.0"] = 37,
["5.1.0"] = 38,
["5.2.0"] = 39,
["5.3.0"] = 39,
["5.4.0"] = 39,
["5.5.0"] = 40,
["5.6.0"] = 41,
["5.7.0"] = 42,
["5.8.0"] = 43,
["5.9.0"] = 44,
["5.9.1"] = 45,
["5.10.0"] = 46,
["5.11.0"] = 47,
}
setmetatable(core.protocol_versions, {__newindex = function()
error("core.protocol_versions is read-only")
end})

View file

@ -1,7 +1,7 @@
local static_spawnpoint_string = core.settings:get("static_spawnpoint")
if static_spawnpoint_string and
static_spawnpoint_string ~= "" and
not core.setting_get_pos("static_spawnpoint") then
not core.settings:get_pos("static_spawnpoint") then
error('The static_spawnpoint setting is invalid: "' ..
static_spawnpoint_string .. '"')
end

View file

@ -78,6 +78,8 @@ elseif INIT == "client" then
dofile(scriptdir .. "client" .. DIR_DELIM .. "init.lua")
elseif INIT == "emerge" then
dofile(scriptdir .. "emerge" .. DIR_DELIM .. "init.lua")
elseif INIT == "pause_menu" then
dofile(scriptdir .. "pause_menu" .. DIR_DELIM .. "init.lua")
else
error(("Unrecognized builtin initialization type %s!"):format(tostring(INIT)))
end

View file

@ -11,11 +11,6 @@ end
core.async_event_handler = handle_job
function core.handle_async(func, parameter, callback)
-- Serialize function
local serialized_func = string.dump(func)
assert(serialized_func ~= nil)
-- Serialize parameters
local serialized_param = core.serialize(parameter)
@ -23,7 +18,7 @@ function core.handle_async(func, parameter, callback)
return false
end
local jobid = core.do_async_callback(serialized_func, serialized_param)
local jobid = core.do_async_callback(func, serialized_param)
core.async_jobs[jobid] = callback

View file

@ -392,7 +392,7 @@ function contentdb.resolve_dependencies(package, game, callback)
end
local function fetch_pkgs(params)
local function fetch_pkgs()
local version = core.get_version()
local base_url = core.settings:get("contentdb_url")
local url = base_url ..
@ -429,41 +429,43 @@ local function fetch_pkgs(params)
if not packages or #packages == 0 then
return
end
local aliases = {}
return packages
end
function contentdb.set_packages_from_api(packages)
contentdb.package_by_id = {}
contentdb.aliases = {}
for _, package in pairs(packages) do
package.id = params.calculate_package_id(package.type, package.author, package.name)
package.id = contentdb.calculate_package_id(package.type, package.author, package.name)
package.url_part = core.urlencode(package.author) .. "/" .. core.urlencode(package.name)
contentdb.package_by_id[package.id] = package
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
aliases[alias:lower()] = package.id
contentdb.aliases[alias:lower()] = package.id
end
end
end
end
return { packages = packages, aliases = aliases }
contentdb.load_ok = true
contentdb.load_error = false
contentdb.packages = packages
contentdb.packages_full = packages
contentdb.packages_full_unordered = packages
end
function contentdb.fetch_pkgs(callback)
contentdb.loading = true
core.handle_async(fetch_pkgs, { calculate_package_id = contentdb.calculate_package_id }, function(result)
core.handle_async(fetch_pkgs, nil, function(result)
if result then
contentdb.load_ok = true
contentdb.load_error = false
contentdb.packages = result.packages
contentdb.packages_full = result.packages
contentdb.packages_full_unordered = result.packages
contentdb.aliases = result.aliases
for _, package in ipairs(result.packages) do
contentdb.package_by_id[package.id] = package
end
contentdb.set_packages_from_api(result)
else
contentdb.load_error = true
end
@ -563,30 +565,32 @@ function contentdb.filter_packages(query, by_type)
end
local keywords = {}
for word in query:lower():gmatch("%S+") do
table.insert(keywords, word)
for word in query:gmatch("%S+") do
table.insert(keywords, word:lower())
end
local function contains_all_keywords(str)
str = str:lower()
for _, keyword in ipairs(keywords) do
if not str:find(keyword, 1, true) then
return false
end
end
return true
end
local function matches_keywords(package)
for k = 1, #keywords do
local keyword = keywords[k]
if string.find(package.name:lower(), keyword, 1, true) or
string.find(package.title:lower(), keyword, 1, true) or
string.find(package.author:lower(), keyword, 1, true) or
string.find(package.short_description:lower(), keyword, 1, true) then
return true
end
end
return false
return contains_all_keywords(package.name) or
contains_all_keywords(package.title) or
contains_all_keywords(package.author) or
contains_all_keywords(package.short_description)
end
contentdb.packages = {}
for _, package in pairs(contentdb.packages_full) do
if (query == "" or matches_keywords(package)) and
(by_type == nil or package.type == by_type) then
contentdb.packages[#contentdb.packages + 1] = package
table.insert(contentdb.packages, package)
end
end
end

View file

@ -51,10 +51,6 @@ local function get_formspec(data)
return
end
if info.forums then
info.forums = "https://forum.minetest.net/viewtopic.php?t=" .. info.forums
end
assert(data.package.name == info.name)
data.info = info
ui.update()
@ -194,7 +190,7 @@ local function get_formspec(data)
add_link_button(fgettext("Source"), "repo")
add_link_button(fgettext("Issue Tracker"), "issue_tracker")
add_link_button(fgettext("Translate"), "translation_url")
add_link_button(fgettext("Forum Topic"), "forums")
add_link_button(fgettext("Forum Topic"), "forum_url")
hypertext = hypertext .. "\n\n" .. info.long_description.body

View file

@ -1,5 +1,5 @@
{
"#": "https://github.com/orgs/minetest/teams/engine/members",
"#": "https://github.com/orgs/luanti-org/teams/engine/members",
"core_developers": [
"Perttu Ahola (celeron55) <celeron55@gmail.com> [Project founder]",
"sfan5 <sfan5@live.de>",
@ -13,7 +13,10 @@
"Desour/DS",
"srifqi",
"Gregor Parzefall (grorp)",
"Lars Müller (luatic)"
"Lars Müller (luatic)",
"cx384",
"sfence",
"y5nw"
],
"previous_core_developers": [
"BlockMen",
@ -36,7 +39,7 @@
"Hugues Ross <hugues.ross@gmail.com>",
"Dmitry Kostenko (x2048) <codeforsmile@gmail.com>"
],
"#": "Currently only https://github.com/orgs/minetest/teams/triagers/members",
"#": "Currently only https://github.com/orgs/luanti-org/teams/triagers/members",
"core_team": [
"Zughy [Issue triager]",
"wsor [Issue triager]",
@ -44,30 +47,22 @@
],
"#": "For updating active/previous contributors, see the script in ./util/gather_git_credits.py",
"contributors": [
"cx384",
"numzero",
"AFCMS",
"sfence",
"Wuzzy",
"ROllerozxa",
"JosiahWI",
"OgelGames",
"David Heidelberg",
"Erich Schubert",
"wrrrzr",
"1F616EMO",
"HybridDog",
"Bradley Pierce (Thresher)",
"savilli",
"Stvk imension",
"y5nw",
"chmodsayshello",
"jordan4ibanez",
"superfloh247"
"red-001 <red-001@outlook.ie>",
"veprogames",
"paradust7",
"AFCMS",
"siliconsniffer",
"Wuzzy",
"Zemtzov7"
],
"previous_contributors": [
"Ælla Chiana Moskopp (erle) <erle@dieweltistgarnichtso.net> [Logo]",
"red-001 <red-001@outlook.ie>",
"numzero",
"Giuseppe Bilotta",
"HybridDog",
"ClobberXD",
"Dániel Juhász (juhdanad) <juhdanad@gmail.com>",
"MirceaKitsune <mirceakitsune@gmail.com>",
@ -75,6 +70,7 @@
"MoNTE48",
"Constantin Wenger (SpeedProg)",
"Ciaran Gultnieks (CiaranG)",
"ROllerozxa",
"Paul Ouellette (pauloue)",
"stujones11",
"Rogier <rogier777@gmail.com>",

View file

@ -0,0 +1,49 @@
-- Luanti
-- Copyright (C) 2024 siliconsniffer
-- SPDX-License-Identifier: LGPL-2.1-or-later
local function clients_list_formspec(dialogdata)
local TOUCH_GUI = core.settings:get_bool("touch_gui")
local clients_list = dialogdata.server.clients_list
local servername = dialogdata.server.name
local function fmt_formspec_list(clients_list)
local escaped = {}
for i, str in ipairs(clients_list) do
escaped[i] = core.formspec_escape(str)
end
return table.concat(escaped, ",")
end
local formspec = {
"formspec_version[8]",
"size[6,9.5]",
TOUCH_GUI and "padding[0.01,0.01]" or "",
"hypertext[0,0;6,1.5;;<global margin=5 halign=center valign=middle>",
fgettext("Players connected to\n$1",
"<b>" .. core.hypertext_escape(servername) .. "</b>") .. "]",
"textlist[0.5,1.5;5,6.8;;" .. fmt_formspec_list(clients_list) .. "]",
"button[1.5,8.5;3,0.8;quit;OK]"
}
return table.concat(formspec, "")
end
local function clients_list_buttonhandler(this, fields)
if fields.quit then
this:delete()
return true
end
return false
end
function create_clientslist_dialog(server)
local retval = dialog_create("dlg_clients_list",
clients_list_formspec,
clients_list_buttonhandler,
nil)
retval.data.server = server
return retval
end

View file

@ -299,7 +299,7 @@ local function handle_buttons(this, fields)
worldfile:set("load_mod_" .. mod.name, mod.virtual_path)
was_set[mod.name] = true
elseif not was_set[mod.name] then
worldfile:set("load_mod_" .. mod.name, "false")
worldfile:remove("load_mod_" .. mod.name)
end
elseif mod.enabled then
gamedata.errormessage = fgettext_ne("Failed to enable mo" ..

View file

@ -19,7 +19,7 @@
-- This whole file can be removed after a while.
-- It was only directly useful for upgrades from 5.7.0 to 5.8.0, but
-- maybe some odd fellow directly upgrades from 5.6.1 to 5.9.0 in the future...
-- see <https://github.com/minetest/minetest/pull/13850> in case it's not obvious
-- see <https://github.com/luanti-org/luanti/pull/13850> in case it's not obvious
---- ----
local SETTING_NAME = "no_mtg_notification"

View file

@ -0,0 +1,105 @@
-- Luanti
-- Copyright (C) 2024 cx384
-- SPDX-License-Identifier: LGPL-2.1-or-later
local function get_formspec(dialogdata)
local TOUCH_GUI = core.settings:get_bool("touch_gui")
local server = dialogdata.server
local group_by_prefix = dialogdata.group_by_prefix
local expand_all = dialogdata.expand_all
-- A wrongly behaving server may send ill formed mod names
table.sort(server.mods)
local cells = {}
if group_by_prefix then
local function get_prefix(mod)
return mod:match("[^_]*")
end
local count = {}
for _, mod in ipairs(server.mods) do
local prefix = get_prefix(mod)
count[prefix] = (count[prefix] or 0) + 1
end
local last_prefix
local function add_row(depth, mod)
table.insert(cells, ("%d"):format(depth))
table.insert(cells, mod)
end
for i, mod in ipairs(server.mods) do
local prefix = get_prefix(mod)
if last_prefix == prefix then
add_row(1, mod)
elseif count[prefix] > 1 then
add_row(0, prefix)
add_row(1, mod)
else
add_row(0, mod)
end
last_prefix = prefix
end
else
cells = table.copy(server.mods)
end
for i, cell in ipairs(cells) do
cells[i] = core.formspec_escape(cell)
end
cells = table.concat(cells, ",")
local heading
if server.gameid then
heading = fgettext("The $1 server uses a game called $2 and the following mods:",
"<b>" .. core.hypertext_escape(server.name) .. "</b>",
"<style font=mono>" .. core.hypertext_escape(server.gameid) .. "</style>")
else
heading = fgettext("The $1 server uses the following mods:",
"<b>" .. core.hypertext_escape(server.name) .. "</b>")
end
local formspec = {
"formspec_version[8]",
"size[8,9.5]",
TOUCH_GUI and "padding[0.01,0.01]" or "",
"hypertext[0,0;8,1.5;;<global margin=5 halign=center valign=middle>", heading, "]",
"tablecolumns[", group_by_prefix and
(expand_all and "indent;text" or "tree;text") or "text", "]",
"table[0.5,1.5;7,6.8;mods;", cells, "]",
"checkbox[0.5,8.7;group_by_prefix;", fgettext("Group by prefix"), ";",
group_by_prefix and "true" or "false", "]",
group_by_prefix and ("checkbox[0.5,9.15;expand_all;" .. fgettext("Expand all") .. ";" ..
(expand_all and "true" or "false") .. "]") or "",
"button[5.5,8.5;2,0.8;quit;OK]"
}
return table.concat(formspec, "")
end
local function buttonhandler(this, fields)
if fields.quit then
this:delete()
return true
end
if fields.group_by_prefix then
this.data.group_by_prefix = core.is_yes(fields.group_by_prefix)
return true
end
if fields.expand_all then
this.data.expand_all = core.is_yes(fields.expand_all)
return true
end
return false
end
function create_server_list_mods_dialog(server)
local retval = dialog_create("dlg_server_list_mods",
get_formspec,
buttonhandler,
nil)
retval.data.group_by_prefix = false
retval.data.expand_all = false
retval.data.server = server
return retval
end

View file

@ -47,7 +47,7 @@ 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 .. "settings" .. DIR_DELIM .. "init.lua")
dofile(basepath .. "common" .. 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")
@ -55,6 +55,8 @@ 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")
dofile(menupath .. DIR_DELIM .. "dlg_clients_list.lua")
dofile(menupath .. DIR_DELIM .. "dlg_server_list_mods.lua")
local tabs = {
content = dofile(menupath .. DIR_DELIM .. "tab_content.lua"),
@ -133,4 +135,5 @@ local function init_globals()
check_new_version()
end
assert(os.execute == nil)
init_globals()

View file

@ -1,26 +0,0 @@
-- Luanti
-- SPDX-License-Identifier: LGPL-2.1-or-later
return {
query_text = "Shaders",
requires = {
shaders_support = true,
shaders = false,
},
full_width = true,
get_formspec = function(self, avail_w)
local fs = {
"box[0,0;", avail_w, ",1.2;", mt_color_orange, "]",
"label[0.2,0.4;", fgettext("Shaders are disabled."), "]",
"label[0.2,0.8;", fgettext("This is not a recommended configuration."), "]",
"button[", avail_w - 2.2, ",0.2;2,0.8;fix_shader_warning;", fgettext("Enable"), "]",
}
return table.concat(fs, ""), 1.2
end,
on_submit = function(self, fields)
if fields.fix_shader_warning then
core.settings:remove("enable_shaders") -- default value is true
return true
end
end,
}

View file

@ -32,6 +32,27 @@ local function get_credits()
return json
end
local function get_renderer_info()
local ret = {}
-- OpenGL version, stripped to just the important part
local s1 = core.get_active_renderer()
if s1:sub(1, 7) == "OpenGL " then
s1 = s1:sub(8)
end
local m = s1:match("^[%d.]+")
if not m then
m = s1:match("^ES [%d.]+")
end
ret[#ret+1] = m or s1
-- video driver
ret[#ret+1] = core.get_active_driver():lower()
-- irrlicht device
ret[#ret+1] = core.get_active_irrlicht_device():upper()
return table.concat(ret, " / ")
end
return {
name = "about",
caption = fgettext("About"),
@ -81,20 +102,12 @@ return {
"button_url[1.5,4.1;2.5,0.8;homepage;luanti.org;https://www.luanti.org/]" ..
"hypertext[5.5,0.25;9.75,6.6;credits;" .. core.formspec_escape(hypertext) .. "]"
-- Render information
local active_renderer_info = fgettext("Active renderer:") .. " " ..
core.formspec_escape(core.get_active_renderer())
local active_renderer_info = fgettext("Active renderer:") .. "\n" ..
core.formspec_escape(get_renderer_info())
fs = fs .. "style[label_button2;border=false]" ..
"button[0.1,6;5.3,0.5;label_button2;" .. active_renderer_info .. "]"..
"button[0.1,6;5.3,1;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") .. "]"
else

View file

@ -55,6 +55,51 @@ local function get_sorted_servers()
return servers
end
local function is_selected_fav(server)
local address = core.settings:get("address")
local port = tonumber(core.settings:get("remote_port"))
for _, fav in ipairs(serverlistmgr.get_favorites()) do
if address == fav.address and port == fav.port then
return true
end
end
return false
end
-- Persists the selected server in the "address" and "remote_port" settings
local function set_selected_server(server)
if server == nil then -- reset selection
core.settings:remove("address")
core.settings:remove("remote_port")
return
end
local address = server.address
local port = server.port
gamedata.serverdescription = server.description
if address and port then
core.settings:set("address", address)
core.settings:set("remote_port", port)
end
end
local function find_selected_server()
local address = core.settings:get("address")
local port = tonumber(core.settings:get("remote_port"))
for _, server in ipairs(serverlistmgr.servers) do
if server.address == address and server.port == port then
return server
end
end
for _, server in ipairs(serverlistmgr.get_favorites()) do
if server.address == address and server.port == port then
return server
end
end
end
local function get_formspec(tabview, name, tabdata)
-- Update the cached supported proto info,
-- it may have changed after a change by the settings menu.
@ -67,6 +112,7 @@ local function get_formspec(tabview, name, tabdata)
local retval =
-- Search
"field[0.25,0.25;7,0.75;te_search;;" .. core.formspec_escape(tabdata.search_for) .. "]" ..
"tooltip[te_search;" .. fgettext("Possible filters\ngame:<name>\nmod:<name>\nplayer:<name>") .. "]" ..
"field_enter_after_edit[te_search;true]" ..
"container[7.25,0.25]" ..
"image_button[0,0;0.75,0.75;" .. core.formspec_escape(defaulttexturedir .. "search.png") .. ";btn_mp_search;]" ..
@ -107,17 +153,79 @@ local function get_formspec(tabview, name, tabdata)
retval = retval .. "button[0.25,6;2.5,0.75;btn_mp_register;" .. fgettext("Register") .. "]"
end
if tabdata.selected then
if gamedata.fav then
retval = retval .. "tooltip[btn_delete_favorite;" .. fgettext("Remove favorite") .. "]"
retval = retval .. "style[btn_delete_favorite;padding=6]"
retval = retval .. "image_button[5,1.3;0.5,0.5;" .. core.formspec_escape(defaulttexturedir ..
"server_favorite_delete.png") .. ";btn_delete_favorite;]"
end
local selected_server = find_selected_server()
if selected_server then
if gamedata.serverdescription then
retval = retval .. "textarea[0.25,1.85;5.25,2.7;;;" ..
core.formspec_escape(gamedata.serverdescription) .. "]"
end
-- Mods button
local mods = selected_server.mods
if mods and #mods > 0 then
local tooltip = ""
if selected_server.gameid then
tooltip = fgettext("Game: $1", selected_server.gameid) .. "\n"
end
tooltip = tooltip .. fgettext("Number of mods: $1", #mods)
retval = retval ..
"tooltip[btn_view_mods;" .. tooltip .. "]" ..
"style[btn_view_mods;padding=6]" ..
"image_button[4,1.3;0.5,0.5;" .. core.formspec_escape(defaulttexturedir ..
"server_view_mods.png") .. ";btn_view_mods;]"
else
retval = retval .. "image[4.1,1.4;0.3,0.3;" .. core.formspec_escape(defaulttexturedir ..
"server_view_mods_unavailable.png") .. "]"
end
-- Clients list button
local clients_list = selected_server.clients_list
local can_view_clients_list = clients_list and #clients_list > 0
if can_view_clients_list then
table.sort(clients_list, function(a, b)
return a:lower() < b:lower()
end)
local max_clients = 5
if #clients_list > max_clients then
retval = retval .. "tooltip[btn_view_clients;" ..
fgettext("Players:\n$1", table.concat(clients_list, "\n", 1, max_clients)) .. "\n..." .. "]"
else
retval = retval .. "tooltip[btn_view_clients;" ..
fgettext("Players:\n$1", table.concat(clients_list, "\n")) .. "]"
end
retval = retval .. "style[btn_view_clients;padding=6]"
retval = retval .. "image_button[4.5,1.3;0.5,0.5;" .. core.formspec_escape(defaulttexturedir ..
"server_view_clients.png") .. ";btn_view_clients;]"
else
retval = retval .. "image[4.6,1.4;0.3,0.3;" .. core.formspec_escape(defaulttexturedir ..
"server_view_clients_unavailable.png") .. "]"
end
-- URL button
if selected_server.url then
retval = retval .. "tooltip[btn_server_url;" .. fgettext("Open server website") .. "]"
retval = retval .. "style[btn_server_url;padding=6]"
retval = retval .. "image_button[3.5,1.3;0.5,0.5;" ..
core.formspec_escape(defaulttexturedir .. "server_url.png") .. ";btn_server_url;]"
else
retval = retval .. "image[3.6,1.4;0.3,0.3;" .. core.formspec_escape(defaulttexturedir ..
"server_url_unavailable.png") .. "]"
end
-- Favorites toggle button
if is_selected_fav() then
retval = retval .. "tooltip[btn_delete_favorite;" .. fgettext("Remove favorite") .. "]"
retval = retval .. "style[btn_delete_favorite;padding=6]"
retval = retval .. "image_button[5,1.3;0.5,0.5;" ..
core.formspec_escape(defaulttexturedir .. "server_favorite_delete.png") .. ";btn_delete_favorite;]"
else
retval = retval .. "tooltip[btn_add_favorite;" .. fgettext("Add favorite") .. "]"
retval = retval .. "style[btn_add_favorite;padding=6]"
retval = retval .. "image_button[5,1.3;0.5,0.5;" ..
core.formspec_escape(defaulttexturedir .. "server_favorite.png") .. ";btn_add_favorite;]"
end
end
retval = retval .. "container_end[]"
@ -175,31 +283,126 @@ local function get_formspec(tabview, name, tabdata)
retval = retval .. table.concat(rows, ",")
if tabdata.selected then
retval = retval .. ";" .. tabdata.selected .. "]"
else
retval = retval .. ";0]"
local selected_row_idx = 0
if selected_server then
for i, server in pairs(tabdata.lookup) do
if selected_server.address == server.address and
selected_server.port == server.port then
selected_row_idx = i
break
end
end
end
retval = retval .. ";" .. selected_row_idx .. "]"
return retval
end
--------------------------------------------------------------------------------
local function search_server_list(input)
local function parse_search_input(input)
if not input:find("%S") then
return -- Return nil if nothing to search for
end
-- Search is not case sensitive
input = input:lower()
local query = {keywords = {}, mods = {}, players = {}}
-- Process quotation enclosed parts
input = input:gsub('(%S?)"([^"]*)"(%S?)', function(before, match, after)
if before == "" and after == "" then -- Also have be separated by spaces
table.insert(query.keywords, match)
return " "
end
return before..'"'..match..'"'..after
end)
-- Separate by space characters and handle special prefixes
-- (words with special prefixes need an exact match and none of them can contain spaces)
for word in input:gmatch("%S+") do
local mod = word:match("^mod:(.*)")
table.insert(query.mods, mod)
local player = word:match("^player:(.*)")
table.insert(query.players, player)
local game = word:match("^game:(.*)")
query.game = query.game or game
if not (mod or player or game) then
table.insert(query.keywords, word)
end
end
return query
end
-- Prepares the server to be used for searching
local function uncapitalize_server(server)
local function table_lower(t)
local r = {}
for i, s in ipairs(t or {}) do
r[i] = s:lower()
end
return r
end
return {
name = (server.name or ""):lower(),
description = (server.description or ""):lower(),
gameid = (server.gameid or ""):lower(),
mods = table_lower(server.mods),
clients_list = table_lower(server.clients_list),
}
end
-- Returns false if the query does not match
-- otherwise returns a number to adjust the sorting priority
local function matches_query(server, query)
-- Search is not case sensitive
server = uncapitalize_server(server)
-- Check if mods found
for _, mod in ipairs(query.mods) do
if table.indexof(server.mods, mod) < 0 then
return false
end
end
-- Check if players found
for _, player in ipairs(query.players) do
if table.indexof(server.clients_list, player) < 0 then
return false
end
end
-- Check if game matches
if query.game and query.game ~= server.gameid then
return false
end
-- Check if keyword found
local name_matches = true
local description_matches = true
for _, keyword in ipairs(query.keywords) do
name_matches = name_matches and server.name:find(keyword, 1, true)
description_matches = description_matches and server.description:find(keyword, 1, true)
end
return name_matches and 50 or description_matches and 0
end
local function search_server_list(input, tabdata)
menudata.search_result = nil
if #serverlistmgr.servers < 2 then
return
end
-- setup the keyword list
local keywords = {}
for word in input:gmatch("%S+") do
word = word:gsub("(%W)", "%%%1")
table.insert(keywords, word)
end
if #keywords == 0 then
tabdata.pre_search_selection = tabdata.pre_search_selection or find_selected_server()
-- setup the search query
local query = parse_search_input(input)
if not query then
return
end
@ -207,26 +410,10 @@ local function search_server_list(input)
-- Search the serverlist
local search_result = {}
for i = 1, #serverlistmgr.servers do
local server = serverlistmgr.servers[i]
local found = 0
for k = 1, #keywords do
local keyword = keywords[k]
if server.name then
local sername = server.name:lower()
local _, count = sername:gsub(keyword, keyword)
found = found + count * 4
end
if server.description then
local desc = server.description:lower()
local _, count = desc:gsub(keyword, keyword)
found = found + count * 2
end
end
if found > 0 then
local points = (#serverlistmgr.servers - i) / 5 + found
server.points = points
for i, server in ipairs(serverlistmgr.servers) do
local match = matches_query(server, query)
if match then
server.points = #serverlistmgr.servers - i + match
table.insert(search_result, server)
end
end
@ -235,39 +422,32 @@ local function search_server_list(input)
return
end
local current_server = find_selected_server()
table.sort(search_result, function(a, b)
return a.points > b.points
end)
menudata.search_result = search_result
end
local function set_selected_server(tabdata, idx, server)
-- reset selection
if idx == nil or server == nil then
tabdata.selected = nil
core.settings:set("address", "")
core.settings:set("remote_port", "30000")
return
end
local address = server.address
local port = server.port
gamedata.serverdescription = server.description
gamedata.fav = false
for _, fav in ipairs(serverlistmgr.get_favorites()) do
if address == fav.address and port == fav.port then
gamedata.fav = true
break
-- Keep current selection if it's in search results
if current_server then
for _, server in ipairs(search_result) do
if server.address == current_server.address and
server.port == current_server.port then
return
end
end
end
if address and port then
core.settings:set("address", address)
core.settings:set("remote_port", port)
-- Find first compatible server (favorite or public)
for _, server in ipairs(search_result) do
if is_server_protocol_compat(server.proto_min, server.proto_max) then
set_selected_server(server)
return
end
end
tabdata.selected = idx
-- If no compatible server found, clear selection
set_selected_server(nil)
end
local function main_button_handler(tabview, fields, name, tabdata)
@ -300,45 +480,67 @@ local function main_button_handler(tabview, fields, name, tabdata)
gamedata.serverdescription = server.description
if gamedata.address and gamedata.port then
core.settings:set("address", gamedata.address)
core.settings:set("remote_port", gamedata.port)
set_selected_server(server)
core.start()
end
return true
end
if event.type == "CHG" then
set_selected_server(tabdata, event.row, server)
set_selected_server(server)
tabdata.pre_search_selection = nil
return true
end
end
end
if fields.btn_add_favorite then
serverlistmgr.add_favorite(find_selected_server())
return true
end
if fields.btn_delete_favorite then
local idx = core.get_table_index("servers")
if not idx then return end
local server = tabdata.lookup[idx]
if not server then return end
serverlistmgr.delete_favorite(server)
-- the server at [idx+1] will be at idx once list is refreshed
set_selected_server(tabdata, idx, tabdata.lookup[idx+1])
serverlistmgr.delete_favorite(tabdata.lookup[idx])
set_selected_server(tabdata.lookup[idx+1])
return true
end
if fields.btn_server_url then
core.open_url_dialog(find_selected_server().url)
return true
end
if fields.btn_view_clients then
local dlg = create_clientslist_dialog(find_selected_server())
dlg:set_parent(tabview)
tabview:hide()
dlg:show()
return true
end
if fields.btn_view_mods then
local dlg = create_server_list_mods_dialog(find_selected_server())
dlg:set_parent(tabview)
tabview:hide()
dlg:show()
return true
end
if fields.btn_mp_clear then
tabdata.search_for = ""
menudata.search_result = nil
if tabdata.pre_search_selection then
set_selected_server(tabdata.pre_search_selection)
tabdata.pre_search_selection = nil
end
return true
end
if fields.btn_mp_search or fields.key_enter_field == "te_search" then
tabdata.search_for = fields.te_search
search_server_list(fields.te_search:lower())
if menudata.search_result then
-- first server in row 2 due to header
set_selected_server(tabdata, 2, menudata.search_result[1])
end
search_server_list(fields.te_search, tabdata)
return true
end
@ -363,8 +565,6 @@ local function main_button_handler(tabview, fields, name, tabdata)
local idx = core.get_table_index("servers")
local server = idx and tabdata.lookup[idx]
set_selected_server(tabdata)
if server and server.address == gamedata.address and
server.port == gamedata.port then

View file

@ -0,0 +1,12 @@
local scriptpath = core.get_builtin_path()
local pausepath = scriptpath.."pause_menu"..DIR_DELIM
local commonpath = scriptpath.."common"..DIR_DELIM
-- we're in-game, so no absolute paths are needed
defaulttexturedir = ""
local builtin_shared = {}
assert(loadfile(commonpath .. "register.lua"))(builtin_shared)
assert(loadfile(pausepath .. "register.lua"))(builtin_shared)
dofile(commonpath .. "settings" .. DIR_DELIM .. "init.lua")

View file

@ -0,0 +1,5 @@
local builtin_shared = ...
local make_registration = builtin_shared.make_registration
core.registered_on_formspec_input, core.register_on_formspec_input = make_registration()

View file

@ -61,7 +61,7 @@
#
# # This is a comment
# #
# # Requires: shaders, enable_dynamic_shadows, !enable_waving_leaves
# # Requires: enable_dynamic_shadows, !enable_waving_leaves
# name (Readable name) type type_args
#
# A requirement can be the name of a boolean setting or an engine-defined value.
@ -69,8 +69,6 @@
#
# * The value of a boolean setting, such as enable_dynamic_shadows
# * An engine-defined value:
# * shaders_support (a video driver that supports shaders, may not be enabled)
# * shaders (both enable_shaders and shaders_support)
# * desktop / android
# * touchscreen / keyboard_mouse
# * opengl / gles
@ -79,8 +77,11 @@
# Sections are marked by a single line in the format: [Section Name]
# Sub-section are marked by adding * in front of the section name: [*Sub-section]
# Sub-sub-sections have two * etc.
# There shouldn't be too much settings per category; settings that shouldn't be
# modified by the "average user" should be in (sub-)categories called "Advanced".
# There shouldn't be too many settings per category.
#
# The top-level categories "Advanced", "Client and Server" and "Mapgen" are
# handled specially and its contents only shown when a checkbox is checked.
# They contain settings not intended for the "average user".
[Controls]
@ -255,8 +256,8 @@ fps_max (Maximum FPS) int 60 1 4294967295
# Vertical screen synchronization. Your system may still force VSync on even if this is disabled.
vsync (VSync) bool false
# Maximum FPS when the window is not focused, or when the game is paused.
fps_max_unfocused (FPS when unfocused or paused) int 20 1 4294967295
# Maximum FPS when the window is not focused.
fps_max_unfocused (FPS when unfocused) int 10 1 4294967295
# View distance in nodes.
viewing_range (Viewing range) int 190 20 4000
@ -265,6 +266,8 @@ viewing_range (Viewing range) int 190 20 4000
# to the game world only, keeping the GUI intact.
# It should give a significant performance boost at the cost of less detailed image.
# Higher values result in a less detailed image.
# Note: Undersampling is currently not supported if the "3d_mode" setting is set
# to a non-default value.
undersampling (Undersampling) int 1 1 8
[**3D]
@ -277,7 +280,6 @@ undersampling (Undersampling) int 1 1 8
# - topbottom: split screen top/bottom.
# - sidebyside: split screen side by side.
# - crossview: Cross-eyed 3d
# Note that the interlaced mode requires shaders to be enabled.
3d_mode (3D mode) enum none none,anaglyph,interlaced,topbottom,sidebyside,crossview
# Strength of 3D mode parallax.
@ -293,10 +295,6 @@ arm_inertia (Arm inertia) bool true
# For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double.
view_bobbing_amount (View bobbing factor) float 1.0 0.0 7.9
# Multiplier for fall bobbing.
# For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double.
fall_bobbing_amount (Fall bobbing factor) float 0.03 0.0 100.0
[**Camera]
# Field of view in degrees.
@ -375,17 +373,12 @@ fog_start (Fog start) float 0.4 0.0 0.99
[**Clouds]
# Clouds are a client-side effect.
enable_clouds (Clouds) bool true
# Use 3D cloud look instead of flat.
#
# Requires: enable_clouds
# Allow clouds to look 3D instead of flat.
enable_3d_clouds (3D clouds) bool true
# Use smooth cloud shading.
#
# Requires: enable_3d_clouds, enable_clouds
# Requires: enable_3d_clouds
soft_clouds (Soft clouds) bool false
[**Filtering and Antialiasing]
@ -404,6 +397,7 @@ bilinear_filter (Bilinear filtering) bool false
trilinear_filter (Trilinear filtering) bool false
# Use anisotropic filtering when looking at textures from an angle.
# This provides a significant improvement when used together with mipmapping.
anisotropic_filter (Anisotropic filtering) bool false
# Select the antialiasing method to apply.
@ -411,16 +405,18 @@ anisotropic_filter (Anisotropic filtering) bool false
# * None - No antialiasing (default)
#
# * FSAA - Hardware-provided full-screen antialiasing
# (incompatible with Post Processing and Undersampling)
# A.K.A multi-sample antialiasing (MSAA)
# Smoothens out block edges but does not affect the insides of textures.
# A restart is required to change this option.
#
# * FXAA - Fast approximate antialiasing (requires shaders)
# If Post Processing is disabled, changing FSAA requires a restart.
# Also, if Post Processing is disabled, FSAA will not work together with
# undersampling or a non-default "3d_mode" setting.
#
# * FXAA - Fast approximate antialiasing
# Applies a post-processing filter to detect and smoothen high-contrast edges.
# Provides balance between speed and image quality.
#
# * SSAA - Super-sampling antialiasing (requires shaders)
# * SSAA - Super-sampling antialiasing
# Renders higher-resolution image of the scene, then scales down to reduce
# the aliasing effects. This is the slowest and the most accurate method.
antialiasing (Antialiasing method) enum none none,fsaa,fxaa,ssaa
@ -467,24 +463,16 @@ smooth_lighting (Smooth lighting) bool true
# at the expense of minor visual glitches that do not impact game playability.
performance_tradeoffs (Tradeoffs for performance) bool false
# Adds particles when digging a node.
enable_particles (Digging particles) bool true
[**Waving Nodes]
# Set to true to enable waving leaves.
#
# Requires: shaders
enable_waving_leaves (Waving leaves) bool false
# Set to true to enable waving plants.
#
# Requires: shaders
enable_waving_plants (Waving plants) bool false
# Set to true to enable waving liquids (like water).
#
# Requires: shaders
enable_waving_water (Waving liquids) bool false
# The maximum height of the surface of waving liquids.
@ -492,99 +480,83 @@ enable_waving_water (Waving liquids) bool false
# 0.0 = Wave doesn't move at all.
# Default is 1.0 (1/2 node).
#
# Requires: shaders, enable_waving_water
# Requires: enable_waving_water
water_wave_height (Waving liquids wave height) float 1.0 0.0 4.0
# Length of liquid waves.
#
# Requires: shaders, enable_waving_water
# Requires: enable_waving_water
water_wave_length (Waving liquids wavelength) float 20.0 0.1
# How fast liquid waves will move. Higher = faster.
# If negative, liquid waves will move backwards.
#
# Requires: shaders, enable_waving_water
# Requires: enable_waving_water
water_wave_speed (Waving liquids wave speed) float 5.0
[**Dynamic shadows]
# Set to true to enable Shadow Mapping.
#
# Requires: shaders, opengl
# Requires: opengl
enable_dynamic_shadows (Dynamic shadows) bool false
# Set the shadow strength gamma.
# Adjusts the intensity of in-game dynamic shadows.
# Lower value means lighter shadows, higher value means darker shadows.
#
# Requires: shaders, enable_dynamic_shadows, opengl
# Requires: enable_dynamic_shadows, opengl
shadow_strength_gamma (Shadow strength gamma) float 1.0 0.1 10.0
# Maximum distance to render shadows.
#
# Requires: shaders, enable_dynamic_shadows, opengl
# Requires: enable_dynamic_shadows, opengl
shadow_map_max_distance (Shadow map max distance in nodes to render shadows) float 140.0 10.0 1000.0
# Texture size to render the shadow map on.
# This must be a power of two.
# Bigger numbers create better shadows but it is also more expensive.
#
# Requires: shaders, enable_dynamic_shadows, opengl
# Requires: enable_dynamic_shadows, opengl
shadow_map_texture_size (Shadow map texture size) int 2048 128 8192
# Sets shadow texture quality to 32 bits.
# On false, 16 bits texture will be used.
# This can cause much more artifacts in the shadow.
#
# Requires: shaders, enable_dynamic_shadows, opengl
# Requires: enable_dynamic_shadows, opengl
shadow_map_texture_32bit (Shadow map texture in 32 bits) bool true
# Enable Poisson disk filtering.
# On true uses Poisson disk to make "soft shadows". Otherwise uses PCF filtering.
#
# Requires: shaders, enable_dynamic_shadows, opengl
shadow_poisson_filter (Poisson filtering) bool true
# Define shadow filtering quality.
# This simulates the soft shadows effect by applying a PCF or Poisson disk
# but also uses more resources.
#
# Requires: shaders, enable_dynamic_shadows, opengl
# Requires: enable_dynamic_shadows, opengl
shadow_filters (Shadow filter quality) enum 1 0,1,2
# Enable colored shadows.
# On true translucent nodes cast colored shadows. This is expensive.
# Enable colored shadows for transculent nodes.
# This is expensive.
#
# Requires: shaders, enable_dynamic_shadows, opengl
# Requires: enable_dynamic_shadows, opengl
shadow_map_color (Colored shadows) bool false
# Spread a complete update of shadow map over given number of frames.
# Higher values might make shadows laggy, lower values
# will consume more resources.
# Minimum value: 1; maximum value: 16
#
# Requires: shaders, enable_dynamic_shadows, opengl
shadow_update_frames (Map shadows update frames) int 8 1 16
# Set the soft shadow radius size.
# Lower values mean sharper shadows, bigger values mean softer shadows.
# Minimum value: 1.0; maximum value: 15.0
#
# Requires: shaders, enable_dynamic_shadows, opengl
# Requires: enable_dynamic_shadows, opengl
shadow_soft_radius (Soft shadow radius) float 5.0 1.0 15.0
# Set the default tilt of Sun/Moon orbit in degrees.
# Games may change orbit tilt via API.
# Value of 0 means no tilt / vertical orbit.
#
# Requires: shaders, enable_dynamic_shadows, opengl
# Requires: enable_dynamic_shadows, opengl
shadow_sky_body_orbit_tilt (Sky Body Orbit Tilt) float 0.0 -60.0 60.0
[**Post Processing]
# Enables the post processing pipeline.
#
# Requires: shaders
enable_post_processing (Enable Post Processing) bool true
# Enables Hable's 'Uncharted 2' filmic tone mapping.
@ -592,7 +564,7 @@ enable_post_processing (Enable Post Processing) bool true
# appearance of high dynamic range images. Mid-range contrast is slightly
# enhanced, highlights and shadows are gradually compressed.
#
# Requires: shaders, enable_post_processing
# Requires: enable_post_processing
tone_mapping (Filmic tone mapping) bool false
# Enable automatic exposure correction
@ -600,14 +572,14 @@ tone_mapping (Filmic tone mapping) bool false
# automatically adjust to the brightness of the scene,
# simulating the behavior of human eye.
#
# Requires: shaders, enable_post_processing
# Requires: enable_post_processing
enable_auto_exposure (Enable Automatic Exposure) bool false
# Set the exposure compensation in EV units.
# Value of 0.0 (default) means no exposure compensation.
# Range: from -1 to 1.0
#
# Requires: shaders, enable_post_processing, enable_auto_exposure
# Requires: enable_post_processing, enable_auto_exposure
exposure_compensation (Exposure compensation) float 0.0 -1.0 1.0
# Apply dithering to reduce color banding artifacts.
@ -618,35 +590,35 @@ exposure_compensation (Exposure compensation) float 0.0 -1.0 1.0
# With OpenGL ES, dithering only works if the shader supports high
# floating-point precision and it may have a higher performance impact.
#
# Requires: shaders, enable_post_processing
# Requires: enable_post_processing
debanding (Enable Debanding) bool true
# Set to true to enable bloom effect.
# Bright colors will bleed over the neighboring objects.
#
# Requires: shaders, enable_post_processing
# Requires: enable_post_processing
enable_bloom (Enable Bloom) bool false
# Set to true to enable volumetric lighting effect (a.k.a. "Godrays").
#
# Requires: shaders, enable_post_processing, enable_bloom
# Requires: enable_post_processing, enable_bloom
enable_volumetric_lighting (Volumetric lighting) bool false
[**Other Effects]
# Simulate translucency when looking at foliage in the sunlight.
#
# Requires: shaders, enable_dynamic_shadows
# Requires: enable_dynamic_shadows
enable_translucent_foliage (Translucent foliage) bool false
# Apply specular shading to nodes.
#
# Requires: shaders, enable_dynamic_shadows
# Requires: enable_dynamic_shadows
enable_node_specular (Node specular) bool false
# When enabled, liquid reflections are simulated.
#
# Requires: shaders, enable_waving_water, enable_dynamic_shadows
# Requires: enable_waving_water, enable_dynamic_shadows
enable_water_reflections (Liquid reflections) bool false
[*Audio]
@ -658,8 +630,7 @@ sound_volume (Volume) float 0.8 0.0 1.0
# Volume multiplier when the window is unfocused.
sound_volume_unfocused (Volume when unfocused) float 0.3 0.0 1.0
# Whether to mute sounds. You can unmute sounds at any time, unless the
# sound system is disabled (enable_sound=false).
# Whether to mute sounds. You can unmute sounds at any time.
# In-game, you can toggle the mute state with the mute key or by using the
# pause menu.
mute_sound (Mute sound) bool false
@ -700,12 +671,6 @@ formspec_fullscreen_bg_color (Formspec Full-Screen Background Color) string (0,0
# to hardware (e.g. render-to-texture for nodes in inventory).
gui_scaling_filter (GUI scaling filter) bool false
# When gui_scaling_filter_txr2img is true, copy those images
# from hardware to software for scaling. When false, fall back
# to the old scaling method, for video drivers that don't
# properly support downloading textures back from hardware.
gui_scaling_filter_txr2img (GUI scaling filter txr2img) bool true
# Delay showing tooltips, stated in milliseconds.
tooltip_show_delay (Tooltip delay) int 400 0 18446744073709551615
@ -748,9 +713,6 @@ console_color (Console color) string (0,0,0)
# In-game chat console background alpha (opaqueness, between 0 and 255).
console_alpha (Console alpha) int 200 0 255
# Clickable weblinks (middle-click or Ctrl+left-click) enabled in chat console output.
clickable_chat_weblinks (Chat weblinks) bool true
# Optional override for chat weblink color.
chat_weblink_color (Weblink color) string #8888FF
@ -762,7 +724,7 @@ chat_font_size (Chat font size) int 0 0 72
[**Content Repository]
# The URL for the content repository
contentdb_url (ContentDB URL) string https://content.minetest.net
contentdb_url (ContentDB URL) string https://content.luanti.org
# If enabled and you have ContentDB packages installed, Luanti may contact ContentDB to
# check for package updates when opening the mainmenu.
@ -773,7 +735,7 @@ contentdb_enable_updates_indicator (Enable updates available indicator on conten
# as defined by the Free Software Foundation.
# You can also specify content ratings.
# These flags are independent from Luanti versions,
# so see a full list at https://content.minetest.net/help/content_flags/
# so see a full list at https://content.luanti.org/help/content_flags/
contentdb_flag_blacklist (ContentDB Flag Blacklist) string nonfree, desktop_default
# Maximum number of concurrent downloads. Downloads exceeding this limit will be queued.
@ -789,20 +751,20 @@ contentdb_max_concurrent_downloads (ContentDB Max Concurrent Downloads) int 3 1
enable_local_map_saving (Saving map received from server) bool false
# URL to the server list displayed in the Multiplayer Tab.
serverlist_url (Serverlist URL) string servers.minetest.net
serverlist_url (Serverlist URL) string https://servers.luanti.org
# If enabled, account registration is separate from login in the UI.
# If disabled, new accounts will be registered automatically when logging in.
# If enabled, server account registration is separate from login in the UI.
# If disabled, connecting to a server will automatically register a new account.
enable_split_login_register (Enable split login/register) bool true
# URL to JSON file which provides information about the newest Luanti release.
# If this is empty the engine will never check for updates.
update_information_url (Update information URL) string https://www.minetest.net/release_info.json
update_information_url (Update information URL) string https://www.luanti.org/release_info.json
[*Server]
# Name of the player.
# When running a server, clients connecting with this name are admins.
# When running a server, a client connecting with this name is admin.
# When starting from the main menu, this is overridden.
name (Admin name) string
@ -815,10 +777,10 @@ server_name (Server name) string Luanti server
server_description (Server description) string mine here
# Domain name of server, to be displayed in the serverlist.
server_address (Server address) string game.minetest.net
server_address (Server address) string game.example.net
# Homepage of server, to be displayed in the serverlist.
server_url (Server URL) string https://minetest.net
server_url (Server URL) string https://game.example.net
# Automatically report to the serverlist.
server_announce (Announce server) bool false
@ -827,7 +789,7 @@ server_announce (Announce server) bool false
server_announce_send_players (Send player names to the server list) bool true
# Announce to this serverlist.
serverlist_url (Serverlist URL) string servers.minetest.net
serverlist_url (Serverlist URL) string https://servers.luanti.org
# Message of the day displayed to players connecting.
motd (Message of the day) string
@ -866,10 +828,12 @@ protocol_version_min (Protocol version minimum) int 1 1 65535
# Files that are not present will be fetched the usual way.
remote_media (Remote media) string
# Enable/disable running an IPv6 server.
# Enable IPv6 support for server.
# Note that clients will be able to connect with both IPv4 and IPv6.
# Ignored if bind_address is set.
# Needs enable_ipv6 to be enabled.
ipv6_server (IPv6 server) bool false
#
# Requires: enable_ipv6
ipv6_server (IPv6 server) bool true
[*Server Security]
@ -1827,24 +1791,12 @@ profiler_print_interval (Engine profiling data print interval) int 0 0
[*Advanced]
# Enable IPv6 support (for both client and server).
# Required for IPv6 connections to work at all.
enable_ipv6 (IPv6) bool true
# If enabled, invalid world data won't cause the server to shut down.
# Only enable this if you know what you are doing.
ignore_world_load_errors (Ignore world errors) bool false
[**Graphics]
# Shaders are a fundamental part of rendering and enable advanced visual effects.
#
# Requires: shaders_support
enable_shaders (Shaders) bool true
# Enables debug and error-checking in the OpenGL driver.
opengl_debug (OpenGL debug) bool false
# Path to shader directory. If no path is defined, default location will be used.
#
# Requires: shaders
shader_path (Shader path) path
# The rendering back-end.
@ -1857,16 +1809,14 @@ video_driver (Video driver) enum ,opengl,opengl3,ogles2
# Set to 0 to disable it entirely.
transparency_sorting_distance (Transparency Sorting Distance) int 16 0 128
# Draw transparency sorted triangles grouped by their mesh buffers.
# This breaks transparency sorting between mesh buffers, but avoids situations
# where transparency sorting would be very slow otherwise.
transparency_sorting_group_by_buffers (Transparency Sorting Group by Buffers) bool true
# Radius of cloud area stated in number of 64 node cloud squares.
# Values larger than 26 will start to produce sharp cutoffs at cloud area corners.
cloud_radius (Cloud radius) int 12 1 62
# Whether node texture animations should be desynchronized per mapblock.
desynchronize_mapblock_texture_animation (Desynchronize block animation) bool false
# Enables caching of facedir rotated meshes.
# This is only effective with shaders disabled.
enable_mesh_cache (Mesh cache) bool false
cloud_radius (Cloud radius) int 12 8 62
# Delay between mesh updates on the client in ms. Increasing this will slow
# down the rate of mesh updates, thus reducing jitter on slower clients.
@ -1876,6 +1826,10 @@ mesh_generation_interval (Mapblock mesh generation delay) int 0 0 50
# Value of 0 (default) will let Luanti autodetect the number of available threads.
mesh_generation_threads (Mapblock mesh generation threads) int 0 0 8
# All mesh buffers with less than this number of vertices will be merged
# during map rendering. This improves rendering performance.
mesh_buffer_min_vertices (Minimum vertex count for mesh buffers) int 300 0 1000
# True = 256
# False = 128
# Usable to make minimap smoother on slower machines.
@ -1897,12 +1851,11 @@ world_aligned_mode (World-aligned textures mode) enum enable disable,enable,forc
# Warning: This option is EXPERIMENTAL!
autoscale_mode (Autoscaling mode) enum disable disable,enable,force
# When using bilinear/trilinear/anisotropic filters, low-resolution textures
# can be blurred, so automatically upscale them with nearest-neighbor
# interpolation to preserve crisp pixels. This sets the minimum texture size
# for the upscaled textures; higher values look sharper, but require more
# memory. Powers of 2 are recommended. This setting is ONLY applied if
# bilinear/trilinear/anisotropic filtering is enabled.
# When using bilinear/trilinear filtering, low-resolution textures
# can be blurred, so this option automatically upscales them to preserve
# crisp pixels. This defines the minimum texture size for the upscaled textures;
# higher values look sharper, but require more memory.
# This setting is ONLY applied if any of the mentioned filters are enabled.
# This is also used as the base node texture size for world-aligned
# texture autoscaling.
texture_min_size (Base texture size) int 64 1 32768
@ -1914,15 +1867,32 @@ texture_min_size (Base texture size) int 64 1 32768
# Systems with a low-end GPU (or no GPU) would benefit from smaller values.
client_mesh_chunk (Client Mesh Chunksize) int 1 1 16
# Enables debug and error-checking in the OpenGL driver.
opengl_debug (OpenGL debug) bool false
# Decide the color depth of the texture used for the post-processing pipeline.
# Reducing this can improve performance, but some effects (e.g. debanding)
# require more than 8 bits to work.
#
# Requires: enable_post_processing
post_processing_texture_bits (Color depth for post-processing texture) enum 16 8,10,16
# Enable Poisson disk filtering.
# On true uses Poisson disk to make "soft shadows". Otherwise uses PCF filtering.
#
# Requires: enable_dynamic_shadows, opengl
shadow_poisson_filter (Poisson filtering) bool true
# Spread a complete update of the shadow map over a given number of frames.
# Higher values might make shadows laggy, lower values
# will consume more resources.
#
# Requires: enable_dynamic_shadows, opengl
shadow_update_frames (Map shadows update frames) int 16 1 32
# Set to true to render debugging breakdown of the bloom effect.
# In debug mode, the screen is split into 4 quadrants:
# top-left - processed base image, top-right - final image
# bottom-left - raw base image, bottom-right - bloom texture.
#
# Requires: shaders, enable_post_processing, enable_bloom
# Requires: enable_post_processing, enable_bloom
enable_bloom_debug (Enable Bloom Debug) bool false
[**Sound]
@ -2006,6 +1976,10 @@ lighting_boost_spread (Light curve boost spread) float 0.2 0.0 0.4
[**Networking]
# Enable IPv6 support (for both client and server).
# Required for IPv6 connections to work at all.
enable_ipv6 (IPv6) bool true
# Prometheus listener address.
# If Luanti is compiled with ENABLE_PROMETHEUS option enabled,
# enable metrics listener for Prometheus on that address.
@ -2020,7 +1994,9 @@ max_out_chat_queue_size (Maximum size of the outgoing chat queue) int 20 -1 3276
client_unload_unused_data_timeout (Mapblock unload timeout) float 600.0 0.0
# Maximum number of mapblocks for client to be kept in memory.
# Set to -1 for unlimited amount.
# Note that there is an internal dynamic minimum number of blocks that
# won't be deleted, depending on the current view range.
# Set to -1 for no limit.
client_mapblock_limit (Mapblock limit) int 7500 -1 2147483647
# Maximum number of blocks that are simultaneously sent per client.
@ -2099,9 +2075,6 @@ max_block_send_distance (Max block send distance) int 12 1 65535
# Set this to -1 to disable the limit.
max_forceloaded_blocks (Maximum forceloaded blocks) int 16 -1
# Interval of sending time of day to clients, stated in seconds.
time_send_interval (Time send interval) float 5.0 0.001
# Interval of saving important changes in the world, stated in seconds.
server_map_save_interval (Map save interval) float 5.3 0.001
@ -2110,7 +2083,7 @@ server_map_save_interval (Map save interval) float 5.3 0.001
server_unload_unused_data_timeout (Unload unused server data) int 29 0 4294967295
# Maximum number of statically stored objects in a block.
max_objects_per_block (Maximum objects per block) int 256 1 65535
max_objects_per_block (Maximum objects per block) int 256 256 65535
# Length of time between active block management cycles, stated in seconds.
active_block_mgmt_interval (Active block management interval) float 2.0 0.0
@ -2211,6 +2184,13 @@ curl_file_download_timeout (cURL file download timeout) int 300000 5000 21474836
[**Miscellaneous]
# Clickable weblinks (middle-click or Ctrl+left-click) enabled in chat console output.
clickable_chat_weblinks (Chat weblinks) bool true
# If enabled, invalid world data won't cause the server to shut down.
# Only enable this if you know what you are doing.
ignore_world_load_errors (Ignore world errors) bool false
# Adjust the detected display density, used for scaling UI elements.
display_density_factor (Display Density Scaling Factor) float 1 0.5 5.0
@ -2329,12 +2309,6 @@ show_technical_names (Show technical names) bool false
# Controlled by a checkbox in the settings menu.
show_advanced (Show advanced settings) bool false
# Enables the sound system.
# If disabled, this completely disables all sounds everywhere and the in-game
# sound controls will be non-functional.
# Changing this setting requires a restart.
enable_sound (Sound) bool true
# Key for moving the player forward.
keymap_forward (Forward key) key KEY_KEY_W

View file

@ -9,6 +9,7 @@ attribute vec2 inTexCoord0;
/* Uniforms */
uniform float uThickness;
uniform mat4 uProjection;
/* Varyings */
@ -17,7 +18,7 @@ varying vec4 vVertexColor;
void main()
{
gl_Position = inVertexPosition;
gl_Position = uProjection * inVertexPosition;
gl_PointSize = uThickness;
vTextureCoord = inTexCoord0;
vVertexColor = inVertexColor.bgra;

View file

@ -1,6 +0,0 @@
varying lowp vec4 varColor;
void main(void)
{
gl_FragData[0] = varColor;
}

View file

@ -1,7 +0,0 @@
varying lowp vec4 varColor;
void main(void)
{
gl_Position = mWorldViewProj * inVertexPosition;
varColor = inVertexColor;
}

View file

@ -23,7 +23,12 @@ void main(void)
vec2 uv = varTexCoord.st;
vec3 color = texture2D(rendered, uv).rgb;
// translate to linear colorspace (approximate)
#ifdef GL_ES
// clamp color to [0,1] range in lieu of centroids
color = pow(clamp(color, 0.0, 1.0), vec3(2.2));
#else
color = pow(color, vec3(2.2));
#endif
color *= exposureParams.compensationFactor * bloomStrength;

View file

@ -1,7 +1,3 @@
#if (MATERIAL_TYPE == TILE_MATERIAL_WAVING_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_WAVING_LIQUID_OPAQUE || MATERIAL_TYPE == TILE_MATERIAL_WAVING_LIQUID_BASIC || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT)
#define MATERIAL_WAVING_LIQUID 1
#endif
uniform sampler2D baseTexture;
uniform vec3 dayLight;
@ -43,17 +39,19 @@ varying vec3 vPosition;
// cameraOffset + worldPosition (for large coordinates the limits of float
// precision must be considered).
varying vec3 worldPosition;
varying lowp vec4 varColor;
#ifdef GL_ES
varying lowp vec4 varColor;
varying mediump vec2 varTexCoord;
varying float nightRatio;
#else
centroid varying lowp vec4 varColor;
centroid varying vec2 varTexCoord;
centroid varying float nightRatio;
#endif
varying highp vec3 eyeVec;
varying float nightRatio;
#ifdef ENABLE_DYNAMIC_SHADOWS
#if (defined(MATERIAL_WAVING_LIQUID) && defined(ENABLE_WATER_REFLECTIONS) && ENABLE_WAVING_WATER)
#if (defined(ENABLE_WATER_REFLECTIONS) && MATERIAL_WATER_REFLECTIONS && ENABLE_WAVING_WATER)
vec4 perm(vec4 x)
{
return mod(((x * 34.0) + 1.0) * x, 289.0);
@ -504,7 +502,7 @@ void main(void)
vec3 viewVec = normalize(worldPosition + cameraOffset - cameraPosition);
// Water reflections
#if (defined(MATERIAL_WAVING_LIQUID) && defined(ENABLE_WATER_REFLECTIONS) && ENABLE_WAVING_WATER)
#if (defined(ENABLE_WATER_REFLECTIONS) && MATERIAL_WATER_REFLECTIONS && ENABLE_WAVING_WATER)
vec3 wavePos = worldPosition * vec3(2.0, 0.0, 2.0);
float off = animationTimer * WATER_WAVE_SPEED * 10.0;
wavePos.x /= WATER_WAVE_LENGTH * 3.0;
@ -532,7 +530,7 @@ void main(void)
col.rgb += water_reflect_color * f_adj_shadow_strength * brightness_factor;
#endif
#if (defined(ENABLE_NODE_SPECULAR) && !defined(MATERIAL_WAVING_LIQUID))
#if (defined(ENABLE_NODE_SPECULAR) && !MATERIAL_WATER_REFLECTIONS)
// Apply specular to blocks.
if (dot(v_LightDirection, vNormal) < 0.0) {
float intensity = 2.0 * (1.0 - (base.r * varColor.r));

View file

@ -14,14 +14,17 @@ varying vec3 vPosition;
// cameraOffset + worldPosition (for large coordinates the limits of float
// precision must be considered).
varying vec3 worldPosition;
varying lowp vec4 varColor;
// The centroid keyword ensures that after interpolation the texture coordinates
// lie within the same bounds when MSAA is en- and disabled.
// This fixes the stripes problem with nearest-neighbor textures and MSAA.
#ifdef GL_ES
varying lowp vec4 varColor;
varying mediump vec2 varTexCoord;
varying float nightRatio;
#else
centroid varying lowp vec4 varColor;
centroid varying vec2 varTexCoord;
centroid varying float nightRatio;
#endif
#ifdef ENABLE_DYNAMIC_SHADOWS
// shadow uniforms
@ -44,7 +47,6 @@ centroid varying vec2 varTexCoord;
varying float area_enable_parallax;
varying highp vec3 eyeVec;
varying float nightRatio;
// Color of the light emitted by the light sources.
const vec3 artificialLight = vec3(1.04, 1.04, 1.04);
const float e = 2.718281828459;
@ -108,8 +110,7 @@ float smoothTriangleWave(float x)
return smoothCurve(triangleWave(x)) * 2.0 - 1.0;
}
// OpenGL < 4.3 does not support continued preprocessor lines
#if (MATERIAL_TYPE == TILE_MATERIAL_WAVING_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_WAVING_LIQUID_OPAQUE || MATERIAL_TYPE == TILE_MATERIAL_WAVING_LIQUID_BASIC) && ENABLE_WAVING_WATER
#if MATERIAL_WAVING_LIQUID && ENABLE_WAVING_WATER
//
// Simple, fast noise function.
@ -166,8 +167,7 @@ void main(void)
#endif
vec4 pos = inVertexPosition;
// OpenGL < 4.3 does not support continued preprocessor lines
#if (MATERIAL_TYPE == TILE_MATERIAL_WAVING_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_WAVING_LIQUID_OPAQUE || MATERIAL_TYPE == TILE_MATERIAL_WAVING_LIQUID_BASIC) && ENABLE_WAVING_WATER
#if MATERIAL_WAVING_LIQUID && ENABLE_WAVING_WATER
// Generate waves with Perlin-type noise.
// The constants are calibrated such that they roughly
// correspond to the old sine waves.

View file

@ -61,7 +61,7 @@ vec4 applyBloom(vec4 color, vec2 uv)
equation used: ((x * (A * x + C * B) + D * E) / (x * (A * x + B) + D * F)) - E / F
*/
// see https://github.com/minetest/minetest/pull/14688
// highp for GLES, see <https://github.com/luanti-org/luanti/pull/14688>
highp vec3 uncharted2Tonemap(highp vec3 x)
{
return ((x * (0.22 * x + 0.03) + 0.002) / (x * (0.22 * x + 0.3) + 0.06)) - 0.03333;

View file

@ -1,7 +1,7 @@
# Project properties
PROJECT_NAME = @PROJECT_NAME_CAPITALIZED@
PROJECT_NUMBER = @VERSION_STRING@
PROJECT_LOGO = @CMAKE_CURRENT_SOURCE_DIR@/misc/minetest.svg
PROJECT_LOGO = @CMAKE_CURRENT_SOURCE_DIR@/misc/luanti.svg
# Parsing
JAVADOC_AUTOBRIEF = YES

View file

@ -3,8 +3,6 @@ All Luanti builds, including the Android variant, are based on the same code.
However, additional Java code is used for proper Android integration.
## Controls
Compared to Luanti binaries for PC, the Android port has limited functionality
due to limited capabilities of common devices. What can be done is described below:
While you're playing the game normally (that is, no menu or inventory is
shown), the following controls are available:
@ -44,7 +42,7 @@ configuration file can usually be found at:
* After 5.4.2:
* `/sdcard/Android/data/net.minetest.minetest/` or `/storage/emulated/0/Android/data/net.minetest.minetest/` if stored on the device
* `/storage/emulated/(varying folder name)/Android/data/net.minetest.minetest/` if stored on the SD card
* [Learn more about Android directory](https://wiki.minetest.net/Accessing_Android_Data_Directory)
* [Learn more about Android directory](https://wiki.luanti.org/Accessing_Android_Data_Directory)
## Useful settings
@ -58,35 +56,25 @@ Mobile device generally have less RAM than PC, this setting limit how many mapbl
this setting limit max FPS (Frame per second). Default value is 60, which lowest Android device screen refresh rate commonly found, but if you're using an device have lower refresh rate, change this
## Requirements
The minimal and recommended system requirements for Luanti are listed below.
The recommended system requirements for Luanti are listed below.
### CPU
Supported architectures:
1. ARM v7
2. ARM v8
1. ARMv7
2. AArch64
3. x86
4. x86_64
CPU architectures similar to ARM or x86 might run Luanti but are not tested.
### Minimum
1. Graphics API: OpenGL ES 1.0
* Shaders might not work correctly or work at all on OpenGL ES 1.0.
2. Android version: Android 4.1 (API Level 16)
3. Free RAM: 500 MB
4. Free storage: 100 MB
* More storage is highly recommended
### Recommended
1. Graphics API: OpenGL ES 2.0
2. Android version: Android 4.4 (API Level 19) or newer
3. Empty RAM: 850 MB
4. Free storage: 480 MB
2. Android version: Android 5 (API Level 21) or newer
3. Free RAM: 1 GB
4. Free storage: 500 MB
## Rendering
Unlike on PC, Android devices use OpenGL ES which less powerful than OpenGL, thus
some shader settings cannot be used on OpenGL ES.
Changing the graphic driver setting to OpenGL will result in undesirable behavior.
Changing the graphic driver setting to OpenGL will not work.
## Building Requirements
In order to build, your PC has to be set up to build Luanti in the usual

View file

@ -10,14 +10,16 @@ This list is largely advisory and items may be reevaluated once the time comes.
* `game.conf` name/id mess
* remove `depends.txt` / `description.txt` (would simplify ContentDB and Luanti code a little)
* rotate moon texture by 180°, making it coherent with the sun
* https://github.com/minetest/minetest/pull/11902
* https://github.com/luanti-org/luanti/pull/11902
* remove undocumented `set_physics_override(num, num, num)`
* remove special handling of `${key}` syntax in metadata values
* remove old_move
* change physics_override `sneak` to disable the speed change and not just the node clipping
* https://github.com/minetest/minetest/issues/13699
* https://github.com/luanti-org/luanti/issues/13699
* migrate from player names to UUIDs, this would enable renaming of accounts and unicode player names (if desired)
* harmonize use_texture_alpha between entities & nodes, change default to 'opaque' and remove bool compat code
* merge `sound` and `sounds` table in itemdef
* remove `DIR_DELIM` from Lua
* stop reading initial properties from bare entity def
* change particle default blend mode to `clip`
* remove built-in knockback and related functions entirely

View file

@ -1,12 +1,12 @@
Luanti Lua Client Modding API Reference 5.10.0
Luanti Lua Client Modding API Reference 5.12.0
==============================================
**WARNING**: if you're looking for the `minetest` namespace (e.g. `minetest.something`),
it's now called `core` due to the renaming of Luanti (formerly Minetest).
`minetest` will keep existing as an alias, so that old code won't break.
* More information at <http://www.minetest.net/>
* Developer Wiki: <http://dev.minetest.net/>
* More information at <http://www.luanti.org/>
* Developer Wiki: <https://dev.luanti.org/>
Introduction
------------
@ -23,7 +23,7 @@ Transferring client-sided mods from the server to the client is planned, but not
If you see a deficiency in the API, feel free to attempt to add the
functionality in the engine and API. You can send such improvements as
source code patches on GitHub (https://github.com/minetest/minetest).
source code patches on GitHub.
Programming in Lua
------------------

View file

@ -30,6 +30,7 @@ General options and their default values:
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_OPENSSL=ON - Build with OpenSSL; Speeds up SHA1 and SHA2 hashing
ENABLE_SOUND=ON - Build with OpenAL, libogg & libvorbis; in-game sounds
ENABLE_LTO=<varies> - Build with IPO/LTO optimizations (smaller and more efficient than regular build)
ENABLE_LUAJIT=ON - Build with LuaJIT (much faster than non-JIT Lua)
@ -61,7 +62,14 @@ Library specific options:
GETTEXT_INCLUDE_DIR - Only when building with gettext; directory that contains libintl.h
GETTEXT_LIBRARY - Optional/platform-dependent with gettext; path to libintl.so/libintl.dll.a
GETTEXT_MSGFMT - Only when building with gettext; path to msgfmt/msgfmt.exe
GMP_INCLUDE_DIR - Directory that contains gmp.h
GMP_LIBRARY - Path to libgmp.a/libgmp.so/libgmp.lib
ICONV_LIBRARY - Optional/platform-dependent; path to libiconv.so/libiconv.dylib
JPEG_DLL - Only on Windows; path to libjpeg.dll
JPEG_INCLUDE_DIR - Directory that contains jpeg.h
JPEG_LIBRARY - Path to libjpeg.a/libjpeg.so/libjpeg.lib
JSON_INCLUDE_DIR - Directory that contains json/allocator.h
JSON_LIBRARY - Path to libjson.a/libjson.so/libjson.lib
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
@ -79,6 +87,12 @@ Library specific options:
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
PNG_DLL - Only on Windows; path to libpng.dll
PNG_INCLUDE_DIR - Directory that contains png.h
PNG_LIBRARY - Path to libpng.a/libpng.so/libpng.lib
PROMETHEUS_PULL_LIBRARY - Only if building with prometheus; path to prometheus-cpp-pull
PROMETHEUS_CORE_LIBRARY - Only if building with prometheus; path to prometheus-cpp-core
PROMETHEUS_CPP_INCLUDE_DIR - Only if building with prometheus; directory where prometheus/counter.h is located
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

View file

@ -18,30 +18,31 @@
| JsonCPP | 1.0.0+ | Bundled JsonCPP is used if not present |
| Curl | 7.56.0+ | Optional |
| gettext | - | Optional |
| OpenSSL | 3.0+ | Optional (only libcrypto used) |
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 gettext
sudo apt install g++ make libc6-dev cmake libpng-dev libjpeg-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 gettext libsdl2-dev
For Fedora users:
sudo dnf install make automake gcc gcc-c++ kernel-devel cmake libcurl-devel openal-soft-devel libpng-devel libjpeg-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 gettext
sudo dnf install make automake gcc gcc-c++ kernel-devel cmake libcurl-devel openal-soft-devel libpng-devel libjpeg-devel libvorbis-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 gettext SDL2-devel
For openSUSE users:
sudo zypper install gcc gcc-c++ cmake libjpeg8-devel libpng16-devel openal-soft-devel libcurl-devel sqlite3-devel luajit-devel libzstd-devel Mesa-libGL-devel libXi-devel libvorbis-devel freetype2-devel
sudo zypper install gcc gcc-c++ cmake libjpeg8-devel libpng16-devel openal-soft-devel libcurl-devel sqlite3-devel luajit-devel libzstd-devel Mesa-libGL-devel libvorbis-devel freetype2-devel SDL2-devel
For Arch users:
sudo pacman -S --needed base-devel libcurl-gnutls cmake libxi libpng sqlite libogg libvorbis openal freetype2 jsoncpp gmp luajit leveldb ncurses zstd gettext
sudo pacman -S --needed base-devel libcurl-gnutls cmake libpng libjpeg-turbo sqlite libogg libvorbis openal freetype2 jsoncpp gmp luajit leveldb ncurses zstd gettext sdl2
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 gettext
sudo apk add build-base cmake libpng-dev jpeg-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 gettext sdl2-dev
For Void users:
sudo xbps-install cmake libpng-devel jpeg-devel libXi-devel mesa sqlite-devel libogg-devel libvorbis-devel libopenal-devel libcurl-devel freetype-devel zlib-devel gmp-devel jsoncpp-devel LuaJIT-devel zstd libzstd-devel gettext
sudo xbps-install cmake libpng-devel jpeg-devel mesa sqlite-devel libogg-devel libvorbis-devel libopenal-devel libcurl-devel freetype-devel zlib-devel gmp-devel jsoncpp-devel LuaJIT-devel zstd libzstd-devel gettext SDL2-devel
## Download
@ -69,14 +70,14 @@ For Void users:
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
git clone --depth 1 https://github.com/luanti-org/luanti
cd luanti
Download source, without using Git:
wget https://github.com/minetest/minetest/archive/master.tar.gz
wget https://github.com/luanti-org/luanti/archive/master.tar.gz
tar xf master.tar.gz
cd minetest-master
cd luanti-master
## Build
@ -87,7 +88,7 @@ Build a version that runs directly from the source directory:
Run it:
./bin/minetest
./bin/luanti
- 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),

View file

@ -16,11 +16,13 @@ brew install cmake freetype gettext gmp hiredis jpeg-turbo jsoncpp leveldb libog
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
git clone --depth 1 https://github.com/luanti-org/luanti luanti
cd luanti
```
## Build
## Building for personal usage
### Build
```bash
mkdir build
@ -34,12 +36,65 @@ cmake .. \
make -j$(sysctl -n hw.logicalcpu)
make install
# M1 Macs w/ MacOS >= BigSur
codesign --force --deep -s - macos/minetest.app
# Apple Silicon (M1/M2) Macs w/ MacOS >= BigSur signature for local run
codesign --force --deep -s - --entitlements ../misc/macos/entitlements/debug.entitlements macos/luanti.app
```
## Run
If you are using LuaJIT with `MAP_JIT` support use `debug_map_jit.entitlements`.
### Run
```
open ./build/macos/minetest.app
open ./build/macos/luanti.app
```
## Building for distribution
### Generate Xcode project
```bash
mkdir build
cd build
cmake .. \
-DCMAKE_FIND_FRAMEWORK=LAST \
-DRUN_IN_PLACE=FALSE -DENABLE_GETTEXT=TRUE \
-DFREETYPE_LIBRARY=/path/to/lib/dir/libfreetype.a \
-DGETTEXT_INCLUDE_DIR=/path/to/include/dir \
-DGETTEXT_LIBRARY=/path/to/lib/dir/libintl.a \
-DLUA_LIBRARY=/path/to/lib/dir/libluajit-5.1.a \
-DOGG_LIBRARY=/path/to/lib/dir/libogg.a \
-DVORBIS_LIBRARY=/path/to/lib/dir/libvorbis.a \
-DVORBISFILE_LIBRARY=/path/to/lib/dir/libvorbisfile.a \
-DZSTD_LIBRARY=/path/to/lib/dir/libzstd.a \
-DGMP_LIBRARY=/path/to/lib/dir/libgmp.a \
-DJSON_LIBRARY=/path/to/lib/dir/libjsoncpp.a \
-DENABLE_LEVELDB=OFF \
-DENABLE_POSTGRESQL=OFF \
-DENABLE_REDIS=OFF \
-DJPEG_LIBRARY=/path/to/lib/dir/libjpeg.a \
-DPNG_LIBRARY=/path/to/lib/dir/libpng.a \
-DCMAKE_EXE_LINKER_FLAGS=-lbz2\
-GXcode
```
If you are using LuaJIT with `MAP_JIT` support add `-DXCODE_CODE_SIGN_ENTITLEMENTS=../misc/macos/entitlements/release_map_jit.entitlements`.
*WARNING:* You have to regenerate Xcode project if you switch commit, branch or etc.
### Build and Run
* Open generated Xcode project
* Select scheme `luanti`
* Configure signing Team etc.
* Run Build command
* Open application from `build/build/Debug/` directory or run it from Xcode
### Archive and Run
* Open generated Xcode project
* Select scheme `luanti`
* Configure signing Team etc.
* Run Build command
* Open application archive in finder, go into it, copy application and test it.

View file

@ -13,9 +13,8 @@
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 gettext[tools] opengl-registry --triplet x64-windows
vcpkg install zlib zstd curl[winssl] openal-soft libvorbis libogg libjpeg-turbo sqlite3 freetype luajit gmp jsoncpp gettext[tools] sdl2 --triplet x64-windows
```
- `curl` is optional, but required to read the serverlist, `curl[winssl]` is required to use the content store.
@ -34,8 +33,8 @@ Use `--triplet` to specify the target triplet, e.g. `x64-windows` or `x86-window
### 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
2. Select **Browse Source...** and select DIR/luanti
3. Select **Browse Build...** and select DIR/luanti-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**

View file

@ -2,15 +2,15 @@
## Wiki
Some important development docs are found in the wiki: https://dev.minetest.net/
Some important development docs are found in the wiki: https://dev.luanti.org/
Notable pages:
- [Releasing Luanti](https://dev.minetest.net/Releasing_Minetest)
- [Engine translations](https://dev.minetest.net/Translation#Maintaining_engine_translations)
- [Changelog](https://dev.minetest.net/Changelog)
- [Organisation](https://dev.minetest.net/Organisation)
- [Code style guidelines](https://dev.minetest.net/Code_style_guidelines)
- [Releasing Luanti](https://dev.luanti.org/Releasing_Luanti)
- [Engine translations](https://dev.luanti.org/Translation#Maintaining_engine_translations)
- [Changelog](https://dev.luanti.org/Changelog)
- [Organisation](https://dev.luanti.org/Organisation)
- [Code style guidelines](https://dev.luanti.org/Code_style_guidelines)
## In this folder
@ -23,4 +23,4 @@ Notable pages:
Oftentimes knowledge hasn't been written down (yet) and your best bet is to ask someone experienced and/or the core developers.
Feel free to join the [#minetest-dev IRC](https://wiki.minetest.net/IRC) and ask questions related to **engine development**.
Feel free to join the [#minetest-dev IRC](https://wiki.luanti.org/IRC) and ask questions related to **engine development**.

View file

@ -2,7 +2,7 @@
## Sign the Android APK from CI
The [Github Actions Workflow](https://github.com/minetest/minetest/actions?query=workflow%3Aandroid+event%3Apush)
The [Github Actions Workflow](https://github.com/luanti-org/luanti/actions?query=workflow%3Aandroid+event%3Apush)
automatically produces an APK for each architecture.
Before installing them onto a device they however need to be signed.

View file

@ -9,7 +9,7 @@ To get usable results you need to build Luanti with debug symbols
Run the client (or server) like this and do whatever you wanted to test:
```bash
perf record -z --call-graph dwarf -- ./bin/minetest
perf record -z --call-graph dwarf -- ./bin/luanti
```
This will leave a file called "perf.data".

View file

@ -45,13 +45,8 @@ There's usually no reason to raise this unless the NDK drops older versions.
**Compilers**: gcc, clang and MSVC (exceptions exist)
**OpenGL** is an entirely different beast, there is no formal consensus on changing the requirements
and neither do we have an exact set of requirements.
We still support OpenGL 1.4 without shaders (fixed-pipeline), which could be considered very unreasonable in 2024.
OpenGL ES 2.0 is supported for the sake of mobile platforms.
It has been [proposed](https://irc.minetest.net/minetest-dev/2022-08-18) moving to OpenGL 2.x or 3.0 with shaders required.
We require **OpenGL** 2.0 or ES 2.0, so shaders can be relied on.
Graphics code should generally work on both. Newer features can be used as long as a fallback exists.
General **system requirements** are not bounded either.
Being able to play Luanti on a recent low-end phone is a reasonable target.

View file

@ -6,9 +6,9 @@ The long-term roadmaps, aims, and guiding philosophies are set out using the
following documents:
* [What is Minetest?](http://c55.me/blog/?p=1491)
* [celeron55's roadmap](https://forum.minetest.net/viewtopic.php?t=9177)
* [celeron55's comment in "A clear mission statement for Minetest is missing"](https://github.com/minetest/minetest/issues/3476#issuecomment-167399287)
* [Core developer to-do/wish lists](https://forum.minetest.net/viewforum.php?f=7)
* [celeron55's roadmap](https://forum.luanti.org/viewtopic.php?t=9177)
* [celeron55's comment in "A clear mission statement for Minetest is missing"](https://github.com/luanti-org/luanti/issues/3476#issuecomment-167399287)
* [Core developer to-do/wish lists](https://forum.luanti.org/viewforum.php?f=7)
## 2. Medium-term Roadmap
@ -16,7 +16,7 @@ These are the current medium-term goals for Luanti development, in no
particular order.
These goals were created from the top points in a
[roadmap brainstorm](https://github.com/minetest/minetest/issues/10461).
[roadmap brainstorm](https://github.com/luanti-org/luanti/issues/10461).
This should be reviewed approximately yearly, or when goals are achieved.
Pull requests that address one of these goals will be labeled as "Roadmap".
@ -32,9 +32,9 @@ Once that is done, fancier features can be worked on, such as water shaders,
shadows, and improved lighting.
Examples include
[transparency sorting](https://github.com/minetest/minetest/issues/95),
[particle performance](https://github.com/minetest/minetest/issues/1414),
[general view distance](https://github.com/minetest/minetest/issues/7222).
[transparency sorting](https://github.com/luanti-org/luanti/issues/95),
[particle performance](https://github.com/luanti-org/luanti/issues/1414),
[general view distance](https://github.com/luanti-org/luanti/issues/7222).
This includes work on maintaining
[our Irrlicht fork](https://github.com/minetest/irrlicht), and switching to
@ -43,16 +43,16 @@ alternative libraries to replace Irrlicht functionality as needed
### 2.2 Internal code refactoring
To ensure sustainable development, Luanti's code needs to be
[refactored and improved](https://github.com/minetest/minetest/pulls?q=is%3Aopen+sort%3Aupdated-desc+label%3A%22Code+quality%22+).
[refactored and improved](https://github.com/luanti-org/luanti/pulls?q=is%3Aopen+sort%3Aupdated-desc+label%3A%22Code+quality%22).
This will remove code rot and allow for more efficient development.
### 2.3 UI Improvements
A [formspec replacement](https://github.com/minetest/minetest/issues/6527) is
A [formspec replacement](https://github.com/luanti-org/luanti/issues/6527) is
needed to make GUIs better and easier to create. This replacement could also
be a replacement for HUDs, allowing for a unified API.
A [new mainmenu](https://github.com/minetest/minetest/issues/6733) is needed to
A [new mainmenu](https://github.com/luanti-org/luanti/issues/6733) is needed to
improve user experience. First impressions matter, and the current main menu
doesn't do a very good job at selling Luanti or explaining what it is.
A new main menu should promote games to users, allowing Minetest Game to no
@ -65,5 +65,5 @@ an issue for any large changes before spending lots of time.
There are still a significant number of issues with objects.
Collisions,
[performance](https://github.com/minetest/minetest/issues/6453),
[performance](https://github.com/luanti-org/luanti/issues/6453),
API convenience, and discrepancies between players and entities.

View file

@ -4,22 +4,25 @@ We provide Luanti server Docker images using the GitHub container registry.
Images are built on each commit and available using the following tag scheme:
* `ghcr.io/minetest/minetest:master` (latest build)
* `ghcr.io/minetest/minetest:<tag>` (specific Git tag)
* `ghcr.io/minetest/minetest:latest` (latest Git tag, which is the stable release)
* `ghcr.io/luanti-org/luanti:master` (latest build)
* `ghcr.io/luanti-org/luanti:<tag>` (specific Git tag)
* `ghcr.io/luanti-org/luanti:latest` (latest Git tag, which is the stable release)
See [here](https://github.com/minetest/minetest/pkgs/container/minetest) for all available tags.
See [here](https://github.com/luanti-org/luanti/pkgs/container/luanti) for all available tags.
Versions released before the project was renamed are available with the same tag scheme at `ghcr.io/minetest/minetest`.
See [here](https://github.com/orgs/minetest/packages/container/package/minetest) for all available tags.
For a quick test you can easily run:
```shell
docker run ghcr.io/minetest/minetest:master
docker run ghcr.io/luanti-org/luanti:master
```
To use it in a production environment, you should use volumes bound to the Docker host to persist data and modify the configuration:
```shell
docker create -v /home/minetest/data/:/var/lib/minetest/ -v /home/minetest/conf/:/etc/minetest/ ghcr.io/minetest/minetest:master
docker create -v /home/minetest/data/:/var/lib/minetest/ -v /home/minetest/conf/:/etc/minetest/ ghcr.io/luanti-org/luanti:master
```
You may also want to use [Docker Compose](https://docs.docker.com/compose):
@ -29,7 +32,7 @@ You may also want to use [Docker Compose](https://docs.docker.com/compose):
version: "2"
services:
minetest_server:
image: ghcr.io/minetest/minetest:master
image: ghcr.io/luanti-org/luanti:master
restart: always
networks:
- default

View file

@ -5,10 +5,10 @@ Luanti Lua Modding API Reference
it's now called `core` due to the renaming of Luanti (formerly Minetest).
`minetest` will keep existing as an alias, so that old code won't break.
* More information at <http://www.minetest.net/>
* Developer Wiki: <http://dev.minetest.net/>
* More information at <http://www.luanti.org/>
* Developer Wiki: <https://dev.luanti.org/>
* (Unofficial) Minetest Modding Book by rubenwardy: <https://rubenwardy.com/minetest_modding_book/>
* Modding tools: <https://github.com/minetest/modtools>
* Modding tools: <https://github.com/luanti-org/modtools>
Introduction
------------
@ -188,14 +188,14 @@ Mod directory structure
│   ├── models
│   ├── textures
│   │   ├── modname_stuff.png
│   │   ├── modname_stuff_normal.png
│   │   ├── modname_something_else.png
│   │   ├── subfolder_foo
│   │   │ ├── modname_more_stuff.png
│   │   │ └── another_subfolder
│   │   └── bar_subfolder
│   ├── sounds
│   ├── media
│   ├── fonts
│ ├── media
│   ├── locale
│   └── <custom data>
└── another
@ -266,7 +266,7 @@ The main Lua script. Running this script should register everything it
wants to register. Subsequent execution depends on Luanti calling the
registered callbacks.
### `textures`, `sounds`, `media`, `models`, `locale`
### `textures`, `sounds`, `media`, `models`, `locale`, `fonts`
Media files (textures, sounds, whatever) that will be transferred to the
client and will be available for use by the mod and translation files for
@ -276,9 +276,10 @@ the clients (see [Translations]). Accepted characters for names are:
Accepted formats are:
images: .png, .jpg, .tga, (deprecated:) .bmp
images: .png, .jpg, .tga
sounds: .ogg vorbis
models: .x, .b3d, .obj, (since version 5.10:) .gltf, .glb
fonts: .ttf, .woff (both since version 5.11, see notes below)
Other formats won't be sent to the client (e.g. you can store .blend files
in a folder for convenience, without the risk that such files are transferred)
@ -309,19 +310,24 @@ it unlocks no special rendering features.
Binary glTF (`.glb`) files are supported and recommended over `.gltf` files
due to their space savings.
This means that many glTF features are not supported *yet*, including:
Bone weights should be normalized, e.g. using ["normalize all" in Blender](https://docs.blender.org/manual/en/4.2/grease_pencil/modes/weight_paint/weights_menu.html#normalize-all).
You can use the [Khronos glTF validator](https://github.com/KhronosGroup/glTF-Validator)
to check whether a model is a valid glTF file.
Many glTF features are not supported *yet*, including:
* Animations
* Only a single animation is supported,
use frame ranges within this animation.
* Only integer frames are supported.
* Only a single animation is supported, use frame ranges within this animation.
* `CUBICSPLINE` interpolation is not supported.
* Cameras
* Materials
* Only base color textures are supported
* Backface culling is overridden
* Double-sided materials don't work
* Alternative means of supplying data
* Embedded images
* Embedded images. You can use `gltfutil.py` from the
[modding tools](https://github.com/luanti-org/modtools) to strip or extract embedded images.
* References to files via URIs
Textures are supplied solely via the same means as for the other model file formats:
@ -338,6 +344,28 @@ For example, if your model used an emissive material,
you should expect that a future version of Luanti may respect this,
and thus cause your model to render differently there.
#### Custom fonts
You can supply custom fonts in TrueType Font (`.ttf`) or Web Open Font Format (`.woff`) format.
The former is supported primarily for convenience. The latter is preferred due to its compression.
In the future, having multiple custom fonts and the ability to switch between them is planned,
but for now this feature is limited to the ability to override Luanti's default fonts via mods.
It is recommended that this only be used by game mods to set a look and feel.
The stems (file names without extension) are self-explanatory:
* Regular variants:
* `regular`
* `bold`
* `italic`
* `bold_italic`
* Monospaced variants:
* `mono`
* `mono_bold`
* `mono_italic`
* `mono_bold_italic`
Naming conventions
------------------
@ -488,9 +516,7 @@ stripping out the file extension:
* e.g. `foomod_foothing.png`
* e.g. `foomod_foothing`
Supported texture formats are PNG (`.png`), JPEG (`.jpg`), Bitmap (`.bmp`)
and Targa (`.tga`).
Since better alternatives exist, the latter two may be removed in the future.
Supported texture formats are PNG (`.png`), JPEG (`.jpg`) and Targa (`.tga`).
Texture modifiers
-----------------
@ -1458,8 +1484,6 @@ Node drawtypes
There are a bunch of different looking node types.
Look for examples in `games/devtest` or `games/minetest_game`.
* `normal`
* A node-sized cube.
* `airlike`
@ -1498,7 +1522,7 @@ Look for examples in `games/devtest` or `games/minetest_game`.
* `allfaces`
* Often used for partially-transparent nodes.
* External sides of textures, and unlike other drawtypes, the external sides
of other blocks, are visible from the inside.
of other nodes, are visible from the inside.
* `allfaces_optional`
* Often used for leaves nodes.
* This switches between `normal`, `glasslike` and `allfaces` according to
@ -4187,14 +4211,14 @@ Two functions are provided to translate strings: `core.translate` and
* `core.get_translator(textdomain)` is a simple wrapper around
`core.translate` and `core.translate_n`.
After `local S, NS = core.get_translator(textdomain)`, we have
After `local S, PS = core.get_translator(textdomain)`, we have
`S(str, ...)` equivalent to `core.translate(textdomain, str, ...)`, and
`NS(str, str_plural, n, ...)` to `core.translate_n(textdomain, str, str_plural, n, ...)`.
`PS(str, str_plural, n, ...)` to `core.translate_n(textdomain, str, str_plural, n, ...)`.
It is intended to be used in the following way, so that it avoids verbose
repetitions of `core.translate`:
```lua
local S, NS = core.get_translator(textdomain)
local S, PS = core.get_translator(textdomain)
S(str, ...)
```
@ -4228,7 +4252,7 @@ command that shows the amount of time since the player joined. We can do the
following:
```lua
local S, NS = core.get_translator("hello")
local S, PS = core.get_translator("hello")
core.register_on_joinplayer(function(player)
local name = player:get_player_name()
core.chat_send_player(name, S("Hello @1, how are you today?", name))
@ -4237,7 +4261,7 @@ core.register_chatcommand("playtime", {
func = function(name)
local last_login = core.get_auth_handler().get_auth(name).last_login
local playtime = math.floor((last_login-os.time())/60)
return true, NS(
return true, PS(
"You have been playing for @1 minute.",
"You have been playing for @1 minutes.",
minutes, tostring(minutes))
@ -4284,7 +4308,7 @@ After creating the `locale` directory, a translation template for the above
example using the following command:
```sh
xgettext -L lua -kS -kNS:1,2 -kcore.translate:1c,2 -kcore.translate_n:1c,2,3 \
xgettext -L lua -kS -kPS:1,2 -kcore.translate:1c,2 -kcore.translate_n:1c,2,3 \
-d hello -o locale/hello.pot *.lua
```
@ -4344,7 +4368,7 @@ Hello @1, how are you today?=Hallo @1, wie geht es dir heute?
```
For old translation files, consider using the script `mod_translation_updater.py`
in the Luanti [modtools](https://github.com/minetest/modtools) repository to
in the Luanti [modtools](https://github.com/luanti-org/modtools) repository to
generate and update translation files automatically from the Lua sources.
Gettext translation file format
@ -5042,7 +5066,7 @@ inside the VoxelManip.
can use `core.emerge_area` to make sure that the area you want to
read/write is already generated.
* Other mods, or the core itself, could possibly modify the area of the map
* Other mods, or the engine itself, could possibly modify the area of the map
currently loaded into a VoxelManip object. With the exception of Mapgen
VoxelManips (see above section), the internal buffers are not updated. For
this reason, it is strongly encouraged to complete the usage of a particular
@ -5057,9 +5081,11 @@ inside the VoxelManip.
Methods
-------
* `read_from_map(p1, p2)`: Loads a chunk of map into the VoxelManip object
* `read_from_map(p1, p2)`: Loads a chunk of map into the VoxelManip object
containing the region formed by `p1` and `p2`.
* returns actual emerged `pmin`, actual emerged `pmax`
* Note that calling this multiple times will *add* to the area loaded in the
VoxelManip, and not reset it.
* `write_to_map([light])`: Writes the data loaded from the `VoxelManip` back to
the map.
* **important**: data must be set using `VoxelManip:set_data()` before
@ -5118,8 +5144,8 @@ Methods
generated mapchunk above are propagated down into the mapchunk, defaults
to `true` if left out.
* `update_liquids()`: Update liquid flow
* `was_modified()`: Returns `true` if the data in the voxel manipulator has been modified
since it was last read from the map. This means you have to call `get_data` again.
* `was_modified()`: Returns `true` if the data in the VoxelManip has been modified
since it was last read from the map. This means you have to call `get_data()` again.
This only applies to a `VoxelManip` object from `core.get_mapgen_object`,
where the engine will keep the map and the VM in sync automatically.
* Note: this doesn't do what you think it does and is subject to removal. Don't use it!
@ -5552,7 +5578,7 @@ Utilities
* It's possible that multiple Luanti instances are running at the same
time, which may lead to corruption if you are not careful.
* `core.is_singleplayer()`
* `core.features`: Table containing API feature flags
* `core.features`: Table containing *server-side* API feature flags
```lua
{
@ -5659,10 +5685,17 @@ Utilities
bulk_lbms = true,
-- ABM supports field without_neighbors (5.10.0)
abm_without_neighbors = true,
-- biomes have a weight parameter (5.11.0)
biome_weights = true,
-- Particles can specify a "clip" blend mode (5.11.0)
particle_blend_clip = true,
-- The `match_meta` optional parameter is available for `InvRef:remove_item()` (5.12.0)
remove_item_match_meta = true,
}
```
* `core.has_feature(arg)`: returns `boolean, missing_features`
* checks for *server-side* feature availability
* `arg`: string or table in format `{foo=true, bar=true}`
* `missing_features`: `{foo=true, bar=true}`
* `core.get_player_information(player_name)`: Table containing information
@ -5684,14 +5717,37 @@ Utilities
min_jitter = 0.01, -- minimum packet time jitter
max_jitter = 0.5, -- maximum packet time jitter
avg_jitter = 0.03, -- average packet time jitter
-- The version information is provided by the client and may be spoofed
-- or inconsistent in engine forks. You must not use this for checking
-- feature availability of clients. Instead, do use the fields
-- `protocol_version` and `formspec_version` where it matters.
-- Use `core.protocol_versions` to map Luanti versions to protocol versions.
-- This version string is only suitable for analysis purposes.
version_string = "0.4.9-git", -- full version string
-- the following information is available in a debug build only!!!
-- DO NOT USE IN MODS
--ser_vers = 26, -- serialization version used by client
--major = 0, -- major version number
--minor = 4, -- minor version number
--patch = 10, -- patch version number
--vers_string = "0.4.9-git", -- full version string
--state = "Active" -- current client state
--serialization_version = 26, -- serialization version used by client
--major = 0, -- major version number
--minor = 4, -- minor version number
--patch = 10, -- patch version number
--state = "Active" -- current client state
}
```
* `core.protocol_versions`:
* Table mapping Luanti versions to corresponding protocol versions for modder convenience.
* For example, to check whether a client has at least the feature set
of Luanti 5.8.0 or newer, you could do:
`core.get_player_information(player_name).protocol_version >= core.protocol_versions["5.8.0"]`
* (available since 5.11)
```lua
{
[version string] = protocol version at time of release
-- every major and minor version has an entry
-- patch versions only for the first release whose protocol version is not already present in the table
}
```
@ -6180,7 +6236,7 @@ Setting-related
* `core.settings`: Settings object containing all of the settings from the
main config file (`minetest.conf`). See [`Settings`].
* `core.setting_get_pos(name)`: Loads a setting from the main settings and
parses it as a position (in the format `(1,2,3)`). Returns a position or nil.
parses it as a position (in the format `(1,2,3)`). Returns a position or nil. **Deprecated: use `core.settings:get_pos()` instead**
Authentication
--------------
@ -6559,7 +6615,7 @@ Environment access
* `pointabilities`: Allows overriding the `pointable` property of
nodes and objects. Uses the same format as the `pointabilities` property
of item definitions. Default is `nil`.
* `core.find_path(pos1,pos2,searchdistance,max_jump,max_drop,algorithm)`
* `core.find_path(pos1, pos2, searchdistance, max_jump, max_drop, algorithm)`
* returns table containing path that can be walked on
* returns a table of 3D points representing a path from `pos1` to `pos2` or
`nil` on failure.
@ -6579,8 +6635,11 @@ Environment access
Difference between `"A*"` and `"A*_noprefetch"` is that
`"A*"` will pre-calculate the cost-data, the other will calculate it
on-the-fly
* `core.spawn_tree (pos, {treedef})`
* `core.spawn_tree(pos, treedef)`
* spawns L-system tree at given `pos` with definition in `treedef` table
* `core.spawn_tree_on_vmanip(vmanip, pos, treedef)`
* analogous to `core.spawn_tree`, but spawns a L-system tree onto the specified
VoxelManip object `vmanip` instead of the map.
* `core.transforming_liquid_add(pos)`
* add node to liquid flow update queue
* `core.get_node_max_level(pos)`
@ -6699,6 +6758,9 @@ Formspec
* `core.hypertext_escape(string)`: returns a string
* escapes the characters "\", "<", and ">" to show text in a hypertext element.
* not safe for use with tag attributes.
* this function does not do formspec escaping, you will likely need to do
`core.formspec_escape(core.hypertext_escape(string))` if the hypertext is
not already being formspec escaped.
* `core.explode_table_event(string)`: returns a table
* returns e.g. `{type="CHG", row=1, column=2}`
* `type` is one of:
@ -7394,7 +7456,8 @@ Misc.
* This function can be overridden by mods to change the leave message.
* `core.hash_node_position(pos)`: returns a 48-bit integer
* `pos`: table {x=number, y=number, z=number},
* Gives a unique hash number for a node position (16+16+16=48bit)
* Gives a unique numeric encoding for a node position (16+16+16=48bit)
* Despite the name, this is not a hash function (so it doesn't mix or produce collisions).
* `core.get_position_from_hash(hash)`: returns a position
* Inverse transform of `core.hash_node_position`
* `core.get_item_group(name, group)`: returns a rating
@ -7812,13 +7875,15 @@ An `InvRef` is a reference to an inventory.
can be fully added to the list
* `contains_item(listname, stack, [match_meta])`: returns `true` if
the stack of items can be fully taken from the list.
If `match_meta` is false, only the items' names are compared
(default: `false`).
* `remove_item(listname, stack)`: take as many items as specified from the
list, returns the items that were actually removed (as an `ItemStack`)
-- note that any item metadata is ignored, so attempting to remove a specific
unique item this way will likely remove the wrong one -- to do that use
`set_stack` with an empty `ItemStack`.
* If `match_meta` is `true`, item metadata is also considered when comparing
items. Otherwise, only the items names are compared. Default: `false`
* The method ignores wear.
* `remove_item(listname, stack, [match_meta])`: take as many items as specified from the
list, returns the items that were actually removed (as an `ItemStack`).
* If `match_meta` is `true` (available since feature `remove_item_match_meta`),
item metadata is also considered when comparing items. Otherwise, only the
items names are compared. Default: `false`
* The method ignores wear.
* `get_location()`: returns a location compatible to
`core.get_inventory(location)`.
* returns `{type="undefined"}` in case location is not known
@ -8246,7 +8311,13 @@ child will follow movement and rotation of that bone.
object.
* `set_detach()`: Detaches object. No-op if object was not attached.
* `set_bone_position([bone, position, rotation])`
* Shorthand for `set_bone_override(bone, {position = position, rotation = rotation:apply(math.rad)})` using absolute values.
* Sets absolute bone overrides, e.g. it is equivalent to
```lua
obj:set_bone_override(bone, {
position = {vec = position, absolute = true},
rotation = {vec = rotation:apply(math.rad), absolute = true}
})
```
* **Note:** Rotation is in degrees, not radians.
* **Deprecated:** Use `set_bone_override` instead.
* `get_bone_position(bone)`: returns the previously set position and rotation of the bone
@ -8256,15 +8327,18 @@ child will follow movement and rotation of that bone.
* `set_bone_override(bone, override)`
* `bone`: string
* `override`: `{ position = property, rotation = property, scale = property }` or `nil`
* `property`: `{ vec = vector, interpolation = 0, absolute = false}` or `nil`;
* `vec` is in the same coordinate system as the model, and in degrees for rotation
* `property = nil` is equivalent to no override on that property
* `absolute`: If set to `false`, the override will be relative to the animated property:
* Transposition in the case of `position`;
* Composition in the case of `rotation`;
* Multiplication in the case of `scale`
* `interpolation`: Old and new values are interpolated over this timeframe (in seconds)
* `override = nil` (including omission) is shorthand for `override = {}` which clears the override
* Each `property` is a table of the form
`{ vec = vector, interpolation = 0, absolute = false }` or `nil`
* `vec` is in the same coordinate system as the model, and in radians for rotation.
It defaults to `vector.zero()` for translation and rotation and `vector.new(1, 1, 1)` for scale.
* `interpolation`: The old and new overrides are interpolated over this timeframe (in seconds).
* `absolute`: If set to `false` (which is the default),
the override will be relative to the animated property:
* Translation in the case of `position`;
* Composition in the case of `rotation`;
* Per-axis multiplication in the case of `scale`
* `property = nil` is equivalent to no override on that property
* **Note:** Unlike `set_bone_position`, the rotation is in radians, not degrees.
* Compatibility note: Clients prior to 5.9.0 only support absolute position and rotation.
All values are treated as absolute and are set immediately (no interpolation).
@ -8758,6 +8832,14 @@ child will follow movement and rotation of that bone.
Same limits as for `thirdperson_back` apply.
Defaults to `thirdperson_back` if unspecified.
* `get_eye_offset()`: Returns camera offset vectors as set via `set_eye_offset`.
* `set_camera(params)`: Sets camera parameters.
* `mode`: Defines the camera mode used
- `any`: free choice between all modes (default)
- `first`: first-person camera
- `third`: third-person camera
- `third_front`: third-person camera, looking opposite of movement direction
* Supported by client since 5.12.0.
* `get_camera()`: Returns the camera parameters as a table as above.
* `send_mapblock(blockpos)`:
* Sends an already loaded mapblock to the player.
* Returns `false` if nothing was sent (note that this can also mean that
@ -8883,7 +8965,7 @@ For `core.get_perlin_map()`, the actual seed used is the noiseparams seed
plus the world seed, to create world-specific noise.
Format of `size` is `{x=dimx, y=dimy, z=dimz}`. The `z` component is omitted
for 2D noise, and it must be must be larger than 1 for 3D noise (otherwise
for 2D noise, and it must be larger than 1 for 3D noise (otherwise
`nil` is returned).
For each of the functions with an optional `buffer` parameter: If `buffer` is
@ -9039,6 +9121,9 @@ means that no defaults will be returned for mod settings.
* Is currently limited to mapgen flags `mg_flags` and mapgen-specific
flags like `mgv5_spflags`.
* Returns `nil` if `key` is not found.
* `get_pos(key)`:
* Returns a `vector`
* Returns `nil` if no value is found or parsing failed.
* `set(key, value)`
* Setting names can't contain whitespace or any of `="{}#`.
* Setting values can't contain the sequence `\n"""`.
@ -9049,6 +9134,9 @@ means that no defaults will be returned for mod settings.
* `set_np_group(key, value)`
* `value` is a NoiseParams table.
* Also, see documentation for `set()` above.
* `set_pos(key, value)`
* `value` is a `vector`.
* Also, see documentation for `set()` above.
* `remove(key)`: returns a boolean (`true` for success)
* `get_names()`: returns `{key1,...}`
* `has(key)`:
@ -9146,7 +9234,7 @@ Player properties need to be saved manually.
-- Clients older than 5.9.0 interpret `pointable = "blocking"` as `pointable = true`.
-- Can be overridden by the `pointabilities` of the held item.
visual = "cube" / "sprite" / "upright_sprite" / "mesh" / "wielditem" / "item",
visual = "",
-- "cube" is a node-sized cube.
-- "sprite" is a flat texture always facing the player.
-- "upright_sprite" is a vertical flat texture.
@ -9168,6 +9256,8 @@ Player properties need to be saved manually.
-- Wielditems are scaled a bit. If you want a wielditem to appear
-- to be as large as a node, use `0.667` in `visual_size`
-- "item" is similar to "wielditem" but ignores the 'wield_image' parameter.
-- "node" looks exactly like a node in-world (supported since 5.12.0)
-- Note that visual effects like waving or liquid reflections will not work.
visual_size = {x = 1, y = 1, z = 1},
-- Multipliers for the visual size. If `z` is not specified, `x` will be used
@ -9177,7 +9267,7 @@ Player properties need to be saved manually.
-- File name of mesh when using "mesh" visual
textures = {},
-- Number of required textures depends on visual.
-- Number of required textures depends on visual:
-- "cube" uses 6 textures just like a node, but all 6 must be defined.
-- "sprite" uses 1 texture.
-- "upright_sprite" uses 2 textures: {front, back}.
@ -9185,13 +9275,16 @@ Player properties need to be saved manually.
-- Deprecated usage of "wielditem" expects 'textures = {itemname}' (see 'visual' above).
colors = {},
-- Number of required colors depends on visual
-- Currently unused.
node = {name = "ignore", param1=0, param2=0},
-- Node to show when using the "node" visual
use_texture_alpha = false,
-- Use texture's alpha channel.
-- Excludes "upright_sprite" and "wielditem".
-- Use texture's alpha channel for transparency blending.
-- Note: currently causes visual issues when viewed through other
-- semi-transparent materials such as water.
-- Note: ignored for "item", "wielditem" and "node" visual.
spritediv = {x = 1, y = 1},
-- Used with spritesheet textures for animation and/or frame selection
@ -9208,7 +9301,7 @@ Player properties need to be saved manually.
-- If false, object is invisible and can't be pointed.
makes_footstep_sound = false,
-- If true, is able to make footstep sounds of nodes
-- If true, object is able to make footstep sounds of nodes
-- (see node sound definition for details).
automatic_rotate = 0,
@ -9231,6 +9324,7 @@ Player properties need to be saved manually.
backface_culling = true,
-- Set to false to disable backface_culling for model
-- Note: only used by "mesh" and "cube" visual
glow = 0,
-- Add this much extra lighting when calculating texture color.
@ -9266,6 +9360,7 @@ Player properties need to be saved manually.
shaded = true,
-- Setting this to 'false' disables diffuse lighting of entity
-- Note: ignored for "item", "wielditem" and "node" visual
show_on_minimap = false,
-- Defaults to true for players, false for other entities.
@ -10702,6 +10797,10 @@ performance and computing power the practical limit is much lower.
-- distribution of the biomes.
-- Heat and humidity have average values of 50, vary mostly between
-- 0 and 100 but can exceed these values.
weight = 1.0,
-- Relative weight of the biome in the Voronoi diagram.
-- A value of 0 (or less) is ignored and equivalent to 1.0.
}
```
@ -10775,10 +10874,9 @@ See [Decoration types]. Used by `core.register_decoration`.
flags = "liquid_surface, force_placement, all_floors, all_ceilings",
-- Flags for all decoration types.
-- "liquid_surface": Instead of placement on the highest solid surface
-- in a mapchunk column, placement is on the highest liquid surface.
-- Placement is disabled if solid nodes are found above the liquid
-- surface.
-- "liquid_surface": Find the highest liquid (not solid) surface under
-- open air. Search stops and fails on the first solid node.
-- Cannot be used with "all_floors" or "all_ceilings" below.
-- "force_placement": Nodes other than "air" and "ignore" are replaced
-- by the decoration.
-- "all_floors", "all_ceilings": Instead of placement on the highest
@ -11473,6 +11571,14 @@ texture = {
-- (default) blends transparent pixels with those they are drawn atop
-- according to the alpha channel of the source texture. useful for
-- e.g. material objects like rocks, dirt, smoke, or node chunks
-- note: there will be rendering bugs when particles interact with
-- translucent nodes. particles are also not transparency-sorted
-- relative to each other.
blend = "clip",
-- pixels are either fully opaque or fully transparent,
-- depending on whether alpha is greater than or less than 50%
-- (just like `use_texture_alpha = "clip"` for nodes).
-- you should prefer this if you don't need semi-transparency, as it's faster.
blend = "add",
-- adds the value of pixels to those underneath them, modulo the sources
-- alpha channel. useful for e.g. bright light effects like sparks or fire

View file

@ -1,3 +1,3 @@
Moved to lua_api.md
URL: https://github.com/minetest/minetest/blob/master/doc/lua_api.md
URL: https://github.com/luanti-org/luanti/blob/master/doc/lua_api.md

View file

@ -124,7 +124,7 @@ Colon delimited list of directories to search for mods.
Path to Luanti user data directory.
.SH BUGS
Please report all bugs at https://github.com/minetest/minetest/issues.
Please report all bugs at https://github.com/luanti-org/luanti/issues.
.SH AUTHOR
.PP
@ -134,4 +134,4 @@ This man page was originally written by
Juhani Numminen <juhaninumminen0@gmail.com>.
.SH WWW
http://www.minetest.net/
http://www.luanti.org/

View file

@ -1,7 +1,7 @@
/** @mainpage The Minetest engine internal documentation
/** @mainpage The Luanti engine internal documentation
Welcome to the Minetest engine Doxygen documentation site!\n
This page documents the internal structure of the Minetest engine's C++ code.\n
Welcome to the Luanti engine Doxygen documentation site!\n
This page documents the internal structure of the Luanti engine's C++ code.\n
Use the tree view at the left to navigate.
*/

View file

@ -1,4 +1,4 @@
Luanti Lua Mainmenu API Reference 5.10.0
Luanti Lua Mainmenu API Reference 5.12.0
========================================
Introduction
@ -105,11 +105,6 @@ of manually putting one, as different OSs use different delimiters. E.g.
* `spec` = `SimpleSoundSpec` (see `lua_api.md`)
* `looped` = bool
* `handle:stop()` or `core.sound_stop(handle)`
* `core.get_video_drivers()`
* get list of video drivers supported by engine (not all modes are guaranteed to work)
* returns list of available video drivers' settings name and 'friendly' display name
e.g. `{ {name="opengl", friendly_name="OpenGL"}, {name="software", friendly_name="Software Renderer"} }`
* first element of returned list is guaranteed to be the NULL driver
* `core.get_mapgen_names([include_hidden=false])` -> table of map generator algorithms
registered in the core (possible in async calls)
* `core.get_cache_path()` -> path of cache
@ -223,6 +218,7 @@ GUI
* `core.set_clouds(<true/false>)`
* `core.set_topleft_text(text)`
* `core.show_keys_menu()`
* `core.show_touchscreen_layout()`
* `core.show_path_select_dialog(formname, caption, is_file_select)`
* shows a path select dialog
* `formname` is base name of dialog response returned in fields
@ -386,7 +382,7 @@ Settings
* `core.settings:save()` -> nil, save all settings to config file
For a complete list of methods of the `Settings` object see
[lua_api.md](https://github.com/minetest/minetest/blob/master/doc/lua_api.md)
[lua_api.md](./lua_api.md)
Worlds

View file

@ -281,15 +281,27 @@ storing coordinates separately), but the format has been kept unchanged for
that part.
## `map.sqlite`
`map.sqlite` is a `SQLite3` database, containing a single table, called
`map.sqlite` is an `SQLite3` database, containing a single table, called
`blocks`. It looks like this:
```sql
CREATE TABLE `blocks` (
`x` INTEGER, `y` INTEGER, `z` INTEGER,
`data` BLOB NOT NULL,
PRIMARY KEY (`x`, `z`, `y`)
);
```
Before 5.12.0 it looked like this:
```sql
CREATE TABLE `blocks` (`pos` INT NOT NULL PRIMARY KEY, `data` BLOB);
```
## Position Hashing
Applies to the pre-5.12.0 schema:
`pos` (a node position hash) is created from the three coordinates of a
`MapBlock` using this algorithm, defined here in Python:
@ -335,8 +347,8 @@ See below for description.
> * NOTE: Byte order is MSB first (big-endian).
> * NOTE: Zlib data is in such a format that Python's `zlib` at least can
> directly decompress.
> * NOTE: Since version 29 zstd is used instead of zlib. In addition, the entire
> block is first serialized and then compressed (except the version byte).
> * NOTE: Since version 29 zstd is used instead of zlib. In addition, the
> **entire block** is first serialized and then compressed (except version byte).
`u8` version
* map format version number, see serialization.h for the latest number

View file

@ -0,0 +1,7 @@
Luanti is a voxel-based game platform with multiplayer capabilities.
The objective of the available games varies, from sandbox games where you can explore, dig and build in a very large voxel world, to arcade-style games.
There is a wide range of built-in map generators for procedurally generated terrain, and voxel-based lighting that adapts to the environment and light sources.
All games and mods are written in Lua with a scripting API that is easy to use and makes it easy for modders to get started.

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

View file

@ -0,0 +1 @@
Voxel-based multiplayer game platform

View file

@ -0,0 +1 @@
Luanti

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