* 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
Recent commit b6f4a9c7e1a4f0bac66fd6f6ff844425ac775975 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.
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.
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).
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.
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.
* 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.
* 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
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.
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.
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.
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.
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.
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.
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.
* 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
* 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).
- Increase ContentFeatures serialization version
- Color property and palettes for nodes
- paramtype2 = "color", "colored facedir" or "colored wallmounted"
Introduces two functions to unregister and override chatcommands.
minetest.unregister_chatcommand("<name>") and
minetest.override_chatcommand("<name>", {<redifinition>})
"[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.
* 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
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.
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.
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.
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.
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.
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.
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.
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.
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.
Adds several new ways that the plantlike drawtype mesh can be changed.
This requires paramtype2 = "meshoptions" to be set in the node
definition. The drawtype for these nodes should be "plantlike".
These modifications are all done using param2. This field is now
a complex bitfield that allows some or more of the combinations to
be chosen, and the mesh draw code will choose the options based as
neeeded for each plantlike node.
bit layout:
bits 0, 1 and 2 (values 0x1 through 0x7) are for choosing the plant
mesh shape:
0 - ordinary plantlike plant ("x" shaped)
1 - ordinary plant, but rotated 45 degrees ("+" shaped)
2 - a plant with 3 faces ("*" shaped)
3 - a plant with 4 faces ("#" shaped)
4 - a plant with 4 faces ("#" shaped, leaning outwards)
5 through 7 are unused and reserved for future mesh shapes.
bit 3 (0x8) causes the plant to be randomly offset in the x,z
plane. The plant should fall within the 1x1x1 nodebox if regularly
sized.
bit 4 (0x10) causes the plant mesh to grow by sqrt(2), and will cause
the plant mesh to fill out 1x1x1, and appear slightly larger. Texture
makers will want to make their plant texture 23x16 pixels to have the
best visual fit in 1x1x1 size.
bit 5 (0x20) causes each face of the plant to have a slight negative
Y offset in position, descending up to 0.125 downwards into the node
below. Because this is per face, this causes the plant model to be
less symmetric.
bit 6 (0x40) through bit 7 (0x80) are unused and reserved for
future use.
!(https://youtu.be/qWuI664krsI)