Commit Graph

977 Commits

Author SHA1 Message Date
sfan5 a01a02f7a1 Preserve immortal group for players when damage is disabled 2021-01-31 20:38:12 +01:00
rubenwardy 6e0e0324a4
Fix minetest.dig_node returning true when node isn't diggable (#10890) 2021-01-31 18:49:51 +00:00
sfan5 83229921e5 Rework use_texture_alpha to provide three opaque/clip/blend modes
The change that turns nodeboxes and meshes opaque when possible is kept,
as is the compatibility code that warns modders to adjust their nodedefs.
2021-01-29 17:34:41 +01:00
Graham Northup e6e5910cb4
Clarify key_value_swap's edge case (#10799)
In compiler design especially, leaving behavior as "undefined" is a _strong_ condition that basically states that all possible integrity is violated; it's the kind of thing that happens when, say, dereferencing a pointer with unknown provenance, and most typically leads to a crash, but can result in all sorts of spectacular errors--thus, "it is undefined" how your program will melt down.

The pure-Lua implementation of `key_value_swap` does not permit UB _per se_ (assuming the implementation of Lua itself is sound), but does deterministically choose the value to which a key is mapped (the last in visitation order wins--since visitation order is arbitrary, _some_ value _will_ be chosen). Most importantly, the program won't do something wildly unexpected.
2021-01-29 17:34:00 +01:00
Zughy 44a9510c81
Consistently use "health points" (#10868) 2021-01-27 18:42:02 +00:00
Vincent Robinson 009e39e73b
FormSpec: Add list spacing, slot size, and noclip (#10083)
* Add list spacing, slot size, and noclip

* Simplify StyleSpec

* Add test cases

Co-authored-by: rubenwardy <rw@rubenwardy.com>
2021-01-23 12:46:19 -08:00
Zughy ea5d6312c1
ObjectRef: fix some v3f checks (#10602) 2021-01-21 18:37:38 +01:00
Zughy 1946835ee8
Document how to make nametags background disappear on players' head (#10783)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2021-01-11 18:03:46 +01:00
JDiaz 08ee9794fb
Implement on_rightclickplayer callback (#10775)
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2021-01-11 18:03:31 +01:00
hecks dd5a732fa9
Add on_deactivate callback for luaentities (#10723) 2021-01-02 15:14:29 +01:00
OgelGames ad58fb2206
Clarify documentation of minetest.get_modpath and minetest.get_modnames (#10771) 2021-01-02 15:13:53 +01:00
Elias Fleckenstein 9250b5205a
Add minetest.get_objects_in_area (#10668) 2020-12-29 16:50:09 +01:00
DS 6f8a1c99d5
Documentation for highest formspec_version[] and changelog (#10592) 2020-12-18 19:38:07 +01:00
Thomas--S d0a38f694d
Formspec: Allow to specify frame loop for model[] (#10679)
Add the ability to specify an animation frame loop range for the model[] formspec element.
2020-12-15 19:06:36 +01:00
wsor4035 3ed940ff13
lua_api.txt: Add mod_orgin to node def (#10697) 2020-12-15 19:05:55 +01:00
SmallJoker af073438fd
Various documentation fixes (#10692)
set_sky: New feature, keep note about the old syntax
get_us_time: Document overflow
localplayer: Document "nil" behaviour before initialization
collision_box: Safe limit of "1.45"
2020-12-10 20:59:24 +01:00
Oblomov 08c9d1a669
Cross-reference the node level manipulation functions (#10633)
This can help developers find the correct functions to access and manipulate the fluid level.
2020-12-04 20:16:53 +01:00
Pierre-Yves Rollo 78273027bf Add sound to press event of some formspecs elements (#10402) 2020-11-23 21:28:25 +01:00
DS be3fe161fc
Do not set a default for description in itemdef table (#10559)
* Do not set a default for description in itemdef table

* improve documentation
2020-11-10 21:03:10 +01:00
rubenwardy 7589cbe086
Fix object interaction distance not being checked (#10547) 2020-11-09 11:55:15 +01:00
SmallJoker 3356da0151
Add model[] formspec element (#10320)
Formspec element to display models, written by @kilbith, rebased and tweaked.

Co-authored-by: Jean-Patrick Guerrero <jeanpatrick.guerrero@gmail.com>
Co-authored-by: sfan5 <sfan5@live.de>
2020-11-04 21:46:18 +01:00
Zughy 33b2c5f5b1
Clean up l_object.cpp (#10512)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2020-10-22 16:18:01 +01:00
sfan5 660115c1ab
Decouple entity minimap markers from nametags replacing with show_on_minimap property (#10443) 2020-10-19 20:38:15 +02:00
Lars ed22260822 Remove all bump mapping and parallax occlusion related code. 2020-10-17 13:09:16 -07:00
Zughy 2341a4aff1
Add ObjectRef:get_children() (#10480)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2020-10-13 20:27:52 +01:00
DS f3ae45b2b2
Add a short_description to be used by mods (#8980) 2020-10-09 19:11:21 +01:00
HybridDog f0b6f7909a
Mention texture modifier colorspace (#10112) 2020-10-08 19:44:27 +02:00
HybridDog 2f4037752b
Add minetest.get_artificial_light and minetest.get_natural_light (#5680)
Add more detailed light detection functions, a function to get the artificial light (torches) and a function to get the sunlight as seen by the player (you can specify timeofday).

Co-authored-by: rubenwardy <rw@rubenwardy.com>
2020-10-06 20:49:46 +02:00
Pierre-Yves Rollo 81c66d6efb Minimap as HUD element with API control
Features:
 * Define Minimap available modes (surface/radar, scale) from Lua, using player:set_minimap_modes()
 * New HUD elements for displaying minimap with custom size and placing
 * New minimap mode for displaying a texture instead of the map
2020-10-04 15:24:34 +02:00
Jordan Snelling 3068853e8a
Add First Person Attachments (#10360)
Fixes some other third person camera specific attachments.
Implements a single new flag for entities to be forced visible in first person mode.
Old mods do not need to be updated to use the new flag and are fully backwards compatible.
2020-10-04 15:10:34 +02:00
rubenwardy 3250b37e32
Deprecate get_player_velocity and add_player_velocity (#10173) 2020-10-04 00:33:45 +01:00
LoneWolfHT 9624387179
Add note to docs on how to override privileges (#9792) 2020-10-03 19:00:08 +02:00
Elijah Duffy 7d3641021b
Lua API: Add register_on_chatcommand to SSM and CSM (#7862)
Allows catching a chatcommand call just after the command and the
parameters are parsed but before its existence is checked and before the
corresponding function is run. Returning `true` from a callback function
will prevent default handling of the command leaving mods to handle the
command manually.
2020-10-03 17:38:08 +01:00
HybridDog 4b423ee9b1
Chatcommand: Show help message if func returns false without message
#9440
2020-10-03 17:33:43 +01:00
tenplus1 34e3ede8ee
Ability to remove minetest.after once set (#10103) 2020-09-23 19:11:56 +02:00
Zughy c8303f790c
lua_api.txt: author, release and title fields when downloading from ContentDB (#10129)
Co-authored-by: Marco <4279489-marco_a@users.noreply.gitlab.com>
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2020-09-16 15:47:20 +02:00
Lars Müller 050964bed6
Fix inventory swapping not calling all callbacks (#9923)
"Predicts" whether something will be swapped for allow callbacks, then calls callbacks a second time with swapped properties.

Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2020-09-04 20:49:07 +02:00
DS 9ed84cfa85
Mark multiply and divide with two vectors as deprecated (Schur product and quotient) (#10329) 2020-09-01 20:18:10 +02:00
LoneWolfHT c18dbadcb8
Fix dropped craftitems/tools not using light_source values (#9438) 2020-08-30 00:02:21 +01:00
EvidenceB 5c4b560b68
Add compass HUD element (#9312)
Co-authored-by: Jean-Patrick Guerrero <jeanpatrick.guerrero@gmail.com>
Co-authored-by: Pierre-Yves Rollo <dev@pyrollo.com>
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2020-08-29 20:13:30 +02:00
HybridDog 386d5f778a
Document normalmap textures (#10096) 2020-08-29 16:43:09 +01:00
DS 28e87ce9d5
Add vector.offset (#10321) 2020-08-29 16:41:29 +01:00
karamel59 1eaff3dfa4
Improve set_texture_mod documentation (#10339)
Properly documents the select_x_by_camera values
2020-08-27 21:48:18 +02:00
DS 98faeac5a7
Load media from subfolders (#9065) 2020-08-20 22:25:29 +02:00
v-rob 83d0c360cc
Add gradients and borders to FormSpec boxes (#8676) 2020-08-19 18:14:47 -07:00
hecks 5bda36143f
Clean up sound_fade (#10119)
Add proper documentation and correct gain reduction calculations.

Co-authored-by: hecktest <>
2020-08-19 19:26:37 +02:00
ANAND 291a6b70d6 Allow binding dig, place actions to keys; remove LMB/RMB hardcoding
Co-authored-by: Sam Caulfield <sam@samcaulfield.com>
2020-08-15 12:19:20 +03:00
sfan5 fff0393187
Render nodeboxes with opaque material if possible (#10122) 2020-08-12 11:52:50 +02:00
sfan5 9bba52c400
content_cao: Support texture animation for upright_sprite (#10020) 2020-07-30 17:39:57 +02:00
Lejo 715a123a33
Add PUT and DELETE request + specific method value to HTTP API (#9909) 2020-07-29 23:16:21 +02:00
Wuzzy ae83edd165
Play place_failed sound if occupied or cannot attach (#9486) 2020-07-27 19:40:33 +02:00
sfan5 4b4513a67d
Implement grouped mode for find_nodes_in_area (#9888)
plus general improvements to find_node_* functions
2020-07-14 22:36:53 +02:00
v-rob 2bec83eec0
Add FormSpec font styling options (#9763)
* Add FormSpec font styling options

* Change multiplication to stof

* Remove extraneous check
2020-07-12 09:48:50 +02:00
v-rob e0499731a8
Allow FormSpec elements to be focused with `set_focus` (#9353)
This allows you to specify a FormSpec element to set the focus of with "set_focus[<name>;<always set>]".
2020-07-12 09:47:05 +02:00
v-rob b1ff04e06d
Formspec: Make dropdowns optionally return event based on index, not value (#9496) 2020-07-10 12:11:26 +02:00
v-rob f7c78993f6
Document deprecation of *_hovered and *_pressed styles (#10092) 2020-06-23 17:59:02 +01:00
Danila Shutov 3a6dfda358
Make shading of CAOs optional (#10033) 2020-06-16 20:48:31 +01:00
Lars Müller e7e065f553
Exposing the zoom key to Lua API (#9903)
Co-authored-by: Raul Ferriz <raul.ferriz@gmail.com>
2020-06-13 22:46:20 +02:00
sfan5 2424dfe007
Server pushing media at runtime (#9961) 2020-06-13 19:03:26 +02:00
NetherEran 7148834440
Some vector functions useful for working with rotations (#9572)
* 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-09 19:38:39 +02:00
Vitaliy e746607d0f
Restore visual_scale support for nodeboxes (and allfaces) (#9906) 2020-06-06 22:25:18 +02:00
MoNTE48 34862a6442 Add disable_jump check for the player's feet 2020-05-29 22:53:58 +02:00
Wuzzy 65a6a316d0 Add minetest.is_creative_enabled 2020-05-29 22:45:40 +02:00
Wuzzy 083b285f43
Rename “Minimal development test” to “Development Test” (#9928) 2020-05-26 00:17:52 +02:00
ANAND 8ee2ece3c9
lua_api.txt: Fix minor typo (#9917) 2020-05-24 11:48:19 +02:00
sfan5 9d6e7e48d6 Implement spawning particles with node texture appearance 2020-05-23 22:52:21 +02:00
sorcerykid 15ba75e4cf Add on_authplayer callback and 'last_login' to on_joinplayer (#9574)
Replace on_auth_fail callback with more versatile on_authplayer
    Better clarify account login process in Lua API documentation
    Change initial timestamp for newly registered accounts to -1
2020-05-23 13:25:29 +02:00
Lejo1 e79bc40c0a Check for valid base64 before decoding (#9904) 2020-05-22 14:26:22 +02:00
Paramat 42fcfb75e8
Allow more than 255 biomes, document new maximum (#9855)
Change biomemap data type from u8 to u16.
New technical (not practical) maximum is 65535 biomes.
2020-05-20 22:16:14 +01:00
Wuzzy c94d37827d
Rework functionality of leveled nodes (#9852)
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2020-05-19 21:08:37 +02:00
LoneWolfHT 7d3972a504
Add ability to scale HUD text (#9814)
Add 'size' property to HUD text elements that is used for relative font size calculations.
2020-05-19 19:10:39 +02:00
ANAND c1ce4be756
Make automatic_rotate relative, allow setting rotation (#8468)
automatic_rotate does not make sense if it is absolute. Make it relative.

To avoid bouncing, set_rotation did not update the client when automatic_rotate was set. That's no longer necessary because the new spinning method applies the rotation on top of the current one, and the updates are necessary for set_rotation to actually transform the object.

Co-authored-by: ANAND <ClobberXD@gmail.com>

Co-authored-by: Pedro Gimeno <pgimeno@users.noreply.notabug.org>
2020-05-16 21:42:31 +02:00
Wuzzy 7ec76e530d
Add mapgen settings to world creation dialog (#9254) 2020-05-12 02:52:52 +01:00
Lars Müller 9ba24f89f5
Damage texture modifier (#9833)
Adds a new object property "damage_texture_modifier"
2020-05-11 21:41:36 +02:00
Wuzzy 6e1372bd89
Add support for statbar “off state” icons (#9462)
This adds support for optional “off state” icons for statbars. “off state icons” can be used to denote the lack of something, like missing hearts or bubbles.

Add "off state" textures to the builtin statbars.

Co-authored-by: SmallJoker <mk939@ymail.com>
2020-05-11 21:40:45 +02:00
v-rob 664800b2ad
FormSpec: Add universal style selector `*` (#9718) 2020-05-06 19:36:02 +02:00
sfan5 b6b80f55c8 Expose collided objects in moveresult
closes #9787
2020-05-06 14:03:52 +02:00
SmallJoker 1b6f40c356 Rename moveresult speed to velocity 2020-05-05 08:37:04 +02:00
Hugues Ross cb9a44ef89
Add 'content_offset' and 'padding' style properties for buttons (#9661)
* Add padding and content_offset style properties to buttons
2020-05-02 13:32:02 +02:00
Wuzzy 5c96f57782
Add a convention about z_index (#9701) 2020-05-02 13:12:02 +02:00
ANAND e0ea87f1f3
set_fov: Add support for time-based transitions (#9705) 2020-05-02 12:52:11 +02:00
sfan5 ac368af4fe
Allow connection info to be missing from minetest.get_player_information() (#9739)
fixes #9352
This reverts commit 23c907befe.
2020-05-01 21:44:28 +02:00
sfan5 3475759d1a Expose collision information to LuaEntity on_step 2020-04-27 20:45:46 +02:00
EvidenceB Kidscode cee3c5e73d
Add server side translations capability (#9733)
* Add server side translations capability
2020-04-25 07:20:00 +02:00
Paramat 4e2473ec49
Document which noise APIs add world seed to noiseparams seed (#9693) 2020-04-17 10:24:51 +02:00
SmallJoker 27d611fe55
Add default stack size setting (#8873)
New setting "default_stack_max" to alter the default stack sizes of all items when desired.

Co-authored-by: Pascal Abresch <nep@packageloss.eu>
2020-04-13 10:53:10 +02:00
DS 0ac999ded7
Add scroll_container formspec element (redo) (#9101)
New formspec elements:

 - `scroll_container[<X>,<Y>;<W>,<H>;<scrollbar name>;<orientation>;<scroll factor>]`
 - `scroll_container_end[]`

Other elements can be embedded in this element. Scrollbar must be placed manually.
2020-04-13 10:50:07 +02:00
Wuzzy a24d3b3600
Play 'player_jump' when player jumps (#9373) 2020-04-12 00:50:40 +01:00
Lars Müller af2e6a6a10
Improve waypoints and add image variant (#9480) 2020-04-11 22:09:46 +01:00
Hugues Ross f780bae05c
Formspecs: Add state-selection to style elements (#9378) 2020-04-11 21:39:30 +01:00
rubenwardy 143a37e947
Clarify use of minetest.request_insecure_environment() (#9597) 2020-04-06 16:54:27 +02:00
Wren Turkal f91124a0c0
Add allowed_mapgens option in game.conf. (#9263)
The game.conf has a disallowed_mapgens option. However, some games
require a certain mapgen to be used, like the CTF plugin. This change
adds an option to specify allowed mapgens so that the setting can be
specified in a way that needn't be updated as map generators are added
to Minetest.
2020-04-06 16:06:16 +02:00
Wuzzy faedde08f9
Some minor Lua API documentation clarifications (#9461)
See #5854
2020-04-06 16:05:27 +02:00
Paramat 45a2ca0af2
Add warning to set_sky() docs about unstable dawn and night sky colours (#9578)
Also clean up confusing double meaning usage of the word 'skybox'.
2020-04-03 02:57:15 +01:00
v-rob 9953145a4e
Formspec: Mark `hypertext` and markup language as unstable 2020-03-28 21:54:19 +01:00
sfan5 3c0d309643 Improve documentation of minetest.get_node_drops()
Also remove the comment saying it could be removed or modified.
2020-03-26 20:35:05 +01:00
Dave Chu f7c7353a9a
Fix small typos in lua_api.txt (#9546) 2020-03-25 11:44:20 +01:00
v-rob 13ad8e2a09
Formspecs: Add starting frame to `animated_image` (#9411) 2020-03-16 22:56:48 +01:00
Jordan Snelling b9a0626d88
Fix star visilibity and documentation (since 946c03c6)
Fix memory leak (unused allocation)
Fix star rendering
Rename sky color struct
Fix stars on android
Remove extraneous .data() from android star draw
2020-03-08 16:13:36 +01:00
sfan5 e774d8ca2f Fixes around ServerActiveObject on_punch handling 2020-03-05 22:04:23 +01:00