516 Commits

Author SHA1 Message Date
rubenwardy
7dd1992edb Correct lua_api.txt docs related to meta (#5198) 2017-02-10 07:59:38 +01:00
Loïc Blot
65e75bba93 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
87920c8635 Add per-stack descriptions using ItemStack Metadata 2017-02-04 22:07:55 +00:00
rubenwardy
8441029477 Add ItemStack key-value meta storage 2017-02-04 22:07:55 +00:00
sapier
9e3f66ec6b Add multiply texture modifier
Allows colorizing of textures using a color multiplication method.
2017-01-30 16:37:17 +00:00
SmallJoker
1ca1d9ae97 from_table: Fix crash for missing inventory or field 2017-01-28 16:38:46 +01:00
sapier
99c27fa817 Make entity on_punch have same signature and behaviour as player on_punch 2017-01-28 15:57:54 +01:00
Loïc Blot
b24578ef70 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
0c8abbe8fb 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
4eb54bc232 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
d5a0b5283e 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
8df666f56e 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
7285ef6639 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
ef197b4880 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
be9b0b2aea Add minetest.player_exists() (#5064) 2017-01-18 11:19:57 +01:00
rubenwardy
e8ba0cc76f Rename ObjectRef methods to be consistent and predictable 2017-01-16 15:34:44 +00:00
Rui
f1b3f9d929 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
b9ad3d4bc8 lua_api.txt: Add registered_chatcommands to global tables 2017-01-05 21:38:43 +00:00
rubenwardy
2f942ce148 Expose and document chatcommands as minetest.registered_chatcommands 2017-01-04 20:56:07 +00:00
sfan5
c68d446afa Add 2D sheet animation for nodes 2017-01-02 15:28:06 +01:00
Luke Puchner-Hardman
c83a1e6c5f 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
e171949b92 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
4e2d145369 Bump version to 0.4.15 2016-12-22 23:14:17 +01:00
Auke Kok
2f71a16b08 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
75e9209169 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
6aaea80a6f Very small documentation fix. (#4830) 2016-12-02 20:20:55 +10:00
paramat
e94d91747b Lua_api.txt: Clarify use of looping sounds 2016-12-01 05:09:01 +00:00
sfan5
a4191476ab 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
116d887dd0 Wieldhand: Allow overriding the hand 2016-11-26 03:49:30 +00:00
orwell96
4e24ecae21 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
a1097d3a35 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
3c129ab38b 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
5b005066df 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
a99777ab39 Revert "Adding particle blend, glow and animation (#4705)"
This reverts commit 93e3555eae2deaeca69ee252cfa9cc9c3e0e49ef.
2016-11-14 15:28:06 +01:00
Foghrye4
04ea490226 Adding particle blend, glow and animation (#4705) 2016-11-15 00:09:59 +10:00
est31
e651d7a987 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
5e64c02aa1 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
7e703858b8 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
c9100740e4 Add version API 2016-10-31 21:53:00 -07:00
paramat
9037505da6 Lua voxelmanip: Add optional buffer param for 'get param2 data'
Update lua_api.txt.
2016-10-31 10:59:38 +00:00
raymoo
48aead7d1e Document item use callbacks (#4668) 2016-10-27 13:24:34 +10:00
paramat
00a733ac21 Lua_api.txt: Clarify 'override_meta' bool in 'set mapgen setting' 2016-10-21 05:49:06 +01:00
rubenwardy
bb94e62525 Builtin: Add vector.floor helper function 2016-10-17 22:03:49 +02:00
sfan5
8b98a7dee9 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
6e0388ece4 Attached particle spawners 2016-10-13 17:33:16 +02:00
rubenwardy
8c1271f645 Fix backwards compatibility issue introduced by close_on_enter 2016-10-08 18:58:28 +02:00
paramat
013e882c66 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
1c5eff9aac 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
ade3a24e75 Formspec: Add container[] and container_end[] elements 2016-10-03 01:53:13 +01:00
paramat
5dd99dfd62 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