From d0e59b4cd7a897d39ead071b76b1825d864e0c52 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Tue, 2 Jan 2024 16:59:51 +0000 Subject: [PATCH] worldeditadditions: add core @module defs, correct comment formatting errors --- worldeditadditions/lib/airapply.lua | 9 ++++--- worldeditadditions/lib/bonemeal.lua | 7 ++++-- worldeditadditions/lib/copy.lua | 3 +++ worldeditadditions/lib/count.lua | 3 +++ worldeditadditions/lib/dome.lua | 3 +++ worldeditadditions/lib/ellipsoid.lua | 3 +++ worldeditadditions/lib/ellipsoid2.lua | 3 +++ worldeditadditions/lib/ellipsoidapply.lua | 9 ++++--- worldeditadditions/lib/fillcaves.lua | 3 +++ worldeditadditions/lib/floodfill.lua | 3 +++ worldeditadditions/lib/forest.lua | 3 +++ worldeditadditions/lib/hollow.lua | 3 +++ worldeditadditions/lib/layers.lua | 3 +++ worldeditadditions/lib/line.lua | 3 +++ worldeditadditions/lib/maze2d.lua | 3 +++ worldeditadditions/lib/maze3d.lua | 3 +++ worldeditadditions/lib/move.lua | 3 +++ worldeditadditions/lib/nodeapply.lua | 2 ++ worldeditadditions/lib/noiseapply2d.lua | 11 +++++--- worldeditadditions/lib/overlay.lua | 3 +++ worldeditadditions/lib/replacemix.lua | 3 +++ worldeditadditions/lib/revolve.lua | 3 +++ worldeditadditions/lib/rotate.lua | 3 +++ worldeditadditions/lib/scale.lua | 3 +++ worldeditadditions/lib/scale_down.lua | 4 +++ worldeditadditions/lib/scale_up.lua | 6 ++++- .../lib/selection/selection.lua | 8 ++++++ worldeditadditions/lib/selection/stack.lua | 1 + worldeditadditions/lib/spiral_circle.lua | 3 +++ worldeditadditions/lib/spiral_square.lua | 3 +++ worldeditadditions/lib/spline.lua | 3 +++ worldeditadditions/lib/subdivide.lua | 25 +++++++++++++------ worldeditadditions/lib/torus.lua | 3 +++ worldeditadditions/lib/walls.lua | 3 +++ .../lib/wireframe/corner_set.lua | 3 +++ .../lib/wireframe/make_compass.lua | 9 ++++--- worldeditadditions/lib/wireframe/wire_box.lua | 9 ++++--- 37 files changed, 148 insertions(+), 27 deletions(-) diff --git a/worldeditadditions/lib/airapply.lua b/worldeditadditions/lib/airapply.lua index b526204..32ec532 100644 --- a/worldeditadditions/lib/airapply.lua +++ b/worldeditadditions/lib/airapply.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- █████ ██ ██████ -- ██ ██ ██ ██ ██ -- ███████ ██ ██████ @@ -16,9 +19,9 @@ local Vector3 = wea_c.Vector3 --- Like ellipsoidapply, but only keeps changes that replace airlike nodes, and discards any other changes made. -- Takes a backup copy of the defined region, runs the given function, and then -- restores the bits around the edge that aren't inside the largest ellipsoid that will fit inside the defined region. --- @param {Position} pos1 The 1st position defining the region boundary --- @param {Position} pos2 The 2nd positioon defining the region boundary --- @param {Function} func The function to call that performs the action in question. It is expected that the given function will accept no arguments. +-- @param pos1 Position The 1st position defining the region boundary +-- @param pos2 Position The 2nd positioon defining the region boundary +-- @param func function The function to call that performs the action in question. It is expected that the given function will accept no arguments. function worldeditadditions.airapply(pos1, pos2, func) local time_taken_all = wea_c.get_ms_time() pos1, pos2 = Vector3.sort(pos1, pos2) diff --git a/worldeditadditions/lib/bonemeal.lua b/worldeditadditions/lib/bonemeal.lua index 0a179c2..90c6d2e 100644 --- a/worldeditadditions/lib/bonemeal.lua +++ b/worldeditadditions/lib/bonemeal.lua @@ -1,10 +1,13 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + --- Bonemeal command. -- Applies bonemeal to all nodes with an air bloc above then. --- @param strength The strength to apply - see bonemeal:on_use --- @param chance Positive integer that represents the chance bonemealing will occur +-- @param strength number The strength to apply - see bonemeal:on_use +-- @param chance number Positive integer that represents the chance bonemealing will occur -- @returns bool,number,number 1. Whether the command succeeded or not. -- 2. The number of nodes actually bonemealed -- 3. The number of possible candidates we could have bonemealed diff --git a/worldeditadditions/lib/copy.lua b/worldeditadditions/lib/copy.lua index 2cb4a64..33eb39a 100644 --- a/worldeditadditions/lib/copy.lua +++ b/worldeditadditions/lib/copy.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ██████ ██████ ██████ ██ ██ -- ██ ██ ██ ██ ██ ██ ██ diff --git a/worldeditadditions/lib/count.lua b/worldeditadditions/lib/count.lua index 5d05886..401f76a 100644 --- a/worldeditadditions/lib/count.lua +++ b/worldeditadditions/lib/count.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ██████ ██████ ██ ██ ███ ██ ████████ -- ██ ██ ██ ██ ██ ████ ██ ██ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ diff --git a/worldeditadditions/lib/dome.lua b/worldeditadditions/lib/dome.lua index a51a440..5a2ea07 100644 --- a/worldeditadditions/lib/dome.lua +++ b/worldeditadditions/lib/dome.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ██████ ██████ ███ ███ ███████ -- ██ ██ ██ ██ ████ ████ ██ -- ██ ██ ██ ██ ██ ████ ██ █████ diff --git a/worldeditadditions/lib/ellipsoid.lua b/worldeditadditions/lib/ellipsoid.lua index 36c883b..d9237e7 100644 --- a/worldeditadditions/lib/ellipsoid.lua +++ b/worldeditadditions/lib/ellipsoid.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ███████ ██ ██ ██ ██████ ███████ ███████ -- ██ ██ ██ ██ ██ ██ ██ ██ -- █████ ██ ██ ██ ██████ ███████ █████ diff --git a/worldeditadditions/lib/ellipsoid2.lua b/worldeditadditions/lib/ellipsoid2.lua index ec740d2..2c249b0 100644 --- a/worldeditadditions/lib/ellipsoid2.lua +++ b/worldeditadditions/lib/ellipsoid2.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ███████ ██ ██ ██ ██████ ███████ ███████ -- ██ ██ ██ ██ ██ ██ ██ ██ -- █████ ██ ██ ██ ██████ ███████ █████ diff --git a/worldeditadditions/lib/ellipsoidapply.lua b/worldeditadditions/lib/ellipsoidapply.lua index bced55e..7d4253a 100644 --- a/worldeditadditions/lib/ellipsoidapply.lua +++ b/worldeditadditions/lib/ellipsoidapply.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ███████ ██ ██ ██ ██████ ███████ ██████ ██ ██████ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ -- █████ ██ ██ ██ ██████ ███████ ██ ██ ██ ██ ██ @@ -16,9 +19,9 @@ local Vector3 = wea_c.Vector3 --- Similar to cubeapply, except that it takes 2 positions and only keeps an ellipsoid-shaped area defined by the boundaries of the defined region. -- Takes a backup copy of the defined region, runs the given function, and then -- restores the bits around the edge that aren't inside the largest ellipsoid that will fit inside the defined region. --- @param {Position} pos1 The 1st position defining the region boundary --- @param {Position} pos2 The 2nd positioon defining the region boundary --- @param {Function} func The function to call that performs the action in question. It is expected that the given function will accept no arguments. +-- @param pos1 Vector3 The 1st position defining the region boundary +-- @param pos2 Vector3 The 2nd positioon defining the region boundary +-- @param func function The function to call that performs the action in question. It is expected that the given function will accept no arguments. function worldeditadditions.ellipsoidapply(pos1, pos2, func) local time_taken_all = wea_c.get_ms_time() pos1, pos2 = Vector3.sort(pos1, pos2) diff --git a/worldeditadditions/lib/fillcaves.lua b/worldeditadditions/lib/fillcaves.lua index 593be29..22ed734 100644 --- a/worldeditadditions/lib/fillcaves.lua +++ b/worldeditadditions/lib/fillcaves.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + --- Fill caves command. Fills underneath non-air nodes in the defined region. -- @param pos1 Vector3 pos1 of the defined region to fill caves in. -- @param pos2 Vector3 pos2 of the defined region to fill caves in. diff --git a/worldeditadditions/lib/floodfill.lua b/worldeditadditions/lib/floodfill.lua index a6d2c62..07df40d 100644 --- a/worldeditadditions/lib/floodfill.lua +++ b/worldeditadditions/lib/floodfill.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + --- Flood-fill command for complex lakes etc. -- @param start_pos Vector3 The position to start floodfilling from. diff --git a/worldeditadditions/lib/forest.lua b/worldeditadditions/lib/forest.lua index 97f3eb9..4f18980 100644 --- a/worldeditadditions/lib/forest.lua +++ b/worldeditadditions/lib/forest.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + --- Places saplings and bonemeals them automatically to create a forest. -- Note that the defined region is *the region that saplings are placed in*, so nodes may ultimately end up being replaced outside the defined region depending on the size of the tree that grows. -- @param pos1 Vector3 pos1 of the defined region to place saplings in. diff --git a/worldeditadditions/lib/hollow.lua b/worldeditadditions/lib/hollow.lua index dc38d58..26a6953 100644 --- a/worldeditadditions/lib/hollow.lua +++ b/worldeditadditions/lib/hollow.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ██ ██ ██████ ██ ██ ██████ ██ ██ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ -- ███████ ██ ██ ██ ██ ██ ██ ██ █ ██ diff --git a/worldeditadditions/lib/layers.lua b/worldeditadditions/lib/layers.lua index c4bc081..6524cd1 100644 --- a/worldeditadditions/lib/layers.lua +++ b/worldeditadditions/lib/layers.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ██ █████ ██ ██ ███████ ██████ ███████ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ -- ██ ███████ ████ █████ ██████ ███████ diff --git a/worldeditadditions/lib/line.lua b/worldeditadditions/lib/line.lua index 414862e..ea8bb5b 100644 --- a/worldeditadditions/lib/line.lua +++ b/worldeditadditions/lib/line.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ██ ██ ███ ██ ███████ -- ██ ██ ████ ██ ██ diff --git a/worldeditadditions/lib/maze2d.lua b/worldeditadditions/lib/maze2d.lua index 790c5e3..2701f14 100644 --- a/worldeditadditions/lib/maze2d.lua +++ b/worldeditadditions/lib/maze2d.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + ---------------------------------- -- function to print out the world diff --git a/worldeditadditions/lib/maze3d.lua b/worldeditadditions/lib/maze3d.lua index 0be3381..8d99e43 100644 --- a/worldeditadditions/lib/maze3d.lua +++ b/worldeditadditions/lib/maze3d.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + ---------------------------------- -- function to print out the world ---------------------------------- diff --git a/worldeditadditions/lib/move.lua b/worldeditadditions/lib/move.lua index 845bba6..1a06242 100644 --- a/worldeditadditions/lib/move.lua +++ b/worldeditadditions/lib/move.lua @@ -2,6 +2,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ███ ███ ██████ ██ ██ ███████ -- ████ ████ ██ ██ ██ ██ ██ -- ██ ████ ██ ██ ██ ██ ██ █████ diff --git a/worldeditadditions/lib/nodeapply.lua b/worldeditadditions/lib/nodeapply.lua index 2c7a9bc..0208278 100644 --- a/worldeditadditions/lib/nodeapply.lua +++ b/worldeditadditions/lib/nodeapply.lua @@ -2,6 +2,8 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 local NodeListMatcher = wea_c.NodeListMatcher +--- +-- @module worldeditadditions -- ███ ██ ██████ ██████ ███████ diff --git a/worldeditadditions/lib/noiseapply2d.lua b/worldeditadditions/lib/noiseapply2d.lua index 296a642..fd8d2b5 100644 --- a/worldeditadditions/lib/noiseapply2d.lua +++ b/worldeditadditions/lib/noiseapply2d.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ███ ██ ██████ ██ ███████ ███████ █████ ██████ ██████ ██ ██ ██ ██████ ██████ -- ████ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ -- ██ ██ ██ ██ ██ ██ ███████ █████ ███████ ██████ ██████ ██ ████ █████ ██ ██ @@ -9,10 +12,10 @@ local Vector3 = wea_c.Vector3 --- Similar to cubeapply, except that it takes 2 positions and randomly keeps changes based on a noise pattern. -- Takes a backup copy of the defined region, runs the given function, and then --- restores the bits that aren't above the nosie threshold. --- @param {Position} pos1 The 1st position defining the region boundary --- @param {Position} pos2 The 2nd positioon defining the region boundary --- @param {Function} func The function to call that performs the action in question. It is expected that the given function will accept no arguments. +-- restores the bits that aren't above the noise threshold. +-- @param pos1 Vector3 The 1st position defining the region boundary +-- @param pos2 Vector3 The 2nd positioon defining the region boundary +-- @param func function The function to call that performs the action in question. It is expected that the given function will accept no arguments. function worldeditadditions.noiseapply2d(pos1, pos2, threshold, scale, func) local time_taken_all = wea_c.get_ms_time() pos1, pos2 = Vector3.sort(pos1, pos2) diff --git a/worldeditadditions/lib/overlay.lua b/worldeditadditions/lib/overlay.lua index 935f299..7c93f7a 100644 --- a/worldeditadditions/lib/overlay.lua +++ b/worldeditadditions/lib/overlay.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + --- Overlap command. Places a specified node on top of each column. -- @param pos1 Vector3 pos1 of the defined region to perform the overlay operation in. -- @param pos2 Vector3 pos2 of the defined region to perform the overlay operation in. diff --git a/worldeditadditions/lib/replacemix.lua b/worldeditadditions/lib/replacemix.lua index 9577a4e..688724d 100644 --- a/worldeditadditions/lib/replacemix.lua +++ b/worldeditadditions/lib/replacemix.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ██████ ███████ ██████ ██ █████ ██████ ███████ ███ ███ ██ ██ ██ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ████ ██ ██ ██ diff --git a/worldeditadditions/lib/revolve.lua b/worldeditadditions/lib/revolve.lua index 49202d0..dd00036 100644 --- a/worldeditadditions/lib/revolve.lua +++ b/worldeditadditions/lib/revolve.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ██████ ███████ ██ ██ ██████ ██ ██ ██ ███████ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ -- ██████ █████ ██ ██ ██ ██ ██ ██ ██ █████ diff --git a/worldeditadditions/lib/rotate.lua b/worldeditadditions/lib/rotate.lua index 0dc0da9..d9db6e5 100644 --- a/worldeditadditions/lib/rotate.lua +++ b/worldeditadditions/lib/rotate.lua @@ -1,6 +1,9 @@ local weac = worldeditadditions_core local Vector3 = weac.Vector3 +--- +-- @module worldeditadditions + -- ██████ ██████ ████████ █████ ████████ ███████ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ -- ██████ ██ ██ ██ ███████ ██ █████ diff --git a/worldeditadditions/lib/scale.lua b/worldeditadditions/lib/scale.lua index 5d494ff..63112b6 100644 --- a/worldeditadditions/lib/scale.lua +++ b/worldeditadditions/lib/scale.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + --- Scales the defined region by the given scale factor in the given anchors. -- Scale factor vectors containing both scale up and scale down operations are -- split into 2 different scale operations automatically. diff --git a/worldeditadditions/lib/scale_down.lua b/worldeditadditions/lib/scale_down.lua index 3d14adf..91f57db 100644 --- a/worldeditadditions/lib/scale_down.lua +++ b/worldeditadditions/lib/scale_down.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ███████ ██████ █████ ██ ███████ ██████ ██████ ██ ██ ███ ██ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ -- ███████ ██ ███████ ██ █████ ██ ██ ██ ██ ██ █ ██ ██ ██ ██ @@ -8,6 +11,7 @@ local Vector3 = wea_c.Vector3 -- ███████ ██████ ██ ██ ███████ ███████ ███████ ██████ ██████ ███ ███ ██ ████ --- Scales the defined region down by the given scale factor in the given directions. +-- You probably want worldeditadditions.scale, which scales in both directions. -- @param pos1 Vector Position 1 of the defined region, -- @param pos2 Vector Position 2 of the defined region. -- @param scale Vector The scale factor - as a vector - by which to scale down. diff --git a/worldeditadditions/lib/scale_up.lua b/worldeditadditions/lib/scale_up.lua index bfd19e7..cf99bf7 100644 --- a/worldeditadditions/lib/scale_up.lua +++ b/worldeditadditions/lib/scale_up.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ███████ ██████ █████ ██ ███████ ██ ██ ██████ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ @@ -8,7 +11,8 @@ local Vector3 = wea_c.Vector3 -- ██ ██ ██ ██ ██ ██ ██ ██ ██ -- ███████ ██████ ██ ██ ███████ ███████ ███████ ██████ ██ ---- Scales the defined region down by the given scale factor in the given directions. +--- Scales the defined region up by the given scale factor in the given directions. +-- You probably want worldeditadditions.scale, which scales in both directions. -- @param pos1 Vector Position 1 of the defined region, -- @param pos2 Vector Position 2 of the defined region. -- @param scale Vector The scale factor - as a vector - by which to scale down. diff --git a/worldeditadditions/lib/selection/selection.lua b/worldeditadditions/lib/selection/selection.lua index 02032e0..f3d08ce 100644 --- a/worldeditadditions/lib/selection/selection.lua +++ b/worldeditadditions/lib/selection/selection.lua @@ -1,5 +1,11 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 + +--- Functions for handling selections of the defined pos1/pos2 region. +-- +-- These functions primarily back the [cloud wand](https://worldeditadditions.mooncarrot.space/Reference/#cloud). To manipulate positions directly, see the [`worldeditadditions_core.pos`]() namespace. +-- @namespace worldeditadditions.selection + -- ███████ ███████ ██ ███████ ██████ ████████ ██ ██████ ███ ██ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██ -- ███████ █████ ██ █████ ██ ██ ██ ██ ██ ██ ██ ██ @@ -13,6 +19,7 @@ local selection = {} -- makes a selection from the provided point. -- @param name string Player name. -- @param pos vector The position to include. +-- @returns void function selection.add_point(name, newpos) if newpos ~= nil then -- print("DEBUG:selection.add_point newpos", newpos) @@ -64,6 +71,7 @@ end --- Clears current selection, *but only pos1 and pos2! -- @param name string Player name. +-- @returns void function selection.clear_points(name) wea_c.pos.clear(name) -- worldedit.marker_update(name) diff --git a/worldeditadditions/lib/selection/stack.lua b/worldeditadditions/lib/selection/stack.lua index d2ab407..3ccfe58 100644 --- a/worldeditadditions/lib/selection/stack.lua +++ b/worldeditadditions/lib/selection/stack.lua @@ -2,6 +2,7 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 --- Holds the per-user selection stacks. +-- @namespace worldeditadditions.sstack = {} local sstack_max = 100 diff --git a/worldeditadditions/lib/spiral_circle.lua b/worldeditadditions/lib/spiral_circle.lua index df840ec..f46dc59 100644 --- a/worldeditadditions/lib/spiral_circle.lua +++ b/worldeditadditions/lib/spiral_circle.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ███████ ██████ ██ ██████ █████ ██ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ -- ███████ ██████ ██ ██████ ███████ ██ diff --git a/worldeditadditions/lib/spiral_square.lua b/worldeditadditions/lib/spiral_square.lua index 4265369..3f358a8 100644 --- a/worldeditadditions/lib/spiral_square.lua +++ b/worldeditadditions/lib/spiral_square.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ███████ ██████ ██ ██████ █████ ██ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ -- ███████ ██████ ██ ██████ ███████ ██ diff --git a/worldeditadditions/lib/spline.lua b/worldeditadditions/lib/spline.lua index e3b4437..c21b77a 100644 --- a/worldeditadditions/lib/spline.lua +++ b/worldeditadditions/lib/spline.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ███████ ██████ ██ ██ ███ ██ ███████ -- ██ ██ ██ ██ ██ ████ ██ ██ -- ███████ ██████ ██ ██ ██ ██ ██ █████ diff --git a/worldeditadditions/lib/subdivide.lua b/worldeditadditions/lib/subdivide.lua index 8f4ca1d..958fa3b 100644 --- a/worldeditadditions/lib/subdivide.lua +++ b/worldeditadditions/lib/subdivide.lua @@ -1,15 +1,24 @@ +local wea_c = worldeditadditions_core +local wea = worldeditadditions +local Vector3 = wea_c.Vector3 + +--- +-- @module worldeditadditions + -- ███████ ██ ██ ██████ ██████ ██ ██ ██ ██ ██████ ███████ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ -- ███████ ██ ██ ██████ ██ ██ ██ ██ ██ ██ ██ ██ █████ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ -- ███████ ██████ ██████ ██████ ██ ████ ██ ██████ ███████ -local wea_c = worldeditadditions_core -local wea = worldeditadditions -local Vector3 = wea_c.Vector3 +-- NOTE this isn't a trip dash --- 'cause it's local-only to this file -- Counts the number of chunks in the given area. -- Maths is now done properly. Values from this new implementation were tested -- with 1000 random pos1, pos2, and chunk_size combinations and found to be identical. +-- @internal +-- @param pos1 Vector3 Position 1 of the defined region. +-- @param pos2 Vector3 Position 2 of the defined region. +-- @param chunk_size Vector3 Size of the chunks to subdivide into.. local function count_chunks(pos1, pos2, chunk_size) -- Assume pos1 & pos2 are sorted local dimensions = Vector3.new( @@ -136,11 +145,11 @@ end -- The emerge property contains a table that holds a running total of statistics -- about what Minetest did to emerge the requested blocks in the world. -- callback_complete is called at the end of the process, and pos1 + pos2 will be set to that of the entire region. --- @param {Vector} pos1 The first position defining the area to emerge. --- @param {Vector} pos2 The second position defining the area to emerge. --- @param {Vector} chunk_size The size of the chunks to subdivide into. --- @param {function} callback The callback to call for each block. --- @param {function} callback The callback to call upon completion. +-- @param pos1 Vector The first position defining the area to emerge. +-- @param pos2 Vector The second position defining the area to emerge. +-- @param chunk_size Vector The size of the chunks to subdivide into. +-- @param callback function The callback to call for each block. +-- @param callback function The callback to call upon completion. function worldeditadditions.subdivide(pos1, pos2, chunk_size, callback_subblock, callback_complete) pos1, pos2 = worldedit.sort_pos(pos1, pos2) local chunks_total = count_chunks(pos1, pos2, chunk_size) diff --git a/worldeditadditions/lib/torus.lua b/worldeditadditions/lib/torus.lua index 7954180..eda8d13 100644 --- a/worldeditadditions/lib/torus.lua +++ b/worldeditadditions/lib/torus.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + --- Generates a torus shape at the given position with the given parameters. -- @param position Vector The position at which to generate the torus. -- @param major_radius number The major radius of the torus - i.e. the distance from the middle to the ring. diff --git a/worldeditadditions/lib/walls.lua b/worldeditadditions/lib/walls.lua index 2a5d707..95eefa6 100644 --- a/worldeditadditions/lib/walls.lua +++ b/worldeditadditions/lib/walls.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ██ ██ █████ ██ ██ ███████ -- ██ ██ ██ ██ ██ ██ ██ -- ██ █ ██ ███████ ██ ██ ███████ diff --git a/worldeditadditions/lib/wireframe/corner_set.lua b/worldeditadditions/lib/wireframe/corner_set.lua index b67f58d..d98568e 100644 --- a/worldeditadditions/lib/wireframe/corner_set.lua +++ b/worldeditadditions/lib/wireframe/corner_set.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ██████ ██████ ██████ ███ ██ ███████ ██████ ███████ ███████ ████████ -- ██ ██ ██ ██ ██ ████ ██ ██ ██ ██ ██ ██ ██ -- ██ ██ ██ ██████ ██ ██ ██ █████ ██████ ███████ █████ ██ diff --git a/worldeditadditions/lib/wireframe/make_compass.lua b/worldeditadditions/lib/wireframe/make_compass.lua index 9ccd973..7e21933 100644 --- a/worldeditadditions/lib/wireframe/make_compass.lua +++ b/worldeditadditions/lib/wireframe/make_compass.lua @@ -1,6 +1,9 @@ local wea_c = worldeditadditions_core local Vector3 = wea_c.Vector3 +--- +-- @module worldeditadditions + -- ███ ███ █████ ██ ██ ███████ ██████ ██████ ███ ███ ██████ █████ ███████ ███████ -- ████ ████ ██ ██ ██ ██ ██ ██ ██ ██ ████ ████ ██ ██ ██ ██ ██ ██ -- ██ ████ ██ ███████ █████ █████ ██ ██ ██ ██ ████ ██ ██████ ███████ ███████ ███████ @@ -8,9 +11,9 @@ local Vector3 = wea_c.Vector3 -- ██ ██ ██ ██ ██ ██ ███████ ██████ ██████ ██ ██ ██ ██ ██ ███████ ███████ --- Makes a compass with a bead pointing north (+Z). --- @param {Position} pos1 The 1st position defining the WorldEdit selection --- @param {string} node1 Name of the node to place --- @param {string} node2 Name of the node of the bead +-- @param pos1 Vector3 The 1st position defining the WorldEdit selection +-- @param node1 string Name of the node to place +-- @param node2 string Name of the node of the bead function worldeditadditions.make_compass(pos1,node1,node2) pos1 = Vector3.clone(pos1) minetest.set_node(pos1 + Vector3.new(0,1,3), { name = node2 }) diff --git a/worldeditadditions/lib/wireframe/wire_box.lua b/worldeditadditions/lib/wireframe/wire_box.lua index cf8dea1..efcd516 100644 --- a/worldeditadditions/lib/wireframe/wire_box.lua +++ b/worldeditadditions/lib/wireframe/wire_box.lua @@ -1,5 +1,8 @@ local v3 = worldeditadditions_core.Vector3 +--- +-- @module worldeditadditions + -- ██ ██ ██ ██████ ███████ ██████ ██████ ██ ██ -- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ -- ██ █ ██ ██ ██████ █████ ██████ ██ ██ ███ @@ -7,9 +10,9 @@ local v3 = worldeditadditions_core.Vector3 -- ███ ███ ██ ██ ██ ███████ ██████ ██████ ██ ██ --- Fills the edges of the selection box with nodes. --- @param {Position} pos1 The 1st position defining the WorldEdit selection --- @param {Position} pos2 The 2nd positioon defining the WorldEdit selection --- @param {string} node Name of the node to place +-- @param pos1 Vector3 The 1st position defining the WorldEdit selection +-- @param pos2 Vector3 The 2nd positioon defining the WorldEdit selection +-- @param node string Name of the node to place function worldeditadditions.wire_box(pos1,pos2,node) local node_id_replace = minetest.get_content_id(node) local ps1, ps2 = v3.sort(pos1,pos2)