Commit Graph

591 Commits

Author SHA1 Message Date
est31 8fd57dc4bb
Introduce builtin_shared and use it to fix #4778
Fixes #4778 which was about the error:

ServerError: Lua: Runtime error from mod '' in callback item_OnPlace():
/usr/local/share/minetest/builtin/game/item.lua:278: attempt to call global 'check_attached_node' (a nil value)

The issue was a regression of commit 649448a2a91fbf3e944b2f2e739f4e2292af1df0

"Rename nodeupdate and nodeupdate_single and make them part of the official API"
2022-05-21 16:14:02 +02:00
paramat 9299a22081
Mgv7: Add optional floatlands, disabled by default 2022-05-21 16:14:02 +02:00
sfan5 a75a5eb3eb
Revert "Adding particle blend, glow and animation (#4705)"
This reverts commit 93e3555eae2deaeca69ee252cfa9cc9c3e0e49ef.
2022-05-21 16:14:01 +02:00
Foghrye4 cfa39937f9
Adding particle blend, glow and animation (#4705) 2022-05-21 16:14:01 +02:00
est31 b47663d742
Rename nodeupdate and nodeupdate_single and make them part of the official API
Now, the renamed forms of nodeupdate and nodeupdate_single are part of the official API.

As nodeupdate has been used by Minetest Game and in mods despite of not
being part of the official API, we ease the transition by still supporting
it for the 0.4.15 release. After the release, the two functions can be removed.

The removal will not violate the stability promise, as that promise only
includes the official and documented API.

Also, make some formerly global functions local. They most likely haven't
been used by mods, therefore they won't get stubs with deprecation warnings,
hard erroring directly.
2022-05-21 16:14:00 +02:00
paramat f3720d5ee4
Builtin/../falling: Fix bugs caused by 'ignore' nodes
Original commit by t4im, rebased and developed by paramat.
Fix CONTENT_IGNORE being replaced by falling nodes or causing large
areas of sand to collapse into itself.
Format some conditional code for clarity.
Add and clarify some comments.
2022-05-21 16:14:00 +02:00
Wuzzy 8de2093059
Privileges: Only give singleplayer 4 basic privs
- interact
- shout
- privs
- basic_privs
2022-05-21 16:14:00 +02:00
Wuzzy 67fbbcec71
Separate optional from required mod dependencies in main menu (#4721)
* Separate optional from require dep's in main menu

* Simplify modmgr mod dependency listing code
2022-05-21 16:13:59 +02:00
lhofhansl 912d6b1059
Add debug priv, and allow player to display the scene as wire-frame. (#4709) 2022-05-21 16:13:59 +02:00
ShadowNinja eb60afd472
Add version API 2022-05-21 16:13:58 +02:00
Auke Kok f5336937c7
Core.rotate_and_place: Remove unused call to get_look_pitch() 2022-05-21 16:13:58 +02:00
lhofhansl c3f6398f56
Optionally disable optimization that causes underwater and cave rendering glitches. (#4686) 2022-05-21 16:13:57 +02:00
paramat 58821d5d9d
Changes to static object storage limit and error message
Move static object storage force-delete message from errorstream to
warningstream.
Increase 'max objects per block' setting to 64.
Add missing spaces in warning code.
2022-05-21 16:13:57 +02:00
red-001 8b8f204d6d
Chat commands: Trim whitespaces from input of `/privs` command 2022-05-21 16:13:57 +02:00
rubenwardy 94296a9d2a
Builtin: Add vector.floor helper function 2022-05-21 16:13:56 +02:00
ShadowNinja 92b9b13d05
Enable mod security by default 2022-05-21 16:13:56 +02:00
red-001 8ba872f6e4
Builtin/../chatcommands: Add /grantme command 2022-05-21 16:13:55 +02:00
tenplus1 6dae557ad8
Builtin/../falling.lua: Code optimisation 2022-05-21 16:13:55 +02:00
red-001 db4234d742
Add a button for disabling all mods to world config. (#3900) 2022-05-21 16:13:54 +02:00
SmallJoker 984358f7bd
Add missing languages to the settings 2022-05-21 16:13:54 +02:00
HybridDog 8210849b50
VoxelArea: faster iter function (#4490) 2022-05-21 16:13:54 +02:00
Loïc Blot 76ed831877
Chat: new settings to prevent spam
Added the following chat coreside features
* Chat messages length limit
* Message rate limiting
* Message rate kicking

Note:
* handleChat now takes RemotePlayer pointer instead of u16 to remove useless
  lookups
2022-05-21 16:13:53 +02:00
paramat cadfd09355
Builtin/falling: Add fallback vector in case of nil 'wallmounted to dir'
The fallback vector is in case 'wallmounted to dir' is nil due
to voxelmanip placing a wallmounted node without resetting a
pre-existing param2 value that is out-of-range for wallmounted.
The fallback vector corresponds to param2 = 0.
2022-05-21 16:13:53 +02:00
raymoo 222e8090c1
Forceloading: Transient forceloads
Adds a flag to forceload_block which lets you turn off persistence for
that forceload.
2022-05-21 16:13:52 +02:00
Rui 1344513303
Fix typo in core.after (#4560) 2022-05-21 16:13:52 +02:00
paramat eef3643501
Conf.example: Re-add deleted noise parameter documentation
Re-add documentation of noise parameter formats.
Re-add 'mgv5_np_ground' noise parameters in group format.
Both these were deleted through auto-generation of conf.example.
Add note to builtin/mainmenu/dlg_settings_advanced.lua that this
documentation must be preserved.
2022-05-21 16:13:52 +02:00
paramat 2e54664273
Builtin: Change error to warning for light_source > 14 2022-05-21 16:13:51 +02:00
James Stevenson aaf808144d
Increase default font size by 1 2022-05-21 16:13:51 +02:00
est31 d6ef8bb772
Fix a typo and use proper deprecation notification system
Fix a typo pointed out by @thecow275.

Also, use the deprecated notification system which respects the
deprecated_lua_api_handling setting.
2022-05-21 16:13:50 +02:00
paramat a114f7297e
Register.lua: Throw error if node 'light_source' > core.LIGHT_MAX
Add 'core.LIGHT_MAX = 14' to builtin/game/constants.lua with the intention
to replace misplaced 'default.LIGHT_MAX = 14' in Minetest Game.
Add comment in light.h requiring the constant be changed in both places.
Add lighting bug warning to note in lua_api.txt.
There are hundreds of mod uses of 15 which causes a lighting bug.
2022-05-21 16:13:50 +02:00
paly2 716d19077f
Add minetest.unregister_item and minetest.register_alias_force 2022-05-21 16:13:49 +02:00
Rui c774d1e0df
Document keymap_autorun in settingtypes.txt and minetest.conf.example (#4486) 2022-05-21 16:13:49 +02:00
red-001 1c7b95f66f
Settingtypes.txt: Clarify comments, correct spelling 2022-05-21 16:13:49 +02:00
SmallJoker 3102f9f030
Builtin: Disallow registering users with the same name
Prevents duplicate names: 'NickName', 'nickname', 'NICKNAME'.
Skips already registered users, so they can connect as usual.
2022-05-21 16:13:48 +02:00
est31 6213fb1cf6
Client: disable pre v25 init sending by default
Disable the ability to connect to old servers by default to
improve password security.

If people still want to connect to old (0.4.12 and earlier)
servers, they can flip the send_pre_v25_init setting.

Add the ability to detect if we've tried to connect
to a server which only supports the pre v25 init protocol,
and show an apropriate error message. Most times the error
will already be catched at the serverlist level, the
detection mechanism only acts as last resort, because the
"Connection timed out" error message that would be shown
otherwise would be very confusing.

Automatic "fixing" of this condition is not desired,
as it would allow for downgrade attacks.

As already 161 of the 167 servers on the serverlist
support the new srp based auth protocol (> 96%),
the breakage should be minimal.

Follow up of commit

af30183124d40a969040d7de4b3a487feec466e4 "Add option to not send pre v25 init packet"

Also change the pessimistic assumption of masterlist
server versions to optimistic, in order to avoid buggy
behaviour (favourites not in the serverlist would be
denied to connect to, etc).
2022-05-21 16:13:48 +02:00
Xunto bf33a189da
Move on join and on leave messages to lua (#4460) 2022-05-21 16:13:47 +02:00
Tim cae4272b18
Tidy up generate_from_settingtypes.lua a bit.
* Multiline strings
* Table-concat instead of String-concats
* string.rep instead of loop-concat
* string.format %q instead of manual quotation by gsub
* Assert writeable files
* Generate new settings_translation_file
2022-05-21 16:13:47 +02:00
Tim caeafe3a44
Move generation from settingtypes out of dlg_settings_advanced
Avoids unreachable code linter warning by moving generation code
(of minetest.conf.example and settings_translation_file.cpp)
out of dlg_settings_advanced.

Due to passing the settings, also it avoids reading the settings file twice.

Instead of activating the code by changing the active if-clauses,
its activation is now done by uncommenting the loadfile() statement.
2022-05-21 16:13:46 +02:00
Ben Deutsch 6d21a3b8fe
Zooming the camera requires the 'zoom' privilege 2022-05-21 16:13:46 +02:00
Ben Deutsch bb50564ddd
Document zoom_fov in settingtypes.txt and minetest.conf.example 2022-05-21 16:13:46 +02:00
Wuzzy ac759533bd
Main menu, lua_api.txt: Fix mod/texture pack screenshot size issues
Recommend mod screenshot size in lua_api.txt
Adjust displayed screenshot size of texture packs
Document texture pack files in lua_api.txt
2022-05-21 16:13:45 +02:00
Tim 552e304da9
Builtin: Add core.MAP_BLOCKSIZE constant 2022-05-21 16:13:45 +02:00
Tim d03f226194
Builtin: Fix check for a player object in core.check_player_privs
core.check_player_privs accepts as first argument a name or player object, but just tested for a string.
This caused crashes inside builtin, when being passed any unexpected types.

This provides a better (duck-typing like) test, better error reporting.
2022-05-21 16:13:44 +02:00
Tim a1fcfc28ec
Builtin/profiler: Replace game profiler (#4245)
Use the setting "profiler.load" to enable profiling.
Other settings can be found in settingtypes.txt.

* /profiler print [filter] - report statistics to in-game console
* /profiler dump [filter] - report statistics to STDOUT and debug.txt
* /profiler save [format [filter]] - saves statistics to a file in your worldpath
	* txt (default) - same treetable format as used by the dump and print commands
	* csv - ready for spreadsheet import
	* json - useful for adhoc D3 visualizations
	* json_pretty - line wrapped and intended json for humans
	* lua - serialized lua table of the profile-data, for adhoc scripts
* /profiler reset - reset all gathered profile data.
	This can be helpful to discard of any startup measurements that often spike during loading or to get more useful min-values.

[filter] allows limiting the output of the data via substring/pattern matching against the modname.

Note: Serialized data structures might be subject to change with changed or added measurements.
	csv might be the most stable, due to flat structure.

Changes to the previous version include:

* Updated and extended API monitoring
* Correct calculation of average (mean) values (undistorted by idleness)
* Reduce instrumentation overhead.
* Fix crashes related to missing parameters for the future and occasional DIV/0's.
* Prevent issues caused by timetravel (overflow, timejump, NTP corrections)
* Prevent modname clashes with internal names.
* Measure each instrumentation individually and label based on registration order.
* Labeling of ABM's and LBM's for easier classification.
  Giving several ABM's or LBM's the same label will treat them as one.
  Missing labels will be autogenerated based on name or registration order.
* Configurable instrumentation and reporting. Skip e.g. builtin if you don't need it.
* Profile the profiler to measure instrumentation overhead.
2022-05-21 16:13:44 +02:00
rubenwardy c9476e8c2c
Remove cinematic toggle on F8
Also update cinematic mode's description to include mouse
2022-05-21 16:13:44 +02:00
est31 36ebc1f65a
Disable joysticks per default for now
It seems that various different devices register as
Joysticks on linux, and their presence has caused
lots of confusion amongst minetest users.

Therefore, disable the joystick feature.

Closes #4261
Closes #4221
2022-05-21 16:13:43 +02:00
HybridDog 6cbe7ef399
Only allow strings to be passed to minetest.global_exists (#4253)
Sometimes you accidentally forget the quotes when using global_exists, this makes minetest abort if you did so.

M  builtin/common/strict.lua
2022-05-21 16:13:43 +02:00
paramat a51850f7c2
Mgflat/fractal/v7/valleys: Denser 3D noise tunnels
Reduce spread from 96 to primes 61 and 67 (either side of 64)
Prime spreads help to keep 3D noise periodic features unaligned
'cave width' 0.2 to preserve tunnel width
Reduce octaves to 3 to improve network structure
2022-05-21 16:13:42 +02:00
Auke Kok db3e245ff0
Builtin/game/item: Add `place_param2` nodedef field
This allows a nodedef to specify a fixed value for param2 to be
used for all normal placements.

There are several uses for this:

- nodes that require param2 to be set to a non-zero value for
  internal mod use. E.g. leafdecay could use this to detect that
  leaves are played by players.
- force wallmounted or facedir value at placement at placement

This overrides any player look direction or other on-the-fly
param2 setting during placement.
2022-05-21 16:13:42 +02:00
est31 9fe6a3d2b3
Initial Gamepad support
Adds initial ingame gamepad support to minetest.

Full Formspec support is not implemented yet and
can be added by a later change.
2022-05-21 16:13:41 +02:00