Commit Graph

92 Commits

Author SHA1 Message Date
frogTheSecond e82495d98c
Allow image formats other than PNG for game backgrounds in the main menu (#16395) 2025-11-06 11:42:26 +01:00
sfan5 d932f34693
Add core.strip_escapes() (#16485) 2025-09-14 23:01:43 +02:00
sfan5 7c88996210 Use vector type in core.parse_coordinates() 2025-08-14 12:33:35 +02:00
sfan5 21a76d8c88 Call string.rep directly in dump()
fixes #16373 (as a side effect)
2025-08-14 12:33:35 +02:00
y5nw 57c1ab905c
Migrate existing keycode-based keybindings (#16049)
Co-authored-by: grorp <gregor.parzefall@posteo.de>
Co-authored-by: sfan5 <sfan5@live.de>
2025-05-14 22:15:15 +02:00
Lars Mueller 34e73da424 Optimize appending to tables in `core.serialize` and `dump` 2025-05-04 16:32:17 +02:00
Lars Mueller 9ad23e4384 Revamp `dump` 2025-05-04 16:32:17 +02:00
Lars Mueller 98b2edeb11 dump[2]: avoid misleading rounding of numbers 2025-05-04 16:32:17 +02:00
Lars Müller dd2e45ee82
Deprecate function support in `core.[de]serialize` 2025-04-23 21:39:27 +02:00
Lars Müller 077828d0d9
Add `table.copy_with_metatables` (#15754) 2025-03-14 11:52:42 +01:00
Wuzzy ad4b13a0e9
Luanti rename: builtin (#15324) 2024-10-28 19:40:18 +01:00
y5nw e3aa79cffb
Gettext and plural support for client-side translations (#14726)
---------

Co-authored-by: Ekdohibs <nathanael.courant@laposte.net>
Co-authored-by: y5nw <y5nw@protonmail.com>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2024-10-13 11:29:08 +02:00
rubenwardy 78aab8c95d ContentDB redesign: Add package dialog
Co-authored-by: Gregor Parzefall <gregor.parzefall@posteo.de>
2024-10-05 18:40:26 +01:00
kromka-chleba a6ba5304c4
Add new vector utils (ceil, sign, abs, random_in_area) (#14807) 2024-08-31 11:43:52 +02:00
Zemtzov7 b2f6a65bc9
Sort clients in `minetest.get_server_status` and privs in `minetest.privs_to_string` (#15023) 2024-08-21 20:25:41 +02:00
1F616EMO~nya dc7a7a0ed9
Add `table.keyof()` (#14910) 2024-08-13 18:39:50 +02:00
kromka-chleba 28857841aa
Fix math.round floating point bug (#14757) 2024-06-24 20:57:06 +01:00
sfan5 4e1679d2a2
Keep empty servers at bottom of list (#14511) 2024-04-05 13:00:34 +02:00
Jude Melton-Houghton ab1fe80150
Error when string.split is given empty separator (#13132) 2023-01-10 09:25:48 -05:00
Jude Melton-Houghton 8817af07fb
Deprecate special handling of `${key}` syntax in metadata values (#12970) 2022-11-24 17:56:43 -05:00
SmallJoker bc3dccca5c
Mainmenu: Properly sort mods and games (#12758)
This also removes trivial and unused pkgmgr functions
Fixes a bug caused by sorting in 2133fc8
2022-09-12 19:24:54 +02:00
Lars Müller edc7df5480
core.formspec_escape: Restore backwards compat
Support numbers as arguments by using `string.gsub(text, ...)` instead of `text:gsub(...)` which will coerce `text` to a string
2022-06-06 18:32:28 +02:00
Lars Müller e8b2954586
Builtin: Optimize misc helpers (#12377)
Also add formspec_escape unit test
2022-05-27 21:40:38 +02:00
Wuzzy ac5e8176b9
Add relative numbers for commands by prepending ~ (#9588)
* Add relative numbers for commands by prepending ~

* Some builtin code cleanup

* Disallow nan and inf in minetest.string_to_area

* Remove unused local variable teleportee (makes Luacheck happy)

* Clean up core.string_to_pos

* Make area parsing less permissive

* Rewrite tests as busted tests

* /time: Fix negative minutes not working

Co-authored-by: Lars Mueller <appgurulars@gmx.de>
2022-05-22 10:28:24 -04:00
sfan5 2b5075f0e2 Move archive extraction in content store to async job 2021-10-07 00:20:01 +02:00
Lean Rada d36dca3aba
Optimize vector length calculations (#11549) 2021-08-27 20:22:35 +02:00
DS 8f085e02a1
Add metatables to lua vectors (#11039)
Add backwards-compatible metatable functions for vectors.
2021-06-04 21:22:33 +02:00
Vincent Robinson 3560691c0a
Add `math.round` and fix `vector.round` (#10803) 2021-04-02 00:18:58 +02:00
Lars Mueller 8f72d4b294 Fix minetest.is_nan 2020-12-24 22:07:04 +01:00
Paul Ouellette b16f841756
LuaItemStack: Add __tostring metamethod (#8785)
* LuaItemStack: Add __tostring metamethod

* Clean up LuaItemStack::checkobject
2020-06-09 19:37:25 +02:00
Wuzzy 65a6a316d0 Add minetest.is_creative_enabled 2020-05-29 22:45:40 +02:00
Yaman Qalieh 6c607e2082
Allow placing auto-rotating nodes on other nodes in on_rightclick (#9859) 2020-05-13 13:57:05 +02:00
Wuzzy ce8cdc0333
Cleanup global namespace pollution in builtin (#9451) 2020-03-06 20:19:14 +00:00
HybridDog ea5e231959
Add table.shuffle (#8299) 2020-02-01 16:09:45 +01:00
rubenwardy 1173ff0c13
Add Lua unit tests to builtin using busted (#9184) 2020-01-18 02:09:18 +00:00
HybridDog f9c7e46a34 Add table.key_value_swap (#9248) 2020-01-04 15:44:48 +01:00
Aaron Suen 0df646e068 Fix rotate_node to return the correct itemstack.
All on_* hooks that return an itemstack are NOT guaranteed to
modify and return the original stack.  We cannot count on the
behavior of the existing builtin definitions not to be overridden
by game/mod logic.
2019-10-13 17:11:00 +02:00
rubenwardy 8e757859d6
Add luacheck to check builtin (#7895) 2019-08-06 19:30:18 +01:00
HybridDog a7c5dc50e5 Add math.factorial (#8298) 2019-03-05 10:11:21 +01:00
Pierre-Yves Rollo 0e306c0842 Fix string.split returning an empty table if string starts with sepearator (#7827)
Calling string.split(":A:B:C:D", ":") returns an empty array.
This is due to first empty string not making repeat loop decreasing max_split which has a 0 value when reaching until.
Changing max_splits default value from -1 to -2 fixes that issue.
2018-11-01 21:07:01 +01:00
Paramat 4a2a11262b
Builtin//misc_helpers: Various fixes (#7737)
Remove unused variable 'seplen'.
Fix 'cparam2'->'param2'.
Do not initialise variable 'p' twice.
2018-09-23 21:06:51 +01:00
Paramat 45e48295d2
Pointed_thing_to_face_pos: Avoid crash when player is inside a node (#7342)
Avoid crash in some situations when player is inside a node, causing
'above' to equal 'under'.
In this situation return 'under' which is the node position very close
to the face position that would normally be returned.
2018-05-16 20:49:46 +01:00
rubenwardy 87ad4d8e7f
Add online content repository
Replaces mods and texture pack tabs with a single content tab
2018-04-19 20:14:53 +01:00
SmallJoker 8f827ee680
core.rotate_node: Do not trigger after_place_node (#6900) 2018-03-29 21:44:13 +02:00
you a6bb2c4ea8 Allow dumping userdata (#7012) 2018-02-08 19:17:06 +01:00
Ezhh 649eef9e4f Give subgames the ability to disallow specific mapgens (#6792) 2017-12-16 17:02:08 +01:00
Paramat da298a26ff Pointed thing to face pos: Use 'eye height' object property (#6754) 2017-12-09 14:30:26 +01:00
SmallJoker f7733f41ea
core.rotate_node: Run callbacks like with any regular placed node (#6648) 2017-11-21 20:21:52 +01:00
DTA7 5a3b8e34b3 Set placer to nil instead of a non-functional one in item_OnPlace (#6449)
* Set placer to nil instead of a non-functional one

This requires nil checks in core.rotate_node and core.rotate_and_place.
2017-09-21 21:52:52 +02:00
tenplus1 5b6d4482ee Fix Rotate Node Placement (#6424)
This properly checks for creative mode or privilege when using fixed rotate_node() function.
2017-09-16 22:39:38 +02:00