Commit Graph

687 Commits

Author SHA1 Message Date
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