SmallJoker [Thu, 10 Dec 2020 19:59:24 +0000 (20:59 +0100)]
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"
HybridDog [Fri, 4 Dec 2020 19:16:12 +0000 (20:16 +0100)]
Fix MSAA stripes (#9247)
This only works when shaders are enabled.
The centroid varying avoids that the textures (which repeat themselves out of bounds) are sampled out of bounds in MSAA.
If MSAA (called FSAA in minetest) is disabled, the centroid keyword does nothing.
Paramat [Fri, 20 Nov 2020 16:11:19 +0000 (16:11 +0000)]
Move Mapgen V7 river generation into the main generation loop (#10639)
All terrain generation now occurs in one loop, instead of rivers being
carved afterwards in a separate loop.
Fixes the removal of nodes added by mods in 'register on generated'.
Avoids other problems and reduces the chance of future bugs.
Mapchunk generation time is reduced.
Also fixes a code mistake which resulted in river channel generation
being disabled at floatland altitudes even when floatlands were disabled.
SmallJoker [Thu, 12 Nov 2020 18:15:41 +0000 (19:15 +0100)]
PlayerSAO: Run on_player_hpchange raw change values (#10478)
The callback is only run when a change in HP is to be expected.
Following cases will not trigger the callback:
* Dead player damaged further
* Healing full-health player
* Change of 0 HP
Markus Koch [Sat, 7 Nov 2020 16:45:32 +0000 (17:45 +0100)]
Joystick: Remap joystick-specific KeyTypes to generic ones
According to the following table:
* MOUSE_L -> DIG
* MOUSE_R -> PLACE
* SCROLL_UP -> HOTBAR_NEXT
* SCROLL_DOWN -> HOTBAR_PREV
This commit entirely removes the special KeyTypes used for joysticks.
Support for the MOUSE KeyTypes had already been removed in the main
game code without adapting the joystick code, breaking joystick
input. This commit restores joystick functionality.
red-001 [Mon, 2 Nov 2020 21:21:03 +0000 (21:21 +0000)]
Block attempts to connect to the client (#10589)
A Minetest peer initiates a connection by sending a packet with an invalid peer_id, for whatever reason the code for doing this ran on both the client and the server meaning you could connect to a client if you knew what the address:port tuple it was listening on.
Lars [Sun, 18 Oct 2020 23:38:51 +0000 (16:38 -0700)]
Minor clientmap improvements.
- Avoid calculating isBlockInSight for blocks without meshes.
- Add metric for how many blocks the client has currently loaded.
- Make some variables constant.
HybridDog [Tue, 6 Oct 2020 18:49:46 +0000 (20:49 +0200)]
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).
SmallJoker [Mon, 5 Oct 2020 07:07:33 +0000 (09:07 +0200)]
Remove unused functions reported by cppcheck (#10463)
Run unused functions reported by cppcheck
This change removes a few (but not all) unused functions.
Some unused helper functions were not removed due to their complexity and potential of future use.
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
Jordan Snelling [Sun, 4 Oct 2020 13:10:34 +0000 (14:10 +0100)]
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.
Elijah Duffy [Sat, 3 Oct 2020 16:38:08 +0000 (09:38 -0700)]
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.