aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2021-10-31 22:33:33 +0000
committerGitHub <noreply@github.com>2021-10-31 22:33:33 +0000
commit6910c8d920acedb3f1df1ac03a5cdf14f5fb6081 (patch)
treeae01925fc35e2301a87ec53897f96b1f56c955fb /doc
parent38ba813c55489595cd78ab2f952be2e954083cfa (diff)
downloadminetest-6910c8d920acedb3f1df1ac03a5cdf14f5fb6081.tar.gz
minetest-6910c8d920acedb3f1df1ac03a5cdf14f5fb6081.tar.bz2
minetest-6910c8d920acedb3f1df1ac03a5cdf14f5fb6081.zip
Fix number of tool uses being off by 1..32767 (#11110)
Diffstat (limited to 'doc')
-rw-r--r--doc/lua_api.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index e47df4686..f3007671b 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -1953,8 +1953,9 @@ to implement this.
### Uses (tools only)
Determines how many uses the tool has when it is used for digging a node,
-of this group, of the maximum level. For lower leveled nodes, the use count
-is multiplied by `3^leveldiff`.
+of this group, of the maximum level. The maximum supported number of
+uses is 65535. The special number 0 is used for infinite uses.
+For lower leveled nodes, the use count is multiplied by `3^leveldiff`.
`leveldiff` is the difference of the tool's `maxlevel` `groupcaps` and the
node's `level` group. The node cannot be dug if `leveldiff` is less than zero.
@@ -3475,8 +3476,8 @@ Helper functions
* `minetest.pointed_thing_to_face_pos(placer, pointed_thing)`: returns a
position.
* returns the exact position on the surface of a pointed node
-* `minetest.get_dig_params(groups, tool_capabilities)`: Simulates an item
- that digs a node.
+* `minetest.get_dig_params(groups, tool_capabilities [, wear])`:
+ Simulates an item that digs a node.
Returns a table with the following fields:
* `diggable`: `true` if node can be dug, `false` otherwise.
* `time`: Time it would take to dig the node.
@@ -3485,7 +3486,8 @@ Helper functions
Parameters:
* `groups`: Table of the node groups of the node that would be dug
* `tool_capabilities`: Tool capabilities table of the item
-* `minetest.get_hit_params(groups, tool_capabilities [, time_from_last_punch])`:
+ * `wear`: Amount of wear the tool starts with (default: 0)
+* `minetest.get_hit_params(groups, tool_capabilities [, time_from_last_punch [, wear]])`:
Simulates an item that punches an object.
Returns a table with the following fields:
* `hp`: How much damage the punch would cause.
@@ -3494,6 +3496,7 @@ Helper functions
* `groups`: Damage groups of the object
* `tool_capabilities`: Tool capabilities table of the item
* `time_from_last_punch`: time in seconds since last punch action
+ * `wear`: Amount of wear the item starts with (default: 0)