aboutsummaryrefslogtreecommitdiff
path: root/builtin/common (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Let core.get_mod_storage be called multiple times (#12572)Jude Melton-Houghton2022-07-231-0/+19
|
* Deserialization: Restore backwards compat (#12519)Lars Müller2022-07-141-0/+10
|
* Serialization spec: Fix number fuzzing (#12496)Lars Müller2022-07-021-2/+4
|
* Optimize strict.lua (#12495)Lars Müller2022-07-021-13/+13
| | | Co-authored-by: sfan5 <sfan5@live.de>
* Builtin: Redo serialize.lua (#11427)Lars Müller2022-06-112-189/+315
| | | | | | | | | 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
* core.formspec_escape: Restore backwards compatLars Müller2022-06-061-1/+1
| | | Support numbers as arguments by using `string.gsub(text, ...)` instead of `text:gsub(...)` which will coerce `text` to a string
* Builtin: Optimize misc helpers (#12377)Lars Müller2022-05-273-20/+31
| | | Also add formspec_escape unit test
* Add relative numbers for commands by prepending ~ (#9588)Wuzzy2022-05-222-29/+183
| | | | | | | | | | | | | | | | | | | * 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>
* Remove unused variable WARN_INITZughy2022-05-081-11/+0
|
* Add vector.combine (#11920)Lars Müller2022-05-042-0/+16
|
* Store vector metatable in registryJude Melton-Houghton2022-03-294-5/+5
|
* Free arguments of cancelled minetest.after() jobssfan52022-01-191-1/+8
|
* Fix vector.from_string returning a table without vector metatableDesour2022-01-022-1/+2
|
* Improve error message if using "/help --" (#11796)Wuzzy2021-12-011-4/+6
|
* Move archive extraction in content store to async jobsfan52021-10-071-1/+1
|
* Add an option `-t` to force text output in /helpPedro Gimeno2021-10-012-44/+75
| | | | This also improves detection of whether formspecs are available.
* Split vector.new into 3 constructorsDS2021-09-102-23/+50
|
* Optimize vector length calculations (#11549)Lean Rada2021-08-272-10/+3
|
* Add metatables to lua vectors (#11039)DS2021-06-045-86/+420
| | | Add backwards-compatible metatable functions for vectors.
* Add vector.to_string and vector.from_string (#10323)DS2021-04-052-0/+35
| | | 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.
* Add `math.round` and fix `vector.round` (#10803)Vincent Robinson2021-04-022-3/+12
|
* Translate builtin (#10693)Wuzzy2021-03-052-40/+57
| | | | | 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.
* Replace 'minetest.' with 'core.' in builtinrubenwardy2021-02-111-1/+1
|
* Fix minetest.is_nanLars Mueller2020-12-241-0/+4
|
* Ability to remove minetest.after once set (#10103)tenplus12020-09-231-2/+4
|
* Add vector.offset (#10321)DS2020-08-292-0/+10
|
* Some vector functions useful for working with rotations (#9572)NetherEran2020-06-092-0/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* LuaItemStack: Add __tostring metamethod (#8785)Paul Ouellette2020-06-091-0/+2
| | | | | * LuaItemStack: Add __tostring metamethod * Clean up LuaItemStack::checkobject
* Add minetest.is_creative_enabledWuzzy2020-05-291-8/+2
|
* builtin: Move common/async_event.lua to mainmenu/async_event.luasfan52020-05-171-40/+0
| | | | It only works in the context of the mainmenu.
* Allow placing auto-rotating nodes on other nodes in on_rightclick (#9859)Yaman Qalieh2020-05-131-1/+2
|
* minetest.serialize: Reversible number serialization (#9722)HybridDog2020-04-222-9/+14
| | | | | | | * 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.
* Fix some chatcommands not returning a value (#9503)Wuzzy2020-03-141-2/+2
|
* Cleanup global namespace pollution in builtin (#9451)Wuzzy2020-03-061-71/+1
|
* Fix potential security issue(s), documentation on minetest.deserialize() (#9369)sfan52020-03-052-8/+30
| | | Also adds an unittest
* Add table.shuffle (#8299)HybridDog2020-02-011-0/+14
|
* Add Lua unit tests to builtin using busted (#9184)rubenwardy2020-01-185-25/+147
|
* Add table.key_value_swap (#9248)HybridDog2020-01-041-0/+9
|
* Fix rotate_node to return the correct itemstack.Aaron Suen2019-10-131-2/+1
| | | | | | | 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.
* Also print help commands to chat for server terminal (#8869)Tim Myers2019-09-192-3/+18
|
* Add luacheck to check builtin (#7895)rubenwardy2019-08-064-14/+12
|
* Builtin: Forward old return valuesSmallJoker2019-08-021-1/+1
| | | | Was forgotten in 69bf964.
* Add /help formspec for commands and privileges (#8385)SmallJoker2019-07-202-7/+145
| | | | | * Trigger for 'all' as well * Add description textarea, double-click to copy
* Use vector.dot and vector.cross in vector.angleHybridDog2019-07-161-5/+3
|
* Add vector.dot and vector.crossHybridDog2019-07-161-0/+12
| | | | Mostly copied from MarkuBu's code
* Optimize core.after in a simple way (#8351)DS2019-03-271-5/+13
|
* core.after: Improve assertion message (#8388)ANAND2019-03-171-1/+1
|
* Builtin: Add vector.angle(). Returns the angle between 2 vectors (#7738)ANAND2019-03-171-0/+9
|
* Add math.factorial (#8298)HybridDog2019-03-051-0/+14
|
* Fix string.split returning an empty table if string starts with sepearator ↵Pierre-Yves Rollo2018-11-011-1/+1
| | | | | | | (#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.