Commit Graph

937 Commits (master)

Author SHA1 Message Date
raymoo a637107a4e Allow overriding tool capabilities through itemstack metadata
This makes it possible to modify the tool capabilities of individual
itemstacks by calling a method on itemstack metadata references.
2017-10-29 11:57:38 +00:00
raymoo a5d5728f24 Fix default item callbacks to work with nil users (#5819)
* Fix default item callbacks to work with nil users

* item.lua: Handle node drops for invalid players

The if-condition for the dropping loop is the same as `inv`, which means that the 2nd possible definition of `give_item` is never used.
Remove redundant `local _, dropped_item`
2017-10-28 10:30:50 +02:00
Muhammad Rifqi Priyo Susanto 63c26413b6 Lua_api.txt: Revert changes to NoiseParams format example 2017-10-23 05:30:45 +01:00
Muhammad Rifqi Priyo Susanto a1e1a19ac3 Improvements/fixes for noise parameter input in advanced settings
Formspec input for each individual noise parameter and flag.
Allow noise flags to be set in advanced settings, previously only settable
in minetest.conf.

Standardise 'group format' for noise parameters set in minetest.conf, as
only these support noise flags. However the older 'single line' format is
still accepted to support existing minetest.conf files.
Therefore auto-generate minetest.conf.example with noise parameters in
'group format'.

Setting 'type' in settingtypes.txt is now either 'noise_params_2D' or
'noise_params_3D', the dimension number is displayed in the advanced
settings edit page.
2017-10-23 01:28:13 +01:00
Auke Kok c60abb2aec Correct `prot_vers` in lua_api.txt.
We should avoid providing incorrect struct members in documentation
since people will be coding based on them.
2017-10-19 21:39:45 -07:00
Vitaliy 75320e7e88 Real global textures (#6105)
* Real global textures

* Add world-aligned textures
* Update minimal to support world-aligned tiles
* Update minimal
2017-10-15 09:34:14 +02:00
paramat 9a41a3d0f1 Simple decorations: Make 'place_offset_y' usable with simple decorations
Necessary for placing the base cube of 'plantlike_rooted' drawtype in the
seabed instead of on it.
Useful for placing decorations sunk into, or buried in, the ground.
2017-10-10 19:57:28 +01:00
paramat 0c9ca27ffc Simple decorations: Add 'param2_max' parameter for random param2
If 'param2_max' is not used, parameter 'param2' works as before for
compatibility.
If 'param2_max' is used, 'param2' and 'param2_max' become the lower
and upper bounds of a per-decoration random param2.
2017-10-09 18:27:17 +01:00
adrido e6e5fa3bf8
Formspec: textarea with scrollbar improvements
Increase scrollrate depending on fontsize

Scroll on mousewheel

Allow scrolling and marking text on non writable textareas

Update lua api about readonly mode

Show scrollbar if text overflows
2017-10-09 08:11:03 +02:00
adelcoding1 9b8fa99fe3
FormSpec : Add an auto vertical scrollbar to the textarea 2017-10-09 08:11:00 +02:00
James Alexander Stevenson 4337b48962 Move register_on_modchannel_signal() (#6497)
Moved from lua_api.txt to client_lua_api.md.
2017-10-05 16:14:10 +02:00
Vincent Glize 4e19791cde [CSM] Add callback on open inventory (#5793) 2017-10-02 22:09:49 +02:00
paramat e2afcf85ce Stratum ore: Allow use with no noise for simple horizontal strata
If either of the 2 noise parameters are omitted the ore will occur from y_min
to y_max in a simple horizontal stratum. As this does not compute noise
performance improves, and is ideal for placing many layers.

Clean up some nearby ore documentation.
2017-10-01 22:31:44 +01:00
Hybrid Dog 7e488b926b Lua_api.txt: Clarify arguments of functions, plus some cleanup 2017-09-28 20:32:16 +01:00
raymoo 5258f3b857 Document orientation parameter of set_attach (#6473) 2017-09-28 18:40:47 +02:00
orwell96 08846cd05c Add static_save property to luaentites to not save them statically. (#5112)
* Add no_static_save property to luaentites to not save them statically.
This allows for temporary objects that would get deleted anyway as soon as they are loaded again without the static saving overhead.

* Use positive meaning for static_save object property

* Invert meaning also for the LUA parameter
Note: getboolfield() does not change &result when field does not exist, so it defaults to the default value in the header file, which is 'true'.

* Extend push_object_properties()
2017-09-28 17:11:51 +02:00
Loïc Blot 6f1c907204 Implement mod communication channels (#6351)
Implement network communication for channels

* Implement ModChannel manager server side to route incoming messages from clients to other clients
* Add signal handler switch on client & ModChannelMgr on client to handle channels
* Add Lua API bindings + client packet sending + unittests
* Implement server message sending
* Add callback from received message handler to Lua API using registration method
2017-09-26 00:11:20 +02:00
paramat 6df312a608 Can_zoom player object property: Add missing documentation 2017-09-25 19:33:31 +01:00
paramat a016b64838 Rooted plantlike drawtype: Add remaining documentation
Plus a small clarification of 'glasslike framed' documentation.
2017-09-19 09:35:28 +01:00
paramat d8f20d029a Leveled nodebox: Change levels from 1/63rds to 1/64ths
Add missing documentation of leveled nodebox to lua_api.txt, plus
a little cleaning up nearby.
2017-09-18 11:05:39 +01:00
paramat 27144b4716 Biome API: Revert biomes, decos, ores being relative to water level
Feature is unnecessary and would greatly complicate future development,
it would also make 'get biome at pos' extremely complex.
Mgv7: Revert option to repeat surface biomes in floatlands, which
depended on the above.
2017-09-17 05:31:48 +01:00
paramat a1389c3865 Generate biomes: Recalculate biome at biome lower limit
Prevents biome nodes passing below the defined y_min of that biome.
2017-09-16 05:14:04 +01:00
SmallJoker edbc533414 Customizeable max breath for players (#6411)
* Customizeable maximal breath for players
2017-09-15 12:18:47 +02:00
Rob Blanckaert a9d43a0471 Object properties: Add 'glow', disables light's effect if negative
The 'glow' value is added to the ambient light value.
Negative 'glow' disables light's effect on object colour, for faking
self-lighting, UI-style entities, or programmatic colouring in mods.
2017-09-14 04:06:05 +01:00
sfan5 6fa2f6b4aa Fix core.wrap_text and make its behaviour consistent with the docs
Code based on initial implementation by @dsohler.
2017-09-12 19:33:00 +02:00
Auke Kok 5b3fbf9cf7 Implement client node dig prediction
Dig prediction allows clients to remove dug nodes without
waiting for server acknowledgement.
This patch allows mods to override dig prediction,
it can either be turned off or a different "prediction node"
can be selected.
2017-09-11 20:54:20 +02:00
red-001 d10cccee31 Allow the join/leave message to be overridden by mods. 2017-09-11 20:54:07 +02:00
paramat 51002b1629 Schematic decorations: Add 'place_offset_y' placement parameter
For precise control of schematic vertical position relative to the
'place_on' node.
Avoids workarounds that add empty nodes to a schematic and therefore
reduce performance.

Also remove long-unused decoration cutoff code.
2017-09-10 01:31:30 +01:00
Loïc Blot 40dd03e328 Implement minetest.register_can_bypass_userlimit (#6369)
* Implement minetest.register_on_userlimit_check

This new callback permits to bypass the max_users parameter with new mods condition, based on player name or IP
Only one mod needs to permit it.

Move core part for builtin privileges checks to builtin
2017-09-04 22:08:59 +02:00
Paramat 9f6d90aa81 Ores: Add stratum ore (#6352)
Creates a single undulating ore stratum that is continuous across mapchunk
borders and horizontally spans the world.
Due to being continuous is ideal for creating bands of alternative stone
type running through cliffs and mountains, or underground layers.

Add missing documentation of 'ore_param2' parameter.
2017-09-03 22:32:21 +02:00
Rui c0dac4d928 Remove nodeupdate completely (#6358) 2017-09-01 13:40:09 +02:00
sapier bf403b923a Fix animation frame_speed and blend loosing precision due to incorrec… (#6357)
* Fix animation frame_speed and blend loosing precision due to incorrect data type
Add lua function set_animation_frame_speed to update the frame speed without resetting the animation to start
2017-09-01 11:15:12 +02:00
Ben Deutsch 43f9e948a1 Documentation for 'slippery' node group (#6345) 2017-08-29 21:48:43 +02:00
rubenwardy 72c09f524b Fix mistake when calling on_priv_grant/revoke, and document them (#6341) 2017-08-29 07:57:56 +02:00
zeuner 1f207a3ddb Lua API: Add function to deregister single biomes (#5445) 2017-08-27 18:39:47 +02:00
you e09c7fceaa core.get_objects_inside_radius: Omit removed objects (#6318)
Fixes #6294
2017-08-27 18:38:50 +02:00
Nathanaël Courant 5a6618cc57 Add '@n' escape sequences and some documentation on translated strings. 2017-08-26 09:43:08 +02:00
rubenwardy 096ea031de Add on_grant and on_revoke callbacks (#4713)
* Add register_on_priv_grant/revoke, and on_grant/revoke to privs. Call from /grant and /revoke

* Call on_grant and on_revoke callbacks from set_privs
2017-08-26 08:17:05 +02:00
Dániel Juhász f6a33a1a7a Overlays for wield and inventory images (#6107)
* Overlays for wield and inventory images
2017-08-25 13:20:53 +02:00
Ekdohibs b24e6433df Add clientside translations. 2017-08-24 17:54:10 +02:00
stujones11 ac4884c3d6 Make entity selection and collision boxes independently settable (#6218)
* Make entity selection and collision boxes independently settable
2017-08-24 10:01:16 +02:00
SmallJoker f7d50a8078 Respect object property hp_max field for players (#6287)
* Respect object property hp_max field for players
This allows modders to configure the maximal HP per player

* Statbars: Downscale bar to full 20 HP when exceeding this value
Add default max HP for players and breath constants to builtin
Document the constants

* Rename PLAYER_MAX_HP -> PLAYER_MAX_HP_DEFAULT
2017-08-23 22:32:10 +02:00
paramat 7657fe7a50 Minimap: Add new HUD flag for minimap radar mode
Flag default is true to not change default behaviour.
The existing minimap HUD flag remains the master control for minimap.
2017-08-20 23:58:15 +01:00
Loïc Blot c99dcbaca9 New version scheme (#6292)
* Version changes: current dev version is now 0.5.0

* This change permit to have multi branches with various versions
* Dev version is 0.5.0-dev and next release will be 0.5.0
2017-08-20 17:20:11 +02:00
Dániel Juhász 71b02d626f Make dropped items colorable 2017-08-14 12:52:13 +01:00
Wuzzy 2ea26e655d Add slippery group for nodes (players/items slide) 2017-08-13 21:39:08 +01:00
SmallJoker 4381fe0a0a Trigger on_rightclick regardless on the formspec meta field
Document behaviour for older clients.
2017-08-13 21:37:30 +01:00
Loïc Blot 550c0404a8 Add LuaEntity on_death callback (#6177)
Add LuaEntity on_death callback

This fixes #5474
2017-07-27 11:32:35 +02:00
paramat 0c99da4255 Create_schematic documentation: Update for per-node force-place
The probability list has to also encode per-node force-place.
2017-07-26 02:41:41 +01:00
Ben Deutsch c50a57c070 Clouds API: change speed from 'y' to 'z', ColorSpecs in Lua docs (#6164) 2017-07-24 18:04:00 +02:00
Loïc Blot 79f19b8369 [CSM] Add flavour limits controlled by server (#5930)
* [CSM] Add flavour limits controlled by server

Server send flavour limits to client permitting to disable or limit some Lua calls

* Add limits for reading nodedefs and itemdefs

* flavour: Add lookup node limits

* Merge get_node_or_nil into get_node.

Sending fake node doesn't make sense in CSM, just return nil if node is not available for any reason

* Add node range customization when noderange flavour is enabled (default 8 nodes)

* Limit nodes range & disable chat message sending by default

* Bump protocol version
2017-07-18 21:39:55 +02:00
cx384 d60434c7b1 Add information about the button height 2017-07-16 13:10:34 +02:00
Loic Blot 84aa845911
Revert "CSM: Revert "[CSM] Add send_chat_message and run_server_chatcommand""
This reverts commit bdac12761c.
2017-07-15 09:28:10 +02:00
rubenwardy bdac12761c CSM: Revert "[CSM] Add send_chat_message and run_server_chatcommand"
Original PR: #5747.
This reverts commit 39f4a2f607.
2017-07-15 01:35:18 +01:00
Elijah Duffy dc3ca09e0e Remove remaining modstore code (#6120) 2017-07-14 20:37:58 +02:00
paramat 8299e4b67e Biomes/decorations/ores: Make relative to 'water_level' setting
Add 'biome_zero_level' argument to 'generateBiomes()', 'deco_zero_level'
argument to 'placeAllDecos()' and 'ore_zero_level' to 'placeAllOres()'
to allow mapgens to vertically shift the registered biomes, decorations
and ores per-mapchunk.
Will also allow many realm possibilities in future mapgens.
2017-07-11 01:14:24 +01:00
number Zero ef285b2815 Add 'plantlike_rooted' drawtype
Useful for underwater plants.
Node consists of a base cube plus a plantlike extension that can pass through
liquid nodes above without creating air bubbles or interfering with liquid flow.
Uses paramtype2 'leveled', param2 defines height of plantlike extension.
2017-07-11 01:02:22 +01:00
Dániel Juhász 3caad3f3c9 Expose getPointedThing to Lua
This commit introduces Raycast, a Lua user object, which can be
used to perform a raycast on the map. The ray is continuable, so one can
also get hidden nodes (for example to see trough glass).
2017-07-07 22:28:23 +01:00
paramat 936d67dad4 Ores: Make 'absheight' flag non-functional
The 'absheight' flag was added years ago for the floatlands of 'indev'
mapgen (now deleted). The feature mirrored all ore placement around y = 0
to place ores in floatlands.

In MTG we now use dedicated ore registrations for floatlands.

The feature is crude, inflexible, problematic and very rarely used, it
also makes ore vertical range code more complex.
Minetest 0.5 is a good chance to remove the feature.

The flag itself remains to not break flag values.
2017-06-26 04:38:36 +01:00
Loic Blot 1237206d4b
Revert "Ores: Make 'absheight' flag non-functional"
This reverts commit 90ed6fc732.
2017-06-25 23:08:31 +02:00
paramat 90ed6fc732 Ores: Make 'absheight' flag non-functional
The 'absheight' flag was added years ago for the floatlands of 'indev'
mapgen (now deleted). The feature mirrored all ore placement around y = 0
to place ores in floatlands.

In MTG we now use dedicated ore registrations for floatlands.

The feature is crude, inflexible, problematic and very rarely used, it
also makes ore vertical range code more complex.
Minetest 0.5 is a good chance to remove the feature.

The flag itself remains to not break flag values.
2017-06-25 05:01:42 +01:00
Dániel Juhász 5a41a98ff6 Helper methods for hardware colorization (#5870) 2017-06-24 20:15:09 +02:00
Gael-de-Sailly bc53c82bcf Add minetest.rgba function that returns ColorString from RGBA or RGB values 2017-06-22 03:11:50 +01:00
Dániel Juhász 0fcaf9fb1b Automatic item and node colorization (#5640)
* Automatic item and node colorization

Now nodes with a palette yield colored item stacks, and colored items
place colored nodes by default. The client predicts the colorization.

* Backwards compatibility

* Use nil

* Style fixes

* Fix code style

* Document changes
2017-06-20 11:19:56 +02:00
SmallJoker 6eb03c135f find_nodes_in_area: Extend maximal count to U32_MAX (#5277)
Extend documentation, limit area volume
Remove u16 count limitation

* Prevent integer overflow, replace minp/maxp with pos1/pos2
2017-06-19 16:30:26 +02:00
Rui ff73c7a5da Sound: Add pitch option (#5960)
* Sound: Add pitch option
2017-06-11 13:58:26 +02:00
DS 07be63b287 fix an example in lua_api (#5604) 2017-06-10 13:49:28 +02:00
DS 44495ea719 CSM: Fix documentation error for register_on_*_chat_messages (#5917) 2017-06-09 15:48:04 +02:00
red-001 c91a8c7061 [CSM] Add function to get player privileges (#5933)
* [CSM] Add function to get player privileges + move related help functions to common

* Added @Zeno- const
2017-06-07 09:09:06 +02:00
Loic Blot 47f5e7fd0f
Fix bump_version.sh & client_lua_api.md
This modification was forgotten at release
2017-06-06 19:56:15 +02:00
red-001 33b513f76c Fix typos/mistakes in the documentation for colour related functions. (#5936) 2017-06-06 17:02:44 +02:00
Elijah Duffy fee5171298 Main Menu: Add get_clientmodpath API (#5912)
Add `core.get_clientmodpath` to main menu API (also possible in async calls).
2017-06-06 14:34:31 +02:00
ShadowNinja 80dc961d24 Bump version to 0.4.16 2017-06-03 14:42:10 -04:00
ShadowNinja e4d3639d40 Update remove_player documentation
This function only removes player meta data,
not player authentication data.
2017-06-03 14:39:49 -04:00
Wuzzy e91ffa0c91 Mention data type for get/set_attribute in docs (#5884) 2017-06-03 08:20:22 +02:00
Wuzzy 1b83b0acfd Lua_api.txt: Various edits and Markdown syntax improvements
Add minor bits of missing Lua API documentation.
Remove L-system lighting bug warning.
Clarify 2 lines in node timer documentation.
Fix many Markdown syntax errors in lua_api.txt.
2017-06-02 18:01:12 +01:00
Dániel Juhász 30c51a1115 Document hardware coloring and soft node overlays (#5876) 2017-06-02 15:57:59 +02:00
Pierre-Adrien Langrognet 39f4a2f607 [CSM] Add send_chat_message and run_server_chatcommand API functions (#5747)
* [CSM] Add send_chat_message and run_server_chatcommand API functions

* Add client-side chat message rate limiting

* Limit out chat queue size

* [CSM] Add minetest.clear_out_chat_queue API function and .clear_chat_queue chatcommand

* Last fixes/cleanups before merge
2017-05-21 23:06:51 +02:00
bigfoot547 dfa0c15ce0 [CSM] Add function to get the definition of items (#5732)
Add node def and item def documentation.

Please be ready for merge!
2017-05-21 14:40:55 +02:00
red-001 772944daf6 Fix CSM crash (#5779)
Caused by dc5bc6c and them made worse by 5ebf8f9
2017-05-20 16:45:49 +02:00
Loïc Blot e25a38e3fb When minimap is disabled in configuration, really disable it (#5771)
* When minimap is disabled in configuration, really disable it
2017-05-19 07:25:27 +02:00
SmallJoker 0120fe16a7 CSM: Document forgotten functions 2017-05-16 21:57:26 +01:00
rubenwardy f286c54908 Replace inconsistent mentions of core.* with minetest.* (#5749) 2017-05-12 11:27:58 +02:00
sfan5 071e114ffa Private nodemeta (#5702)
* Private node metadata that isn't sent to the client
2017-05-10 15:29:21 +02:00
paramat da88a18676 Revert custom player collision box and step height commits
These caused inability to pass through 2 node high spaces or step up onto slabs
or steps when a new client connected to an older server.
2017-05-09 03:52:28 +01:00
Loïc Blot c1b3ed4180 Player attrs: permits to remove an attribute by setting value to nil (#5716)
* Player attrs: permits to remove an attribute by setting value to nil

When doing player:set_attribute("attr", nil) remove attribute

Also remove a useless check on C++ API part (already done by checkplayer)

Fix #5709
2017-05-07 12:13:15 +02:00
paramat 2d5bd7f414 Player properties: Set correct default collisionbox
Recent commit b6f4a9c7e1 removed a hardcoded
player collisionbox which resulted on falling back to an incorrect default.
This stopped players walking through 2-node high spaces and made the player
slightly wider.

Improve docs for custom player collisionbox feature and reformat nearby lines.
2017-05-07 06:10:13 +01:00
TeTpaAka b6f4a9c7e1 Make the player collisionbox settable 2017-05-06 15:41:05 -04:00
ShadowNinja 43d1f375d1 Use a settings object for the main settings
This unifies the settings APIs.

This also unifies the sync and async registration APIs, since the async
registration API did not support adding non-functions to the API table.
2017-05-06 15:33:19 -04:00
red-001 5ebf8f9450 [CSM] add `on_item_use` (#5544) 2017-05-06 21:12:44 +02:00
bigfoot547 de028fc056 [CSM] Add camera API (#5609)
* [CSM] Add camera API
roper rebase & squash

* Address nerzhul's review
2017-05-05 22:07:36 +02:00
red-001 d6cf5450a8 Add option to also check the center to `find_node_near` (#5255)
* Add option to also check the center to `find_node_near`
2017-05-04 22:52:58 +02:00
red-001 ae0d8f74d7 Add function to get server info. 2017-05-04 04:25:45 +01:00
paramat ad9fcf859e Set sky API: Add bool for clouds in front of custom skybox
Default true.
Add 'm_clouds_enabled' bool to sky.h, set from new bool in 'set sky' API.
Make 'getCloudsVisible()' depend on 'm_clouds_enabled' instead of
'm_visible' (whether normal sky is visible).
2017-05-02 20:42:35 -07:00
SmallJoker f9fdb48dc8 Sneak: Improve and fix various things
Remove useless `got_teleported`.
Fix jitter when walking against the sneak limits.
Fix damage evading on sneak ladders.
2017-05-03 03:16:20 +01:00
Brandon bd921a7916 Sound API: Add fading sounds 2017-05-03 03:12:45 +01:00
Ben Deutsch f1d7a26b7c Add clouds API 2017-04-30 00:06:13 +01:00
Vincent Glize dc5bc6cac7 [CSM] Add event on_place_node API lua (#5548)
* [CSM] Add event on_place_node API lua
2017-04-29 12:08:16 +02:00
Vincent Glize 19960e26c6 [CSM] add screenshot api lua (#5674)
* [CSM] add screenshot api lua
2017-04-29 09:16:06 +02:00
you 7f4cdbcbe9 Fix click-digging torches (#5652)
Torches are dug instantly again.
When the digging time is 0, a delay of 0.15 seconds is added between digging nodes. If the left mouse button is released, the delay is set to 0, thus click-digging.
2017-04-28 20:12:28 +02:00
Auke Kok e21a1ab3bd Allow mesh and nodeboxes to wave like plants or leaves. (#3497)
We introduce a new value for "waving" - 2:

0 - waving disabled
1 - wave like a plant
2 - wave like a leave

Plantlike nodes will only allow waving = 1, but for leaves we will
permit both 1 and 2 since current minetest_game sets it to 1 for
all leaves. This makes it somewhat backwards compatible.

For mesh and nodebox, values 1 and 2 are both valid, and the node
can wave in both fashions as desired.

I've tested this with the crops:corn plants, which are mesh nodes,
and the results are really good. The code change is trivial as
well, so I've opted to document the waving parameter in lua_api.txt
because it was missing from there.

Nodeboxes likely will not wave properly unless waving = 2. However
it's possible that waving=1 may be desired by some mod developers
for geometries I have not tried, so the code will not prohibit
either value for mesh and nodebox drawtypes.

Add lua_api.txt documentation for this feature and document both
the existing functionality and the expansion to mesh and nodebox
drawtypes.
2017-04-28 20:11:43 +02:00
red-001 1ef9eee311 Allow scripts to get the client protocol version in non-debug builds. (#5649) 2017-04-27 11:49:44 +02:00
Bluebird d130e1fdc0 Fix incorrect formspec-tooltip doc, add detail in 'floodable' & 'on_flood' docs (#5660)
* Fix incorrect formspec tooltip documentation

* Improve `floodable` and `on_flood` documentation.

The original documentation did not specify that liquids should not themselves be floodable. This is probably something that should be mentioned.
2017-04-27 11:49:07 +02:00
Bluebird 70ceeb80a1 Tiny documentation fix. (#5659)
There are plenty of lines longer than 80 characters, and spliting the function declaration across two lines can be momentarily confusing.
2017-04-26 07:24:15 +02:00
Loïc Blot 29ab20c272 Player data to Database (#5475)
* Player data to Database

Add player data into databases (SQLite3 & PG only)

PostgreSQL & SQLite: better POO Design for databases

Add --migrate-players argument to server + deprecation warning

* Remove players directory if empty
2017-04-23 14:35:08 +02:00
paramat 58c083f305 Sneak glitch: Set default to false
The 'sneak glitch' physics override now controls whether a player can
use the new move code replications of the old sneak side-effects:
sneak ladders and 2 node sneak jump. This completes our intention to
replicate the old sneak side-effects in new code and provide them as
an option that is disabled by default.
2017-04-22 01:23:57 +01:00
Auke Kok cca58fe0fd Add on_flood() callback.
This callback is called if a liquid definitely floods a non-air
node on the map. The callback arguments are (pos, oldnode, newnode)
and can return a `bool` value indicating whether flooding the
node should be cancelled (`return true` will prevent the node
from flooding).

Documentation is added, the callback function was tested with a
modified minetest_game.

Note that `return true` will likely cause the node's `on_flood()`
callback to be called every second until the node gets removed,
so care must be taken to prevent many callbacks from using this
return value. The current default liquid update interval is 1.0
seconds, which isn't unmanageable.

The larger aim of this patch is to remove the lava cooling ABM,
which is a significant cost to idle servers that have lava on their
map. This callback will be much more efficient.
2017-04-22 01:23:51 +01:00
Dániel Juhász 1ffb180868 Soft node overlay (#5186)
This commit adds node overlays, which are tiles that are drawn on top of
other tiles.
2017-04-21 23:34:59 +10:00
Dániel Juhász 57e5aa6628 Light update for map blocks
This is not really different from the light update of a voxel
manipulator. This update does not assume that the lighting was correct
before, therefore it is useful for correction.

Also expose this function to the Lua API for light correction, and
allow voxel manipulators not to update the light.
2017-04-20 05:39:14 +02:00
Hybrid Dog 858c722974 Tools: Fix tool digging speed limit 2017-04-19 02:01:15 +01:00
paramat f6da7b3fda Sneak: Add option for old move code
Temporary option for the old move code for specific old sneak behaviour.
Enabled by setting the added 'new move' physics override to false.
By default 'new move' is true.
2017-04-17 10:13:05 +01:00
Loïc Blot 34d32ce55a Implement delayed server shutdown with cancelation (#4664) 2017-04-15 23:19:18 +02:00
bigfoot547 e80a83d1cb [CSM] Add function to set minimap shape (#5569)
* [CSM] Add function to set minimap shape

Also deprecates `toggle_shape`.

* Oh fish, I messed that one up!

* Fix Style

* Sorry, I missed something

I still had the `luamethod` call in there!

* Add getters

* Remove extra line

* Remove useless variable

Please review again @nerzhul . Thanks!

* Satisfy nerzhul
2017-04-14 09:04:41 +02:00
Dániel Juhász 021e667511 Add documentation for map block format 27 (#5576) 2017-04-13 10:19:46 +02:00
Vincent Glize 8bdf9a44c6 [CSM] Fix localplayer documentation (#5557) 2017-04-12 23:05:01 +02:00
Vincent Glize 8ad3dad137 LocalPlayer api lua 2017-04-08 22:04:30 -07:00
Dániel Juhász 58d83a7bb2 Hardware coloring for itemstacks
Adds the possibility to colorize item stacks based on their metadata.

In the item/node definition you can specify palette (an image file)
and color (fallback color if the item has no palette or metadata).
Then you can add palette_index to the metadata.

Dropped itemstacks with different colors do not merge.
2017-04-08 18:39:15 -07:00
raymoo fb4c730708 Document that write_json will error on unserializable types. (#5539)
Previously it was erroneously documented that it would save them as null.
2017-04-08 10:42:59 +02:00
Vincent Glize f73534640a [CSM] Add event on_connect player API lua (#5540)
* Add event on_connect player API lua
2017-04-08 08:20:30 +02:00
red-001 88b9b9652a [CSM] Add function to get the server protocol version. (#5529) 2017-04-06 22:50:45 +02:00
red-001 4ee6be856d [CSM] Add support for positional audio. (#5516)
Fixes parts of #5389.
2017-04-06 08:14:31 +02:00
red-001 000ec26001 [CSM] Add local node meta reference. (#5508) 2017-04-04 07:41:37 +02:00
MarkuBu 26f4a5c2d1 First commit for fine pointed (#5485) 2017-04-01 16:50:53 +02:00
red-001 63ac62ec8a [CSM] Add function and chat command to disconnect from server. (#5487) 2017-04-01 13:40:56 +02:00
paramat ea549bbae3 Paramtype2: Add missing type CPT2_GLASSLIKE_LIQUID_LEVEL
Add the missing paramtype2 for param2 controlling the liquid level
inside the glasslike_framed drawtype.
Add missing documentation of the feature to lua_api.txt.
Update and improve comments for drawtype enumerations in nodedef.h.
2017-03-30 04:52:54 +01:00
Diego Martínez 81c3dc32a8 Add functions to strip color information. (#5472) 2017-03-28 21:55:39 +02:00
red-001 7c85405d96 [CSM] Fix errors in and improve the CSM documentation. (#5467) 2017-03-28 08:26:54 +02:00
bigfoot547 9efc5da0fb [CSM] Add function to get player names in range (#5435)
* [CSM] Add function to get currently connected player names
2017-03-22 21:13:03 +01:00
Paramat c4b98deb61 Firelike drawtype: Add missing docs for visual_scale in lua_api.txt (#5434) 2017-03-20 22:22:16 +01:00
red-001 d31750cb93 Give CSM access to use `core.colorize()` (#5113) 2017-03-17 19:20:13 +01:00
Loïc Blot 40ce538aad [CSM] Add minimap API modifiers (#5399)
* Rename Mapper (too generic) to Minimap
* Add lua functions to get/set position, angle, mode for minimap
* Client: rename m_mapper to m_minimap
* Add minimap to core.ui namespace (core.ui.minimap)
* Add various functions to manage minimap (show, hide, toggle_shape)
* Cleanup trivial declaration in client
2017-03-16 10:34:54 +01:00
SmallJoker c05dfac9a3 lua_api: Document minetest.features (#5311) 2017-03-15 22:07:19 +01:00
rubenwardy 84f4565e13 Add disclaimer to client_lua_api.txt (#5391) 2017-03-14 07:51:07 +01:00
red-001 88df9fb5b6 Add `get_wielded_item` 2017-03-13 23:56:05 +01:00
red-001 0727bb3ddd [CSM] Add `on_punchnode` callback 2017-03-13 23:56:05 +01:00
red-001 37df9cb7d7 [CSM] Add `get_node` and `get_node_or_nil` 2017-03-13 23:56:05 +01:00
red-001 073f5cf03d [CSM] Add `on_dignode` callback (#5140) 2017-03-13 23:56:05 +01:00
red-001 c42c53fccf [CSM] Add local formspecs. (#5094) 2017-03-13 23:56:05 +01:00
Loïc Blot 2c19d51409 [CSM] sound_play & sound_stop support + client_lua_api doc (#5096)
* squashed: CSM: Implement register_globalstep
  * Re-use fatal error mechanism from server to disconnect client on CSM error
  * Little client functions cleanups

* squashed: CSM: add core.after function
  * core.after is shared code between client & server
  * ModApiUtil get_us_time feature enabled for client
2017-03-13 23:56:05 +01:00
kilbith c9492b4d37 GUI: Allow texture packs to customize the progress bar (#5368) 2017-03-13 08:07:14 +01:00
Dániel Juhász ab371cc934 Light calculation: New bulk node lighting code
This commit introduces a new bulk node lighting algorithm to minimize
lighting bugs during l-system tree generation, schematic placement and
non-mapgen-object lua voxelmanip light calculation.

If the block above the changed area is not loaded, it gets loaded to avoid
lighting bugs.
Light is updated as soon as write_to_map is called on a voxel manipulator,
therefore update_map does nothing.
2017-03-11 02:06:18 +00:00
zaoqi c9ac722ea9 Add minetest.spawn_falling_node(pos) (#5339)
* Add minetest.spawn_falling_node(pos)

* lua_api.txt: Add minetest.spawn_falling_node(pos)

* Update minetest.spawn_falling_node(pos)
2017-03-04 18:36:37 +01:00
adelcoding1 6de83a2756 FormSpec: Add position and anchor elements (#5284) 2017-03-04 10:46:55 +01:00
red-001 01b2d2c66c Fix the documentation for `minetest.is_yes` (#5276) 2017-02-20 02:11:53 +10:00
rubenwardy 74b670a793 Correct lua_api.txt docs related to meta (#5198) 2017-02-10 07:59:38 +01:00
Loïc Blot ef6feca501 Add ModMetadata API (#5131)
* mod can create a ModMetadata object where store its values and retrieve it.
* Modmetadata object can only be fetched at mod loading
* Save when modified using same time as map interval or at server stop
* add helper function to get mod storage path
* ModMetadata has exactly same calls than all every other Metadata
2017-02-08 00:15:55 +01:00
rubenwardy f2f9a92351 Add per-stack descriptions using ItemStack Metadata 2017-02-04 22:07:55 +00:00
rubenwardy f2aa2c6a98 Add ItemStack key-value meta storage 2017-02-04 22:07:55 +00:00
sapier e761b9f486 Add multiply texture modifier
Allows colorizing of textures using a color multiplication method.
2017-01-30 16:37:17 +00:00
SmallJoker 79d752ba4f from_table: Fix crash for missing inventory or field 2017-01-28 16:38:46 +01:00
sapier 814ee971f7 Make entity on_punch have same signature and behaviour as player on_punch 2017-01-28 15:57:54 +01:00
Loïc Blot b7a98e9850 Implement player attribute backend (#4155)
* This backend permit mods to store extra players attributes to a common interface.
* Add the obj:set_attribute(attr, value) Lua call
* Add the obj:get_attribute(attr) Lua call

Examples:
* player:set_attribute("home:home", "10,25,-78")
* player:get_attribute("default:mana")

Attributes are saved as a json in the player file in extended_attributes
key

They are saved only if a modification on the attributes occurs and loaded
when emergePlayer is called (they are attached to PlayerSAO).
2017-01-27 08:59:30 +01:00
Auke Kok 7fc6719968 core: Add dir_to_yaw and yaw_to_dir helpers
These are needed to go from things like entity yaw to a vector
and vice versa.
2017-01-23 07:38:39 +00:00
Auke Kok 2d7a6f2cc0 Vector: Add vector.sort(a, b): return box edges
This function returns the box corners of the smallest box
that includes the two given coordinates.
2017-01-23 07:38:39 +00:00
Dániel Juhász d04d8aba70 Add hardware node coloring. Includes:
- Increase ContentFeatures serialization version
- Color property and palettes for nodes
- paramtype2 = "color", "colored facedir" or "colored wallmounted"
2017-01-23 07:27:12 +01:00
sapier c57b4ff9b5 Add Entity get_texture_mod() to Lua API
Send texture modifier to clients connecting later too
2017-01-21 17:01:02 +01:00
Elijah Duffy efa54f9c46 Add chatcommand unregister and override API (#5076)
Introduces two functions to unregister and override chatcommands.
minetest.unregister_chatcommand("<name>") and
minetest.override_chatcommand("<name>", {<redifinition>})
2017-01-20 19:49:20 +01:00
sfan5 7279f0b373 Add particle animation, glow
This is implemented by reusing and extending the
TileAnimation code for the methods used by particles.
2017-01-18 23:21:01 +01:00
rubenwardy c5967f75f0 Add minetest.player_exists() (#5064) 2017-01-18 11:19:57 +01:00
rubenwardy 63c892eedf Rename ObjectRef methods to be consistent and predictable 2017-01-16 15:34:44 +00:00
Rui ec30d49e02 Add staticdata parameter to add_entity (#5009)
* Add staticdata parameter to add_entity
* Add add_entity_with_staticdata to core.features
2017-01-09 20:39:45 +01:00
LNJ 545c37f613 lua_api.txt: Add registered_chatcommands to global tables 2017-01-05 21:38:43 +00:00
rubenwardy e8b7179ccd Expose and document chatcommands as minetest.registered_chatcommands 2017-01-04 20:56:07 +00:00
sfan5 a07b032245 Add 2D sheet animation for nodes 2017-01-02 15:28:06 +01:00
Luke Puchner-Hardman 7057c196c4 Added "[sheet" to the texture special commands.
"[sheet:WxH:X,Y" assumes the base image is a tilesheet with W*H tiles
on it and crops to the tile at position X,Y.  Basically it works
like "[verticalframe" but in 2D.

For testing, I combined the four default_chest images into one.
2017-01-02 15:28:06 +01:00
sfan5 b16252dcae Various anticheat improvements
* Calculate maximum interact distance from wielded tool
* New "interacted_while_dead" cheat_type for the Lua API
* Disallow dropping items while dead
* Move player to spawn before resurrecting them
2016-12-26 22:34:29 +01:00
sfan5 231ac33d34 Bump version to 0.4.15 2016-12-22 23:14:17 +01:00
Auke Kok 2e69711613 Simple deco: Allow setting param2 value on placement
Schematics can already be placed with a param2 value, but not
simple 1-node plant decorations of the simple type.

This adds a `param2` field to the simple deco type that is
checked to be between 0 and 255, and put to the placed node
at mapgen.

This can be used to put a degrotate value in, or e.g. a fill
value for leveltype nodes, or a place_param2 value at mapgen
placement, or vary the shape of meshoptions plantlike drawtype.
2016-12-07 04:17:17 +00:00
Amaz 8b63fbefba Fix incorrect docs about minetest.hud_replace_builtin (#4833)
Fixes https://github.com/minetest/minetest/issues/4832
2016-12-02 11:41:08 +01:00
Bluebird 144da5f522 Very small documentation fix. (#4830) 2016-12-02 20:20:55 +10:00
paramat 105676b952 Lua_api.txt: Clarify use of looping sounds 2016-12-01 05:09:01 +00:00
sfan5 c38985825f Allow restricting detached inventories to one player
This combats the problem of sending the hundreds of
"creative" / "armor" or whatever detached invs that
exist on popular servers to each and every player
on join or on change of said invs.
2016-11-28 13:41:19 +01:00
TeTpaAka 785a9a6c1a Wieldhand: Allow overriding the hand 2016-11-26 03:49:30 +00:00
orwell96 0d1c9598a0 Make supplying empty formspec strings close the formspec (#4737)
This will only happen if the formname matches or if formname is "".
2016-11-23 02:15:22 +10:00
orwell96 681d127ff1 Particles: Make attached particle spawners respect the parent's yaw
Position, velocity and acceleration vectors of particles are rotated
by the yaw of the parent object so that they are truly relative to it.
Clarify new attached particle spawner behavior in lua_api.txt.
2016-11-18 06:18:54 +00:00
Auke Kok 4a0a6723af Builtin/../item: Enable tool breaking sounds
If a tool wears out and is destroyed, it's itemstack count
goes to 0, and we can optionally play a breaking sound.

This patch implements playing a breaking sound when this
occurs. Sounds need to be added to the tool itemdef
registration as the sound name string in the .sound.breaks
member.
2016-11-18 06:15:08 +00:00
Wuzzy 8e61c1dfd9 Lua_api.txt: Naming convention for custom item/entity fields
Custom (non-engine) field names of items and entities are allowed.
This is now documented in lua_api.txt. Field names beginning with
an underscore are now reserved for mod use, the engine must not
introduce any fields beginning with an underscore.
2016-11-15 23:08:34 +00:00
sfan5 5fd1ef9b58 Revert "Adding particle blend, glow and animation (#4705)"
This reverts commit 93e3555eae.
2016-11-14 15:28:06 +01:00
Foghrye4 93e3555eae Adding particle blend, glow and animation (#4705) 2016-11-15 00:09:59 +10:00
est31 649448a2a9 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.
2016-11-14 13:08:22 +01:00
paramat 67ec2fa92d Nodeupdate: Remove documentation in lua_api.txt
In preparation for nodeupdate being renamed and made official API
in future.
2016-11-12 06:45:09 +00:00
Brandon bf315c05f1 Add minetest.get_server_uptime() function to Lua API (#4702)
Add minetest.get_server_uptime() function to Lua API
2016-11-02 09:36:58 -07:00
ShadowNinja 7607b0ac20 Add version API 2016-10-31 21:53:00 -07:00
paramat 70e2df4f86 Lua voxelmanip: Add optional buffer param for 'get param2 data'
Update lua_api.txt.
2016-10-31 10:59:38 +00:00
raymoo 1fd9a07497 Document item use callbacks (#4668) 2016-10-27 13:24:34 +10:00
paramat 74eb7f50c9 Lua_api.txt: Clarify 'override_meta' bool in 'set mapgen setting' 2016-10-21 05:49:06 +01:00
rubenwardy 0d740c5d82 Builtin: Add vector.floor helper function 2016-10-17 22:03:49 +02:00
sfan5 9a3129da5e Make documentation about ItemStack:set_{name,count,wear} clearer
These methods do not actually fail but instead clear the item stack
	and return false if a value like e.g. "" is passed.
2016-10-15 12:42:59 +02:00
raymoo c9e7a27eeb Attached particle spawners 2016-10-13 17:33:16 +02:00
rubenwardy 067766eec2 Fix backwards compatibility issue introduced by close_on_enter 2016-10-08 18:58:28 +02:00
paramat 0264e38bff Lua_api.txt: Add biome and nodeupdate documentation
Add missing documentation for 'register_biome' and
'clear_registered_biomes'.
Add documentation for 'nodeupdate_single'. 'nodeupdate'
is not yet documented due to a bug it causes.
2016-10-08 00:09:01 +01:00
raymoo 2516c516bc Forceloading: Transient forceloads
Adds a flag to forceload_block which lets you turn off persistence for
that forceload.
2016-10-03 01:54:36 +01:00
rubenwardy 077b6cfa21 Formspec: Add container[] and container_end[] elements 2016-10-03 01:53:13 +01:00
paramat 3aefa5d3ce 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.
2016-09-17 09:33:25 +01:00
paramat 297546af3d Lua_api.txt: Add note of maximum value for node 'light_source'
Maximum is 14.
A value of 15 (reserved for direct sunlight) causes a lighting bug.
2016-09-15 05:25:38 +01:00
Thomas--S 1475c1b1c8 Add an [invert:<mode> texture modifier
Inverts the given channels of the base image.
Mode may contain the characters "r", "g", "b", "a".
Only the channels that are mentioned in the mode string will be inverted.
2016-09-15 05:25:38 +01:00
paramat b88595050f Decorations: Generalise 'spawn by' to be used by all decoration types
In lua_api.txt, make clear that 'place on' and 'spawn by' can be lists.
2016-09-14 09:19:54 +01:00
sfan5 b77cee146b Allow escaping of texture names when passed as an argument to a modifier 2016-09-14 09:19:36 +01:00
raymoo af4b63ff21 fix missing parameters in some mentions of entity callbacks 2016-09-12 03:35:28 -04:00
James Stevenson 403dada85a Return nil on empty get_area() (#4508) 2016-09-10 01:47:13 +10:00