aboutsummaryrefslogtreecommitdiff
path: root/builtin/common
Commit message (Collapse)AuthorAge
* Add metatables to lua vectors (#11039)DS2021-06-04
| | | Add backwards-compatible metatable functions for vectors.
* Add vector.to_string and vector.from_string (#10323)DS2021-04-05
| | | 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-02
|
* Translate builtin (#10693)Wuzzy2021-03-05
| | | | | 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-11
|
* Fix minetest.is_nanLars Mueller2020-12-24
|
* Ability to remove minetest.after once set (#10103)tenplus12020-09-23
|
* Add vector.offset (#10321)DS2020-08-29
|
* Some vector functions useful for working with rotations (#9572)NetherEran2020-06-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-09
| | | | | * LuaItemStack: Add __tostring metamethod * Clean up LuaItemStack::checkobject
* Add minetest.is_creative_enabledWuzzy2020-05-29
|
* builtin: Move common/async_event.lua to mainmenu/async_event.luasfan52020-05-17
| | | | It only works in the context of the mainmenu.
* Allow placing auto-rotating nodes on other nodes in on_rightclick (#9859)Yaman Qalieh2020-05-13
|
* minetest.serialize: Reversible number serialization (#9722)HybridDog2020-04-22
| | | | | | | * 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-14
|
* Cleanup global namespace pollution in builtin (#9451)Wuzzy2020-03-06
|
* Fix potential security issue(s), documentation on minetest.deserialize() (#9369)sfan52020-03-05
| | | Also adds an unittest
* Add table.shuffle (#8299)HybridDog2020-02-01
|
* Add Lua unit tests to builtin using busted (#9184)rubenwardy2020-01-18
|
* Add table.key_value_swap (#9248)HybridDog2020-01-04
|
* Fix rotate_node to return the correct itemstack.Aaron Suen2019-10-13
| | | | | | | 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-19
|
* Add luacheck to check builtin (#7895)rubenwardy2019-08-06
|
* Builtin: Forward old return valuesSmallJoker2019-08-02
| | | | Was forgotten in 69bf964.
* Add /help formspec for commands and privileges (#8385)SmallJoker2019-07-20
| | | | | * Trigger for 'all' as well * Add description textarea, double-click to copy
* Use vector.dot and vector.cross in vector.angleHybridDog2019-07-16
|
* Add vector.dot and vector.crossHybridDog2019-07-16
| | | | Mostly copied from MarkuBu's code
* Optimize core.after in a simple way (#8351)DS2019-03-27
|
* core.after: Improve assertion message (#8388)ANAND2019-03-17
|
* Builtin: Add vector.angle(). Returns the angle between 2 vectors (#7738)ANAND2019-03-17
|
* Add math.factorial (#8298)HybridDog2019-03-05
|
* Fix string.split returning an empty table if string starts with sepearator ↵Pierre-Yves Rollo2018-11-01
| | | | | | | (#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.
* Builtin//misc_helpers: Various fixes (#7737)Paramat2018-09-23
| | | | | Remove unused variable 'seplen'. Fix 'cparam2'->'param2'. Do not initialise variable 'p' twice.
* Pointed_thing_to_face_pos: Avoid crash when player is inside a node (#7342)Paramat2018-05-16
| | | | | | 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.
* Add online content repositoryrubenwardy2018-04-19
| | | | Replaces mods and texture pack tabs with a single content tab
* core.rotate_node: Do not trigger after_place_node (#6900)SmallJoker2018-03-29
|
* Allow dumping userdata (#7012)you2018-02-08
|
* Vector functions: Fix vector.direction() function, improve documentation (#6801)Paramat2017-12-21
| | | vector.direction() now returns a normalised vector with direction p1 to p2.
* Give subgames the ability to disallow specific mapgens (#6792)Ezhh2017-12-16
|
* Pointed thing to face pos: Use 'eye height' object property (#6754)Paramat2017-12-09
|
* core.rotate_node: Run callbacks like with any regular placed node (#6648)SmallJoker2017-11-21
|
* Set placer to nil instead of a non-functional one in item_OnPlace (#6449)DTA72017-09-21
| | | | | | * Set placer to nil instead of a non-functional one This requires nil checks in core.rotate_node and core.rotate_and_place.
* Fix Rotate Node Placement (#6424)tenplus12017-09-16
| | | This properly checks for creative mode or privilege when using fixed rotate_node() function.
* Fix core.wrap_text and make its behaviour consistent with the docssfan52017-09-12
| | | | Code based on initial implementation by @dsohler.
* Add '@n' escape sequences and some documentation on translated strings.Nathanaël Courant2017-08-26
|
* Add clientside translations.Ekdohibs2017-08-24
|
* Add minetest.rgba function that returns ColorString from RGBA or RGB valuesGael-de-Sailly2017-06-22
|
* Improve chatcommand params consistency (#5985)Ezhh2017-06-15
| | | | | | * Fix and improve params consistency * Move parenthesis requirement to descriptions
* Fix sending color codes to clients that don't support them. (#5950)red-0012017-06-09
| | | Also remove `disable_escape_sequences` since it's not needed anymore.
* [CSM] Add function to get player privileges (#5933)red-0012017-06-07
| | | | | | * [CSM] Add function to get player privileges + move related help functions to common * Added @Zeno- const