Commit Graph

1216 Commits

Author SHA1 Message Date
Jude Melton-Houghton
7632af3c73
Consolidate API object code (#12728)
Co-authored-by: sfan5 <sfan5@live.de>
2022-10-04 08:31:36 -04:00
sfan5
525fc3833c Implement tool use sounds 2022-09-30 14:02:14 +02:00
20kdc
b1233056b7
Add zstd compression support (#12515) 2022-09-28 09:06:14 -04:00
Jude Melton-Houghton
f4a01f3a5d
Avoid duplication of mod metadata in memory (#12562)
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-26 17:03:43 -04:00
Jude Melton-Houghton
03428d9825
Modify PUC Lua to wrap C++ exceptions (#12445) 2022-09-26 07:23:48 -04:00
Jude Melton-Houghton
6f5a68b7f7
Allow getmetatable in CSM (#12776) 2022-09-18 17:32:18 +02:00
Wuzzy
1d04903c19
Add paramtype2s for 4 horizontal rotations and 64 colors (#11431)
4dir is like facedir, but only for 4 horizontal directions: NESW. It is identical in behavior to facedir otherwise. The reason why game makers would want to use this over facedir is 1) simplicity and 2) you get 6 free bits.
It can be used for things like chests and furnaces and you don't need or want them to "flip them on the side" (like you could with facedir).

color4dir is like colorfacedir, but you get 64 colors instead of only 8.
2022-09-16 13:18:55 +02:00
SmallJoker
bc3dccca5c
Mainmenu: Properly sort mods and games (#12758)
This also removes trivial and unused pkgmgr functions
Fixes a bug caused by sorting in 2133fc8
2022-09-12 19:24:54 +02:00
Jude Melton-Houghton
fe13f9dfd1
Fix potential use-after-free with item metadata (#12729)
This fixes a use-after-free bug in the case where itemstack metadata is accessed after the itemstack has been garbage-collected.
2022-09-11 19:28:37 +02:00
Herman Semenov
038da00e79
Code optimizations / refactor (#12704)
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
Co-authored-by: sfan5 <sfan5@live.de>
2022-09-06 11:21:09 +01:00
Lars Müller
0e439b2fa3
Check hp_max > 0 for entities (#12667) 2022-08-13 15:35:41 +01:00
Jude Melton-Houghton
ab8dfb45b4
Allow buffer argument to VoxelManip:get_light_data (#12682) 2022-08-13 08:53:47 +02:00
SmallJoker
c8ee755c05
Physics overrides: Move values to a common struct (#12591)
Co-authored-by: sfan5 <sfan5@live.de>
2022-08-12 10:17:02 +01:00
Zughy
bcc56803d7
Fix crash when stars are reset 2022-08-10 18:03:57 +02:00
SmallJoker
a81259d19a
Run Minetest update checker on startup (#7629)
This feature is enabled by default for non-Android release builds. Package
maintainers may use -DENABLE_UPDATE_CHECKER=0 to disable it.

Co-authored-by: rubenwardy <rw@rubenwardy.com>
Co-authored-by: sfan5 <sfan5@live.de>
2022-08-02 21:34:17 +02:00
AFCMS
6ec6acc539
Add minetest.settings to CSM API and allow CSMs to provide settingtypes.txt (#12131)
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: SmallJoker <SmallJoker@users.noreply.github.com>
2022-08-02 11:58:08 +02:00
rubenwardy
a871115889
Fix some warnings (#12615) 2022-07-30 12:51:23 +01:00
Jude Melton-Houghton
d631f21024
Let core.get_mod_storage be called multiple times (#12572) 2022-07-23 22:27:07 +02:00
rubenwardy
9f41b4f72d Add check_mod_configuration to main menu 2022-07-14 22:12:54 +01:00
sfan5
1d512ef7f4 Reduce code duplication between c_converter.cpp and helper.cpp 2022-07-14 20:55:45 +02:00
sfan5
8ff3fadba0 Remove unnecessary float limits from script API
Leaves a check for NaN and inf.
2022-07-14 20:55:45 +02:00
Lexi Hale
20bd6bdb68
Animated particlespawners and more (#11545)
Co-authored-by: Lars Mueller <appgurulars@gmx.de>
Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: Dmitry Kostenko <codeforsmile@gmail.com>
2022-07-13 11:57:12 +02:00
SmallJoker
e51f474613
Sounds: Various little improvements (#12486)
Use SimpleSoundSpec where reasonable (OpenAL)
Ensure the sound IDs do not underflow or get overwritten -> loop in u16
Proper use of an enum.
2022-07-09 22:32:24 +02:00
Wuzzy
142928e944
Allow to set maximum star opacity at daytime (#11663) 2022-07-02 19:57:48 +01:00
Zughy
18fbc0394b
Remove tile_images and special_materials obsolete code (#12455)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2022-06-28 00:55:01 +01:00
JosiahWI
4163c872af
Fix two memleak reports from Coverity (#12466) 2022-06-26 14:37:50 +01:00
SmallJoker
a463620edb
Re-order sound-related code (#12382)
Dropped ServerSoundParams -> moved to ServerPlayingSound. This gets rid of the duplicated
'fade' and 'pitch' values on server-side where only one was used anyway.
SimpleSoundSpec is the basic sound without positional information, hence 'loop' is included.

Recursively added PROTOCOL_VERSION to most functions to reduce the versioning mess in the
future. Per-type version numbers are kept for now as a safety rope in a special case.
2022-06-20 21:56:12 +02:00
sfan5
e9e721b937 Fix entity related bugs
* Make minetest.add_entity() binary-safe
* Fix on_death pushing dummy ObjectRef instead of nil
2022-06-15 17:20:07 +02:00
Lars Müller
e7d4ec6834
on_deactivate: distinguish removal and unloading (#11931)
Sometimes you need to be able to do removal-related cleanup, such as removing files from disk, or entries from a database. staticdata obviously isn't suitable for large data. The data shouldn't be removed if the entity is unloaded, only if it is removed.
2022-06-11 20:01:14 +02:00
Lars Müller
f4a53f7ee6
No damage effects on hp_max change (#11846) 2022-06-11 20:00:40 +02:00
rubenwardy
4baf56520d
Android: Add support for sharing debug.txt (#12370) 2022-06-05 17:42:09 +01:00
rubenwardy
03d86ea0b4
Add register dialog to separate login/register (#12185)
New users find Minetest's account system confusing.
This change moves username/password to a new dialog,
with login and register buttons added to the Join Game tab.

The old registration confirmation dialog is removed in
favour of the new dialog.

Fixes #8138
2022-06-05 17:47:38 +02:00
Wuzzy
6a6b579c54
Add helper functions to make tool usable n times (#12047) 2022-06-03 21:47:04 +02:00
sfan5
9fc018ded1 Fix use-after-free in node meta cleanup
bug introduced in 8908a9101608d3343023b470743ef63f1c44b0b7
2022-05-29 16:30:13 +02:00
sfan5
a9a207685a Reject registering node with empty name
fixes #10769
2022-05-29 14:00:19 +02:00
stefan
bb671c3089 Remove debug.get/setmetatable from security whitelist
fixes #12216
2022-05-29 14:00:19 +02:00
sfan5
8908a91016 Get rid of node metadata when it becomes empty
fixes #8943
2022-05-29 14:00:19 +02:00
sfan5
f195db2d14 Add API function to invoke player respawn
closes #12272
2022-05-29 14:00:19 +02:00
sfan5
da71e86633 Protect a few more settings from being set from mods
Of those settings main_menu_script has concrete security impact, the rest are added out of abundance of caution.
2022-05-29 14:00:19 +02:00
sfan5
8b74257bf3 Reduce size of ContentFeatures structure
On my system this is a reduction from 4664 to 3704 bytes.
This is not for the sake of saving RAM but ensuring
commonly used structures fit into caches better.
2022-05-26 15:49:12 +02:00
rubenwardy
4e9e230e34
Deprecate game.conf name, use title instead (#12030) 2022-05-21 16:23:30 +01:00
sfan5
ec9f157512 Use native packer to transfer globals into async env(s) 2022-05-10 22:37:42 +02:00
Jude Melton-Houghton
7f58887ae3
Support packing arbitrary graphs (#12289) 2022-05-10 22:37:33 +02:00
Lars Müller
89c82035d8
hud_get: Return precision field for waypoints (#12215) 2022-05-04 20:55:20 +02:00
sfan5
e7659883cc Async environment for mods to do concurrent tasks (#11131) 2022-05-02 20:56:06 +02:00
sfan5
56a558baf8 Refactor some Lua API functions in preparation for async env 2022-05-02 20:54:55 +02:00
sfan5
5362f472ff Remove some unused variable from Lua class wrappers 2022-05-02 20:54:55 +02:00
sfan5
a65f6f07f3 Clean up some auth packet handling related code 2022-04-28 20:05:26 +02:00
Lars Müller
1f27bf6380
Remove unneeded ObjectRef setter return values (#12179) 2022-04-10 23:20:51 +02:00
ShadowNinja
7993909fab Spacing fixes 2022-04-08 14:55:21 +01:00
Jude Melton-Houghton
0b5b2b2633
Disentangle map implementations (#12148)
Fixes violation of Liskov substitution principle
Fixes #12144
2022-04-07 21:58:04 +02:00
Jude Melton-Houghton
06d197cdd0
Store vector metatable in registry 2022-03-29 18:07:00 +02:00
DS
8d387433b1
Fix the documentation of InvRef:get_lists() and clean up code (#12150) 2022-03-29 18:06:16 +02:00
x2048
0f25fa7af6
Add API to control shadow intensity from the game/mod (#11944)
* Also Disable shadows when sun/moon is hidden. Fixes #11972.
2022-03-26 16:58:26 +01:00
Lars Müller
b9e886726c
Readd basic_debug as a HUD flag (#12020) 2022-03-05 22:16:17 +01:00
Zughy
44fc888bd6
Allow get_sky to return a table (#11963) 2022-03-05 22:15:41 +01:00
SmallJoker
f7311e0d97
Lua API documentation: Various fixes (#12059)
Change 1: Clarify when on_step collision information is provided
Change 2: Document PostgreSQL and Redis settings
Change 3: Overall AreaStore documentation improvements including consistent parameter naming based on community suggestions
2022-02-23 21:21:37 +01:00
sfan5
ba6fbc417e Remove awful Mingw32 workarounds
Instead a warning is triggered if an affected compiler is detected.
closes #12022
2022-02-08 19:31:24 +01:00
sfan5
afb061c374
Fix broken server startup if curl is disabled (#12046) 2022-02-04 20:29:28 +01:00
Lars Müller
1ee37148a8
Fix types of get_mapgen_setting_noiseparams (#12025) 2022-02-04 20:28:43 +01:00
rubenwardy
128f6359e9
Use virtual paths to specify exact mod to enable (#11784) 2022-01-30 22:40:53 +00:00
Lars Müller
fe0b2d02bf
Define control(bits) as "unset" for entities (#11995) 2022-01-27 22:22:58 +01:00
Zughy
37d80784dd
Allow resetting celestial vault elements by leaving its arguments empty (#11922) 2022-01-22 12:42:49 +01:00
sfan5
9a12e4499e Minor improvements to Lua sandbox 2022-01-15 17:45:08 +01:00
sfan5
4c8c649779
Mainmenu game-related changes (#11887)
fixes:
* Switching between games does not immediately hide creative mode / damage buttons if so specified
* World creation menu has a game selection list even though the menu already provides a gamebar
* Showing gameid in world list is unnecessary
* Choice of mapgen parameters in menu persists between games (and was half-broken)
2022-01-09 21:15:35 +01:00
sfan5
5eb45e1ea0
Restore pass-through of direction keys (#11924)
This moves relevant code into the PlayerControl class and gets rid of separate keyPressed variable.
2022-01-09 18:46:36 +01:00
Jude Melton-Houghton
bf22569019
Use a database for mod storage (#11763) 2022-01-07 20:28:49 +02:00
Wuzzy
b81948a14c
Fix damage wraparound if very high damage (#11872) 2022-01-06 21:16:35 +01:00
sfan5
b2409b14d0 Refactor trusted mod checking code 2021-12-18 20:37:13 +01:00
sfan5
f405459548 Remove setlocal and setupvalue from debug table whitelist
It's likely that these could be used trick mods into revealing the insecure
environment even if they do everything right (which is already hard enough).
2021-12-18 20:37:13 +01:00
sfan5
8c99f2232b Don't let HTTP API pass through untrusted function
This has been a problem since the first day, oops.
2021-12-18 20:37:13 +01:00
sfan5
8472141b79
Restructure devtest's unittests and run them in CI (#11859) 2021-12-18 20:36:43 +01:00
Corey Powell
413be76c63
Implemented disconnect_player (#10492)
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2021-11-26 19:19:40 +00:00
sfan5
87ab97da2a
Fix find_nodes_in_area misbehaving with out-of-map coordinates (#11770)
This ensures that no overflows (side-effects) happen within the find_nodes_in_area function by limiting coordinates like done in the map generation code.
2021-11-26 19:32:41 +01:00
Lejo
b9051386ae
Add Lua bitop library (#9847) 2021-11-26 19:31:05 +01:00
Elijah Duffy
cbf658f83d
Lua API: Add rmdir, cpdir and mvdir (#9638)
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2021-11-10 19:10:20 +01:00
Wuzzy
6910c8d920
Fix number of tool uses being off by 1..32767 (#11110) 2021-10-31 22:33:33 +00:00
sfan5
660e63dbae
Fix item duplication if player dies during interact callback (alternative) (#11662) 2021-10-25 20:30:27 +02:00
SmallJoker
ecc6f4ba25
Remove a few unused functions reported by callcatcher (#11658) 2021-10-12 20:12:20 +02:00
sfan5
6de8d77e17 Move instead of copy during content install if possible 2021-10-07 00:20:01 +02:00
sfan5
2b5075f0e2 Move archive extraction in content store to async job 2021-10-07 00:20:01 +02:00
sfan5
2d5b7b5fb4 Make fs::extractZipFile thread-safe 2021-10-07 00:20:01 +02:00
emixa-d
9fab5d594c
Add "MINETEST_MOD_PATH" environment variable (#11515)
This adds an environment variable MINETEST_MOD_PATH.
When it exists, Minetest will look there for mods in addition to ~/.minetest/mods/.
2021-10-07 00:19:41 +02:00
Wuzzy
bc71622d21
Fix crash when calling remove/kick/ban_player on start (#11672) 2021-10-05 21:53:47 +02:00
Jude Melton-Houghton
5aa95fef10
Make MetaDataRef:get return nil instead of nothing (#11666) 2021-10-05 15:38:33 +03:00
Wuzzy
4fca601e0c
Add get_server_max_lag() (#11671) 2021-10-05 15:35:55 +03:00
Wuzzy
21113ad410
Split liquid_viscosity to liquid_viscosity and move_resistance (#10810) 2021-10-01 16:21:24 +02:00
sfan5
e0529da5c8 Fix trivial typos 2021-09-19 13:54:20 +02:00
sfan5
75bf9b75ca
Make sure relevant std::stringstreams are set to binary 2021-09-11 21:06:57 +02:00
sfan5
766e885a1b
Clean up/improve some scriptapi error handling code 2021-09-10 23:16:46 +02:00
sfan5
bbfae0cc67
Dynamic_Add_Media v2 (#11550) 2021-09-09 16:51:35 +02:00
sfan5
6a1424f2b1
Async-related script cleanups 2021-08-28 12:15:12 +02:00
savilli
3f1adb49ae
Remove redundant on_dieplayer calls 2021-08-28 12:14:16 +02:00
NeroBurner
1d69a23ba4
Joystick sensitivity for player movement (#11262)
This commit deprecates the forward, backward, left, and right binary
inputs currently used for player movement in the PlayerControl struct.
In their place, it adds the movement_speed and movement_direction
values, which represents the player movement is a polar coordinate
system.

movement_speed is a scalar from 0.0 to 1.0. movement_direction is
an angle from 0 to +-Pi:

	       FWD
	        0
	        _
	 LFT   / \   RGT
	-Pi/2 |   | +Pi/2
	       \_/
	       +-Pi
	       BCK

Boolean movement bits will still be set for server telegrams and
Lua script invocations to provide full backward compatibility.
When generating these values from an analog input, a direction is
considered active when it is 22.5 degrees away from either
orthogonal axis.

Co-authored-by: Markus Koch <markus@notsyncing.net>
Co-authored-by: sfan5 <sfan5@live.de>
2021-08-27 20:24:24 +02:00
SmallJoker
0c1e9603db
HUD: Reject and warn on invalid stat types (#11548)
This comes into play on older servers which do not know the "stat" type.
Warnings are only logged once to avoid spam within globalstep callbacks
2021-08-21 20:04:04 +02:00
sfan5
e7b05beb7d
Validate staticdata and object property length limits (#11511)
Some games provide users with enough freedom to create items
with metadata longer than 64KB, preventing this from causing
issues is on them but we'll still do the minimum not to abort
the server if this happens.
2021-08-19 20:14:22 +02:00
hecks
80d12dbedb
Add a simple PNG image encoder with Lua API (#11485)
* Add a simple PNG image encoder with Lua API
Add ColorSpec to RGBA converter
Make a safety wrapper for the encoder
Create devtest examples

Co-authored-by: hecktest <>
Co-authored-by: sfan5 <sfan5@live.de>
2021-07-29 05:10:10 +02:00
sfan5
6e8aebf432
Add bold, italic and monospace font styling for HUD text elements (#11478)
Co-authored-by: Elias Fleckenstein <eliasfleckenstein@web.de>
2021-07-27 19:11:46 +02:00
hecks
1d25d1f7ad
Refactor video driver name retrieval (#11413)
Co-authored-by: hecktest <>
2021-07-11 09:50:34 +02:00
Warr1024
52128ae11e
Add API for mods to hook liquid transformation events (#11405)
Add API for mods to hook liquid transformation events

Without this API, there is no reliable way for mods to be
notified when liquid transform modifies nodes and mods are
forced to poll for changes.  This allows mods to detect
changes to flowing liquid nodes and liquid renewal using
event-driven logic.
2021-07-09 09:08:40 -04:00
SmallJoker
062fd2190e
Auth API: Error when accessed prior to ServerEnv init (#11398) 2021-06-30 20:42:26 +02:00
SmallJoker
f2fd443262
Inventory: Make addList() consistent (#11382)
Fixes list clearing for inv:set_list() using same size, since 2db6b07.
addList() now clears the list in all cases. Use setSize() to resize without clearing.
2021-06-30 20:39:38 +02:00
SmallJoker
2db6b07de1
Inventory: show error on invalid list names (#11368) 2021-06-20 17:21:50 +02:00
sfence
b10091be9b
Add min_y and max_y checks for Active Block Modifiers (ABM) (#11333)
This check can be used by ABM to reduce CPU usage.
2021-06-20 17:21:35 +02:00
sfan5
edf098db63 Drop --videomodes, fullscreen_bpp and high_precision_fpu settings
These have been pointless for a while.
2021-06-16 17:41:34 +02:00
DS
8f085e02a1
Add metatables to lua vectors (#11039)
Add backwards-compatible metatable functions for vectors.
2021-06-04 21:22:33 +02:00
SmallJoker
c9144ae5e2
Add core.compare_block_status function (#11247)
Makes it possible to check the status of the mapblock in a future-extensible way.
2021-05-30 20:24:12 +02:00
sfan5
a0047d6edc script: Replace calls to depreated luaL_openlib 2021-05-30 11:40:14 +02:00
sfan5
b56a028d6b Fix curl_timeout being ignored for Lua HTTP fetches 2021-05-17 17:12:30 +02:00
Loic Blot
225d4541ff fix: extractZipFile is not part of Client but more generic.
This solve a crash from mainmenu while extracting the zip
2021-05-06 16:01:52 +02:00
Loic Blot
de85bc9227 fix: some code tidy about includes & irr namespaces 2021-05-03 19:49:19 +02:00
Loic Blot
48d5abd5be refacto: remove get_gui_env & draw_load_screen from RenderingEngine singleton 2021-05-03 19:49:19 +02:00
Loic Blot
ccdd886e27 refacto: Hud: make driver, client, player, inventory, tsrc private & drop unused guienv
also fix c_content.h, on client it includes the src/client/hud.h instead of src/hud.h, which leads to wrong file dependency on the lua stack
2021-05-03 19:49:19 +02:00
Loic Blot
258101a910 refacto: RenderingEngine is now better hidden
* No more access to the singleton instance from everywhere (RenderingEngine::get_instance dropped)
* RenderingEngine::get_timer_time is now non static
* RenderingEngine::draw_menu_scene is now non static
* RenderingEngine::draw_scene is now non static
* RenderingEngine::{initialize,finalize} are now non static
* RenderingEngine::run is now non static
* RenderingEngine::getWindowSize now have a static helper. It was mandatory to hide the global get_instance access
2021-05-03 19:49:19 +02:00
Loic Blot
e34d28af9f refacto: rendering engine singleton removal step 1 (filesystem)
Make the RenderingEngine filesystem member non accessible from everywhere

This permits also to determine that some lua code has directly a logic to extract zip file. Move this logic inside client, it's not the lua stack role to perform a such complex operation

Found also another irrlicht <1.8 compat code to remove
2021-05-03 19:49:19 +02:00
Vincent Robinson
074e6a67de
Add minetest.colorspec_to_colorstring (#10425) 2021-04-23 21:37:24 +02:00
sfan5
623f0a8613 Isolate library tables between sandbox and insecure env 2021-04-18 16:06:42 +02:00
sfan5
0abc1e98ed
Fix server favorites not saving when client/serverlist/ doesn't exist already (#11152) 2021-04-09 22:36:10 +02:00
SmallJoker
f4118a4fde
Consistent title bar + render information in mainmenu (#10764) 2021-03-30 21:49:15 +02:00
Vitaliy
3b78a22371
Degrotate support for mesh nodes (#7840) 2021-03-30 00:25:11 +02:00
sfan5
2da1eee394
Fix broken BiomeGen abstraction (#11107) 2021-03-23 15:43:26 +01:00
SmallJoker
05719913ac
Schematic: Properly deal with before/after node resolving and document (#11011)
This fixes an out-of-bounds index access when the node resolver was already applied to the schematic (i.e. biome decoration).
Also improves the handling of the two cases: prior node resolving (m_nodenames), and after node resolving (manual lookup)
2021-03-20 13:02:15 +01:00
sfan5
bf8fb2672e
Use place_param2 client-side for item appearance & prediction (#11024) 2021-03-09 00:56:53 +01:00
sfan5
ac8ac19169
Protect mg_name and mg_flags from being set by Lua (#11010) 2021-03-04 20:38:28 +01:00
SmallJoker
3a2f55bc19 Settings: Push groups in to_table as well 2021-03-01 12:14:41 +01:00
rubenwardy
f85e9ab925
Add nametag background setting and object property (#10937) 2021-02-17 19:51:28 +00:00
rubenwardy
a8f6befd39
Fix short_description fallback order (#10943) 2021-02-17 18:53:44 +00:00
rubenwardy
3a8c37181a
Use consistent temp folder path (#10892) 2021-02-07 15:27:24 +00:00
rubenwardy
fbb9ef3818
Reduce ore noise_parms error to deprecation warning (#10921)
Fixes #10914
2021-02-06 13:46:45 +01:00
sfan5
c834d2ab25 Drop wide/narrow conversion functions
The only valid usecase for these is interfacing with OS APIs
that want a locale/OS-specific multibyte encoding.
But they weren't used for that anywhere, instead UTF-8 is pretty
much assumed when it comes to that.
Since these are only a potential source of bugs and do not fulfil
their purpose at all, drop them entirely.
2021-02-02 20:46:08 +01:00
sfan5
40ad976753 Revise dynamic_add_media API to better accomodate future changes 2021-02-01 23:00:13 +01:00
sfan5
a01a02f7a1 Preserve immortal group for players when damage is disabled 2021-01-31 20:38:12 +01:00
sfan5
112a6adb10
Cache client IP in RemoteClient so it can always be retrieved (#10887)
specifically: after the peer has already disappeared
2021-01-31 20:36:47 +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
sfan5
edd8c3c664 Drop never documented 'alpha' property from nodedef
Includes minimal support code for practical reasons.
We'll need it for a slightly different purpose next commit.
2021-01-29 17:34:41 +01:00
SmallJoker
2760371d8e Settings: Purge getDefault, clean FontEngine 2021-01-29 17:32:35 +01:00
SmallJoker
37a05ec8d6 Settings: Proper priority hierarchy
Remove old defaults system
Introduce priority-based fallback list
Use new functions for map_meta special functions
Change groups to use end tags

Unittest changes:
 * Adapt unittest to the new code
 * Compare Settings objects
2021-01-29 17:32:35 +01:00
rubenwardy
4c76239818
Remove dead code (#10845) 2021-01-22 15:09:26 +00:00
rubenwardy
67aa75d444
Use JSON for favorites, move server list code to Lua (#10085)
Co-authored-by: sfan5 <sfan5@live.de>
2021-01-22 15:08:57 +00:00
rubenwardy
4fcd000e20
MgOre: Fix invalid field polymorphism (#10846) 2021-01-21 19:08:06 +00:00
Zughy
45ccfe26fb
Removed some obsolete code (#10562)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2021-01-21 18:17:09 +00:00
Zughy
ea5d6312c1
ObjectRef: fix some v3f checks (#10602) 2021-01-21 18:37:38 +01:00
JDiaz
08ee9794fb
Implement on_rightclickplayer callback (#10775)
Co-authored-by: rubenwardy <rw@rubenwardy.com>
2021-01-11 18:03:31 +01:00
rubenwardy
edd0836011
ContentDB: Add overwrite dialog when content is already installed (#10768) 2021-01-04 15:18:31 +00:00
hecks
dd5a732fa9
Add on_deactivate callback for luaentities (#10723) 2021-01-02 15:14:29 +01:00
Elias Fleckenstein
9250b5205a
Add minetest.get_objects_in_area (#10668) 2020-12-29 16:50:09 +01:00
Lars Mueller
8f72d4b294 Fix minetest.is_nan 2020-12-24 22:07:04 +01:00
sfan5
74762470b2 Fix some minor code issues all over the place 2020-12-24 13:44:54 +01:00
rubenwardy
2c3593b51e Fix unsafe cast in l_object 2020-12-23 22:24:58 +00:00
rubenwardy
664f5ce960
Add open user data button to main menu (#10579) 2020-12-19 13:27:15 +00:00
SmallJoker
fca4db4184
ObjectRef: Re-add legacy code for set_physics_override (#10585)
These arguments are used at least by MTG beds and homedecor_common. A deprecation warning is shown to safely remove it in a future release.
2020-11-10 21:02:53 +01:00
Zughy
72b93ec0d7
Fix ObjectRef errors due to lua_isnil() (#10564)
Treat 'none' values as 'nil'
2020-11-04 21:43:18 +01:00
SmallJoker
9c9344ceb3 Fix incorrect deprecation hints
"good" and "bad" were swapped in the process, resulting in wrong deprecation messages
2020-11-01 12:52:14 +01:00
rubenwardy
89dd05fdf3
Fix segfault in deprecation logging due to tail call, log by default (#10174) 2020-10-31 18:19:23 +00:00
luk3yx
61a196378f
Fix CSMs on arm64 (#10553) 2020-10-25 18:01:39 +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
Zughy
7499ebe46a
Fix float argument check in minetest.set_timeofday() (#10483)
Co-authored-by: Zughy <4279489-marco_a@users.noreply.gitlab.com>
2020-10-13 20:28:53 +01: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
JosiahWI
11f3deb9c4
Pass ContentFeatures as reference to read_content_features (#10464) 2020-10-13 16:36:01 +01:00
Zughy
272b72361a
Add missing type check to InvRef:set_lists() (#10476) 2020-10-11 13:36:13 +02:00
DS
f3ae45b2b2
Add a short_description to be used by mods (#8980) 2020-10-09 19:11:21 +01: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
SmallJoker
f46509d5e2
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.
2020-10-05 09:07:33 +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
rubenwardy
9ec75d7765
Clean up server-side translations, remove global variable (#10075) 2020-09-16 14:51:11 +01:00
karamel59
d052593c7a
Lua API: Register missing get_texture_mod function (#10338) 2020-08-27 21:47:38 +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
Lars Müller
1c38027c3a
Fix precision not working in hud_change (#10186) 2020-08-12 11:51:50 +02:00
Lejo
715a123a33
Add PUT and DELETE request + specific method value to HTTP API (#9909) 2020-07-29 23:16:21 +02:00
Hugues Ross
3ce03d1c2a
Sanitize world directory names on create. Keep original name separate (#9432)
Blacklisted characters are replaced by '_' in the path. The display name is stored in world.mt, and duplicate file names are resolved by adding an incrementing suffix (_1, _2, _3, etc).
2020-07-28 19:16:57 +02:00
Lars Müller
82731d0d3d
Revert "Auto delete MetaData when = 0 (#8770)" (#10183)
This reverts commit 808eb4c5714da5ac36f4a70653d6b3805060828c.
2020-07-16 19:11:24 +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
sfan5
70df3d54f3 Quick workaround for crashing destructor on Mingw32
closes #10137
2020-07-09 22:01:46 +02:00
rubenwardy
4cb18d4874
Fix HTTP API not being available in async mainmenu (#10086) 2020-06-22 14:40:04 +01:00
rubenwardy
0f1f8e4a0f
Add warning when disabling secure.enable_security (#9943) 2020-06-20 13:21:38 +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
Paul Ouellette
b16f841756
LuaItemStack: Add __tostring metamethod (#8785)
* LuaItemStack: Add __tostring metamethod

* Clean up LuaItemStack::checkobject
2020-06-09 19:37:25 +02:00
Paul Ouellette
09f9e465e7 Fix Lua panic when error() message is not a string 2020-06-07 18:14:40 +02:00
rubenwardy
60bab8b2d7
Add HTTP API to main menu (#9998) 2020-06-06 17:17:08 +01:00
SmallJoker
42a9b45c21
Lua API: Log incorrect parameter types as error (#9954)
Incorrect parameter types are logged as errors, taking coercion into account.
This is a workaround to ensure mod compatibility.
Duplicate warnings are ignored per server instance.
2020-06-01 19:02:15 +02:00
sfan5
471e567657 Value copy / allocation optimizations mostly in server, SAO and serialize code 2020-05-27 21:58:40 +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
Awkor
037422fdba
Modernize include guards and add missing ones (#9898) 2020-05-23 13:23:05 +02:00
Lejo1
e79bc40c0a Check for valid base64 before decoding (#9904) 2020-05-22 14:26:22 +02:00
sfan5
1357ea1da2
Cleanup of particle & particlespawner structures and code (#9893) 2020-05-22 13:23:25 +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
sfan5
732c8008f4 CSM: Fix crashing minetest.get_item_def()
fixes #9884
2020-05-20 20:15:09 +02: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
rubenwardy
a9c3a42323
Add core.open_url() to main menu API (#8592) 2020-05-17 19:09:10 +01:00
sfan5
36d35f2fe3
CSM: Bugfixes to camera:get_pos() and camera:get_fov()
closes #9857
2020-05-14 21:16:45 +02: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
Loïc Blot
454dbf83a9
Server class code cleanups (#9769)
* Server::overrideDayNightRatio doesn't require to return bool
There is no sense to sending null player, the caller should send a valid object

* Server::init: make private & cleanup
This function is always called before start() and loads some variables which can be loaded in constructor directly.
Make it private and call it directly in start

* Split Server inventory responsibility to a dedicated object

This splits permit to found various historical issues:
* duplicate lookups on player connection
* sending inventory to non related player when a player connects
* non friendly lookups on detached inventories ownership

This reduce the detached inventory complexity and also increased the
lookup performance in a quite interesting way for servers with thousands
of inventories.
2020-05-07 22:38:41 +02:00