aboutsummaryrefslogtreecommitdiff
path: root/builtin/common
AgeCommit message (Collapse)Author
2023-01-10Error when string.split is given empty separator (#13132)Jude Melton-Houghton
2023-01-09Always set globals in __newindex (#13131)Jude Melton-Houghton
2022-11-29Fix /help privs checks (#13008)Jude Melton-Houghton
2022-11-24Deprecate special handling of `${key}` syntax in metadata values (#12970)Jude Melton-Houghton
2022-11-09Fix typos and en_US/en_GB inconsistency in various files (#12902)Abdou-31
2022-10-18Implement vector and node conversion in Lua (#12609)Jude Melton-Houghton
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-18Content ID caching in Lua (#12444)Jude Melton-Houghton
* Cache content IDs in Lua Co-authored-by: sfan5 <sfan5@live.de>
2022-09-12Mainmenu: Properly sort mods and games (#12758)SmallJoker
This also removes trivial and unused pkgmgr functions Fixes a bug caused by sorting in 2133fc8
2022-09-11Serialize: Restore forward compatibilityLars Mueller
2022-09-11Serialize: Use numbers for refs to work around LuaJIT limitsLars Mueller
2022-07-23Let core.get_mod_storage be called multiple times (#12572)Jude Melton-Houghton
2022-07-14Deserialization: Restore backwards compat (#12519)Lars Müller
2022-07-02Serialization spec: Fix number fuzzing (#12496)Lars Müller
2022-07-02Optimize strict.lua (#12495)Lars Müller
Co-authored-by: sfan5 <sfan5@live.de>
2022-06-11Builtin: Redo serialize.lua (#11427)Lars Müller
Features: * Support for arbitrary references, including self-referencing * Short output, references "long" strings as a bonus * Around the same speed, potentially slower if long, short keys are present * Properly works with NaN and inf
2022-06-06core.formspec_escape: Restore backwards compatLars Müller
Support numbers as arguments by using `string.gsub(text, ...)` instead of `text:gsub(...)` which will coerce `text` to a string
2022-05-27Builtin: Optimize misc helpers (#12377)Lars Müller
Also add formspec_escape unit test
2022-05-22Add relative numbers for commands by prepending ~ (#9588)Wuzzy
* 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-08Remove unused variable WARN_INITZughy
2022-05-04Add vector.combine (#11920)Lars Müller
2022-03-29Store vector metatable in registryJude Melton-Houghton
2022-01-19Free arguments of cancelled minetest.after() jobssfan5
2022-01-02Fix vector.from_string returning a table without vector metatableDesour
2021-12-01Improve error message if using "/help --" (#11796)Wuzzy
2021-10-07Move archive extraction in content store to async jobsfan5
2021-10-01Add an option `-t` to force text output in /helpPedro Gimeno
This also improves detection of whether formspecs are available.
2021-09-10Split vector.new into 3 constructorsDS
2021-08-27Optimize vector length calculations (#11549)Lean Rada
2021-06-04Add metatables to lua vectors (#11039)DS
Add backwards-compatible metatable functions for vectors.
2021-04-05Add vector.to_string and vector.from_string (#10323)DS
Writing vectors as strings is very common and should belong to `vector.*`. `minetest.pos_to_string` is also too long to write, implies that one should only use it for positions and leaves no spaces after the commas.
2021-04-02Add `math.round` and fix `vector.round` (#10803)Vincent Robinson
2021-03-05Translate builtin (#10693)Wuzzy
This PR is the second attempt to translate builtin. Server-sent translation files can be added to `builtin/locale/`, whereas client-side translations depend on gettext.
2021-02-11Replace 'minetest.' with 'core.' in builtinrubenwardy
2020-12-24Fix minetest.is_nanLars Mueller
2020-09-23Ability to remove minetest.after once set (#10103)tenplus1
2020-08-29Add vector.offset (#10321)DS
2020-06-09Some vector functions useful for working with rotations (#9572)NetherEran
* added vector.rotate * added vector.forward_from_rotation and vector.up_from_rotation * added vector.forward_up_to_rotatiton * fixed some bugs and formatting with vector functions * shortened name of some new vector functions and added documentation * made vector.rotate not require a unit vector as axis * fixed crash with vector.forward_up_to_rot * renamed new vector functions, made vector.rotate apply a rotation matrix, old vector.rotate is now called vector.rotate_around_axis * documented vector function changes * removed some whitespace to appease luacheck * implemented and fixed optimization of vector.rotate_around_axis by SmallJoker * added some unit tests for rotation vector functions * clarified that rotation vectors are in radians and according to the left hand rule * hopefully appeased luacheck * renamed rotation_to_horizontal to forward_at_rotation, rotation_to_vertical to up_at_rotation * handled cases where sin or cos are 0 in rotation vector functions * added more comments * clarified documentation of rotation vector functions * added more unit tests * changed way in which vector.rotate_around_axis is adjusted for left handed coordinate systems * made vector.rotate_around_axis actually left handed * unrolled matrix multiplication * removed vector.forward_at_rotation and vector.up_at_rotation * prettified vector.rotate_around_axis, made previous commits not break anything * removed references to removed vector.forward_at_rotation and vector.up_at_rotation * removed documentation of removed vector functions * clarified documentation and fixed styling of rotation vector functions * restyled comments minorly * spelling fixes and some hopefully better comments * allowed 'up' to be missing from vector.directions_to_rotation and removed requirement for unit vectors as arguments * made vector.rotate_around_axis() right handed again for consistency * documented previous changes * made matrix multiplication actually multiply * renamed vector.directions_to_rotation() to vector.dir_to_rotation() * optimized a distance comparison * Fixed potential false positive in unit tests. Co-authored-by: NetherEran <nethereran@hotmail.com>
2020-06-09LuaItemStack: Add __tostring metamethod (#8785)Paul Ouellette
* LuaItemStack: Add __tostring metamethod * Clean up LuaItemStack::checkobject
2020-05-29Add minetest.is_creative_enabledWuzzy
2020-05-17builtin: Move common/async_event.lua to mainmenu/async_event.luasfan5
It only works in the context of the mainmenu.
2020-05-13Allow placing auto-rotating nodes on other nodes in on_rightclick (#9859)Yaman Qalieh
2020-04-22minetest.serialize: Reversible number serialization (#9722)HybridDog
* minetest.serialize: Reversible number to string conversion The %a format is not supported in Lua 5.1. This commit also adds two tests for number serialization.
2020-03-14Fix some chatcommands not returning a value (#9503)Wuzzy
2020-03-06Cleanup global namespace pollution in builtin (#9451)Wuzzy
2020-03-05Fix potential security issue(s), documentation on minetest.deserialize() (#9369)sfan5
Also adds an unittest
2020-02-01Add table.shuffle (#8299)HybridDog
2020-01-18Add Lua unit tests to builtin using busted (#9184)rubenwardy
2020-01-04Add table.key_value_swap (#9248)HybridDog
2019-10-13Fix rotate_node to return the correct itemstack.Aaron Suen
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-09-19Also print help commands to chat for server terminal (#8869)Tim Myers