From 19d662dee44065f1f1df2e1ba17695d77ebe4086 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikita=20Wi=C5=9Bniewski?= Date: Thu, 12 Sep 2024 18:13:52 +0200 Subject: [PATCH] Fix some typos in the API documentation (#4630) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-on: https://git.minetest.land/VoxeLibre/VoxeLibre/pulls/4630 Reviewed-by: teknomunk Co-authored-by: Mikita Wiśniewski Co-committed-by: Mikita Wiśniewski --- mods/CORE/flowlib/API.md | 20 +++++++-------- mods/CORE/mcl_autogroup/API.md | 8 +++--- mods/CORE/mcl_colors/API.md | 2 +- mods/CORE/mcl_damage/API.md | 4 +-- mods/CORE/mcl_events/API.md | 20 +++++++++------ mods/CORE/mcl_explosions/API.md | 6 ++--- mods/CORE/mcl_worlds/API.md | 30 ++++++++++++----------- mods/HUD/mcl_info/API.md | 5 +++- mods/HUD/mcl_inventory/API.md | 1 + mods/HUD/mcl_title/API.md | 8 +++--- mods/ITEMS/mcl_armor/API.md | 2 +- mods/ITEMS/mcl_buckets/API.md | 39 ++++++++++++++++-------------- mods/ITEMS/mcl_chests/API.md | 4 +-- mods/ITEMS/mcl_doors/api_doors.lua | 2 +- mods/MISC/mcl_wip/API.md | 18 +++++++------- 15 files changed, 92 insertions(+), 77 deletions(-) diff --git a/mods/CORE/flowlib/API.md b/mods/CORE/flowlib/API.md index 20e85036b..dfef0e06c 100644 --- a/mods/CORE/flowlib/API.md +++ b/mods/CORE/flowlib/API.md @@ -2,33 +2,33 @@ Simple flow functions. ## flowlib.is_touching(realpos, nodepos, radius) -Return true if a sphere of at collide with node at . +Return true if a sphere of `radius` at `realpos` collide with node at `nodepos`. * realpos: position * nodepos: position * radius: number ## flowlib.is_water(pos) -Return true if node at is water, false overwise. +Return true if node at `pos` is water, false otherwise. * pos: position ## flowlib.node_is_water(node) -Return true if is water, false overwise. +Return true if `node` is water, false otherwise. * node: node ## flowlib.is_lava(pos) -Return true if node at is lava, false overwise. +Return true if node at `pos` is lava, false otherwise. * pos: position ## flowlib.node_is_lava(node) -Return true if is lava, false overwise. +Return true if `node` is lava, false otherwise. * node: node ## flowlib.is_liquid(pos) -Return true if node at is liquid, false overwise. +Return true if node at `pos` is liquid, false otherwise. * pos: position ## flowlib.node_is_liquid(node) -Return true if is liquid, false overwise. +Return true if `node` is liquid, false otherwise. * node: node ## flowlib.quick_flow(pos, node) @@ -37,9 +37,9 @@ Return direction where the water is flowing (to be use to push mobs, items...). * node: node ## flowlib.move_centre(pos, realpos, node, radius) -Return the pos of the nearest not water block near from in a sphere of at . -WARNING: This function is never used in mcl2, use at your own risk. The informations described here may be wrong. +Return the pos of the nearest not water block near from `pos` in a sphere of `radius` at `realpos`. +WARNING: This function is never used in VL, use at your own risk. The informations described here may be wrong. * pos: position * realpos: position, position of the entity * node: node -* radius: number \ No newline at end of file +* radius: number diff --git a/mods/CORE/mcl_autogroup/API.md b/mods/CORE/mcl_autogroup/API.md index b3a913ab6..f95516882 100644 --- a/mods/CORE/mcl_autogroup/API.md +++ b/mods/CORE/mcl_autogroup/API.md @@ -1,8 +1,8 @@ # mcl_autogroup -This mod emulate digging times from mc. +This mod emulates digging times from MC. ## mcl_autogroup.can_harvest(nodename, toolname, player) -Return true if can be dig with by . +Return true if `nodename` can be dig with `toolname` by . * nodename: string, valid nodename * toolname: (optional) string, valid toolname * player: (optinal) ObjectRef, valid player @@ -14,7 +14,7 @@ WARNING: This function can only be called after mod initialization. * efficiency: (optional) integer, the efficiency level the tool is enchanted with (default 0) ## mcl_autogroup.get_wear(toolname, diggroup) -Return the max wear of with +Return the max wear of `toolname` with `diggroup` WARNING: This function can only be called after mod initialization. * toolname: string, name of the tool used * diggroup: string, the name of the diggroup the tool is used on @@ -25,4 +25,4 @@ WARNING: This function can only be called after mod initialization. * level: (optional) string, if specified it is an array containing the names of the different digging levels the digging group supports ## mcl_autogroup.registered_diggroups -List of registered diggroups, indexed by name. \ No newline at end of file +List of registered diggroups, indexed by name. diff --git a/mods/CORE/mcl_colors/API.md b/mods/CORE/mcl_colors/API.md index 71cad335b..f58a38a3b 100644 --- a/mods/CORE/mcl_colors/API.md +++ b/mods/CORE/mcl_colors/API.md @@ -1,5 +1,5 @@ # mcl_colors -Mod providing global table containing legacity minecraft colors to be used in mods. +Mod providing global table containing legacy Minecraft colors to be used in mods. ## mcl_colors.* Colors by upper name, in hex value. diff --git a/mods/CORE/mcl_damage/API.md b/mods/CORE/mcl_damage/API.md index 9ffdcb9f4..0ca5c6e38 100644 --- a/mods/CORE/mcl_damage/API.md +++ b/mods/CORE/mcl_damage/API.md @@ -6,10 +6,10 @@ WARNING: Not using it inside your mods may cause strange bugs (using the native ## Callbacks -To modify the amount of damage made by something: +To modify the amount of damage dealt by something: ```lua --obj: an ObjectRef mcl_damage.register_modifier(function(obj, damage, reason) end, 0) -``` \ No newline at end of file +``` diff --git a/mods/CORE/mcl_events/API.md b/mods/CORE/mcl_events/API.md index c94328e50..caa99c0b4 100644 --- a/mods/CORE/mcl_events/API.md +++ b/mods/CORE/mcl_events/API.md @@ -1,9 +1,13 @@ -## mcl_events -### Registering Events - `mlc_events.register_event("name",def)` +# mcl_events -#### Event Definition - { +## Registering Events + +`mcl_events.register_event("name", def)` + +### Event Definition + +``` +{ stage = 0, max_stage = 1, percent = 100, @@ -22,6 +26,8 @@ cond_complete = function(event) end, --return true if event finished successfully } +``` -### Debugging - * /event_start -- starts the given event at the current player coordinates +## Debugging + +* /event_start `event` -- starts the given event at the current player coordinates diff --git a/mods/CORE/mcl_explosions/API.md b/mods/CORE/mcl_explosions/API.md index cb0e9252d..58748582f 100644 --- a/mods/CORE/mcl_explosions/API.md +++ b/mods/CORE/mcl_explosions/API.md @@ -3,13 +3,13 @@ This mod provide helper functions to create explosions. ## mcl_explosions.explode(pos, strength, info, puncher) * pos: position, initial position of the explosion -* strenght: number, radius of the explosion +* strength: number, radius of the explosion * info: table, explosion informations: * drop_chance: number, if specified becomes the drop chance of all nodes in the explosion (default: 1.0 / strength) * max_blast_resistance: int, if specified the explosion will treat all non-indestructible nodes as having a blast resistance of no more than this value * sound: bool, if true, the explosion will play a sound (default: true) * particles: bool, if true, the explosion will create particles (default: true) - * fire: bool, if true, 1/3 nodes become fire (default: false) + * fire: bool, if true, 1/3 of nodes become fire (default: false) * griefing: bool, if true, the explosion will destroy nodes (default: true) * grief_protected: bool, if true, the explosion will also destroy nodes which have been protected (default: false) -* puncher: (optional) entity, will be used as source for damage done by the explosion \ No newline at end of file +* puncher: (optional) entity, will be used as source for damage done by the explosion diff --git a/mods/CORE/mcl_worlds/API.md b/mods/CORE/mcl_worlds/API.md index 6ad7639f4..f7da7b199 100644 --- a/mods/CORE/mcl_worlds/API.md +++ b/mods/CORE/mcl_worlds/API.md @@ -5,20 +5,21 @@ This mod provides utility functions about positions and dimensions. This function returns: * true, true: if pos is in deep void (deadly) -* true, false: if the pos is in void (non deadly) -* false, false: owerwise +* true, false: if the pos is in void (non-deadly) +* false, false: otherwise Params: * pos: position ## mcl_worlds.y_to_layer(y) -This function is used to calculate the minetest y layer and dimension of the given minecraft layer. +This function is used to calculate the Minetest y layer and dimension of the given y Minecraft layer. Mainly used for ore generation. -Takes an Y coordinate as input and returns: +Takes a Y coordinate as input and returns: + +* The corresponding Minecraft layer (can be `nil` if void) +* The corresponding Minecraft dimension ("overworld", "nether" or "end") or "void" if y is in the void -* The corresponding Minecraft layer (can be nil if void) -* The corresponding Minecraft dimension ("overworld", "nether" or "end") or "void" if is in the void If the Y coordinate is not located in any dimension, it will return: nil, "void" Params: @@ -26,7 +27,7 @@ Params: * y: int ## mcl_worlds.pos_to_dimension(pos) -This function return the Minecraft dimension of ("overworld", "nether" or "end") or "void" if is in the void. +This function return the Minecraft dimension of pos ("overworld", "nether" or "end") or "void" if y is in the void. * pos: position @@ -38,31 +39,32 @@ mc_dimension can be "overworld", "nether", "end" (default: "overworld"). * mc_dimension: string ## mcl_worlds.has_weather(pos) -Returns true if can have weather, false owerwise. +Returns true if pos can have weather, false otherwise. Weather can be only in the overworld. * pos: position ## mcl_worlds.has_dust(pos) -Returns true if can have nether dust, false owerwise. +Returns true if pos can have nether dust, false otherwise. Nether dust can be only in the nether. * pos: position ## mcl_worlds.compass_works(pos) -Returns true if compasses are working at , false owerwise. -In mc, you cant use compass in the nether and the end. +Returns true if compasses are working at pos, false otherwise. +In MC, you cant use compass in the nether and the end. * pos: position ## mcl_worlds.compass_works(pos) -Returns true if clock are working at , false owerwise. -In mc, you cant use clock in the nether and the end. +Returns true if clock are working at pos, false otherwise. +In MC, you cant use clock in the nether and the end. * pos: position ## mcl_worlds.register_on_dimension_change(function(player, dimension, last_dimension)) Register a callback function func(player, dimension). + It will be called whenever a player changes between dimensions. The void counts as dimension. @@ -75,7 +77,7 @@ The void counts as dimension. Table containing all function registered with mcl_worlds.register_on_dimension_change() ## mcl_worlds.dimension_change(player, dimension) -Notify this mod of a dimension change of to +Notify this mod of a dimension change of player to dimension * player: player, player who changed the dimension * dimension: string, new dimension ("overworld", "nether", "end", "void") diff --git a/mods/HUD/mcl_info/API.md b/mods/HUD/mcl_info/API.md index 18c901162..789a5c76b 100644 --- a/mods/HUD/mcl_info/API.md +++ b/mods/HUD/mcl_info/API.md @@ -1,8 +1,10 @@ ## mcl_info -An api to make custom entries in the mcl2 debug hud. +An API to make custom entries in the VL debug hud. ### mcl_info.register_debug_field(name,defintion) Debug field defintion example: + +``` { level = 3, --show with debug level 3 and upwards @@ -13,6 +15,7 @@ Debug field defintion example: -- It should output a string and determines -- the content of the debug field. } +``` ### mcl_info.registered_debug_fields Table the debug definitions are stored in. Do not modify this directly. If you need to overwrite a field just set it again with mcl_info.register_debug_field(). diff --git a/mods/HUD/mcl_inventory/API.md b/mods/HUD/mcl_inventory/API.md index 5fc5a8d6e..3ba784559 100644 --- a/mods/HUD/mcl_inventory/API.md +++ b/mods/HUD/mcl_inventory/API.md @@ -32,4 +32,5 @@ mcl_inventory.register_survival_inventory_tab({ -- Returns true by default access = function(player) end, +}) ``` diff --git a/mods/HUD/mcl_title/API.md b/mods/HUD/mcl_title/API.md index 37f1c279f..78621488f 100644 --- a/mods/HUD/mcl_title/API.md +++ b/mods/HUD/mcl_title/API.md @@ -8,7 +8,7 @@ Show a hud message of `type` to player `player` with `data` as params. The element will stay for the per-player param `stay` or `data.stay` (in gametick which is 1/20 second). -Here is a usage exemple: +Here is a usage example: ```lua --show a title in the HUD with minecraft color "gold" @@ -35,7 +35,7 @@ Basicaly run `mcl_title.remove(player, type)` for every type. ## mcl_title.params_set(player, params) -Allow mods to set `stay` and upcomming `fadeIn`/`fadeOut` params. +Allow mods to set `stay` and upcoming `fadeIn`/`fadeOut` params. ```lua mcl_title.params_set(player, {stay = 600}) --elements with no 'data.stay' field will stay during 30s (600/20) @@ -43,8 +43,8 @@ mcl_title.params_set(player, {stay = 600}) --elements with no 'data.stay' field ## mcl_title.params_get(player) -Get `stay` and upcomming `fadeIn` and `fadeOut` params of a player as a table. +Get `stay` and upcoming `fadeIn` and `fadeOut` params of a player as a table. ```lua mcl_title.params_get(player) -``` \ No newline at end of file +``` diff --git a/mods/ITEMS/mcl_armor/API.md b/mods/ITEMS/mcl_armor/API.md index 507deab39..4c4284017 100644 --- a/mods/ITEMS/mcl_armor/API.md +++ b/mods/ITEMS/mcl_armor/API.md @@ -119,7 +119,7 @@ mcl_armor.register_set({ end, }, - --this is used to generate automaticaly armor crafts based on each element type folowing the regular minecraft pattern + --this is used to generate automaticaly armor crafts based on each element type following the regular minecraft pattern --if set to nil no craft will be added craft_material = "mcl_mobitems:leather", diff --git a/mods/ITEMS/mcl_buckets/API.md b/mods/ITEMS/mcl_buckets/API.md index 94ec48de5..007f78343 100644 --- a/mods/ITEMS/mcl_buckets/API.md +++ b/mods/ITEMS/mcl_buckets/API.md @@ -1,25 +1,28 @@ # mcl_buckets -Add an API to register buckets to mcl +Adds an API to register buckets to VL ## mcl_buckets.register_liquid(def) -Register a new liquid -Accept folowing params: -* source_place: a string or function. - * string: name of the node to place - * function(pos): will returns name of the node to place with pos being the placement position -* source_take: table of liquid source node names to take -* bucketname: itemstring of the new bucket item -* inventory_image: texture of the new bucket item (ignored if itemname == nil) -* name: user-visible bucket description -* longdesc: long explanatory description (for help) -* usagehelp: short usage explanation (for help) -* tt_help: very short tooltip help -* extra_check(pos, placer): (optional) function(pos) -* groups: optional list of item groups +Register a new liquid. + +Accepts the following parameters: + +* `source_place`: a string or a function + * `string`: name of the node to place + * `function(pos)`: will return name of the node to place with pos being the placement position +* `source_take`: table of liquid source node names to take +* `bucketname`: itemstring of the new bucket item +* `inventory_image`: texture of the new bucket item (ignored if itemname == nil) +* `name`: user-visible bucket description +* `longdesc`: long explanatory description (for help) +* `usagehelp`: short usage explanation (for help) +* `tt_help`: very short tooltip help +* `extra_check(pos, placer)`: (optional) additional check before liquid placement (return 2 booleans: (1) whether to place the liquid source and (2) whether to empty the bucket) +* `groups`: optional list of item groups -**Usage exemple:** +**Usage example:** + ```lua mcl_buckets.register_liquid({ bucketname = "dummy:bucket_dummy", @@ -39,7 +42,7 @@ mcl_buckets.register_liquid({ tt_help = S("Places a dummy liquid source"), extra_check = function(pos, placer) --pos = pos where the liquid should be placed - --placer people who tried to place the bucket (can be nil) + --placer who tried to place the bucket (can be nil) --no liquid node will be placed --the bucket will not be emptied @@ -51,4 +54,4 @@ mcl_buckets.register_liquid({ end, groups = { dummy_group = 123 }, }) -``` \ No newline at end of file +``` diff --git a/mods/ITEMS/mcl_chests/API.md b/mods/ITEMS/mcl_chests/API.md index 5550cfbfa..e0e6bde5e 100644 --- a/mods/ITEMS/mcl_chests/API.md +++ b/mods/ITEMS/mcl_chests/API.md @@ -5,9 +5,9 @@ animations are achieved by giving each chest node an entity, as Minetest (as of 5.8.1) doesn't support giving nodes animated meshes, only static ones. Because of that, a lot of parameters passed through the exposed functions are -be related to nodes and entities. +related to nodes and entities. -Please refer to [Minetest documentation](http://api.minetest.net/) and the code +Please refer to the [Minetest documentation](http://api.minetest.net/) and code comments in `api.lua`. diff --git a/mods/ITEMS/mcl_doors/api_doors.lua b/mods/ITEMS/mcl_doors/api_doors.lua index e392bc710..0108738b4 100644 --- a/mods/ITEMS/mcl_doors/api_doors.lua +++ b/mods/ITEMS/mcl_doors/api_doors.lua @@ -25,7 +25,7 @@ end -- Registers a door -- name: The name of the door --- def: a table with the folowing fields: +-- def: a table with the following fields: -- description -- inventory_image -- groups diff --git a/mods/MISC/mcl_wip/API.md b/mods/MISC/mcl_wip/API.md index e3439af77..776983783 100644 --- a/mods/MISC/mcl_wip/API.md +++ b/mods/MISC/mcl_wip/API.md @@ -1,16 +1,16 @@ # mcl_wip Used to mark items or nodes as WIP. -## mcl_wip.register_wip_item(itemname) -Register as a WIP item. -If isn't a valid itemname, an error will be shown after mods loaded. +## `mcl_wip.register_wip_item(itemname)` +Register `itemname` as a WIP item. +If `itemname` isn't a valid itemname, an error will be shown after mods loaded. -## mcl_wip.register_experimental_item(itemname) -Register as a experimental item. -If isn't a valid itemname, an error will be shown after mods loaded. +## `mcl_wip.register_experimental_item(itemname)` +Register `itemname` as a experimental item. +If `itemname` isn't a valid itemname, an error will be shown after mods loaded. -## mcl_wip.registered_wip_items +## `mcl_wip.registered_wip_items` Table containing WIP items names. -## mcl_wip.registered_experimental_items -Table containing experimental items names. \ No newline at end of file +## `mcl_wip.registered_experimental_items` +Table containing experimental items names.