mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-23 23:53:44 +01:00
Default to square spirals
This commit is contained in:
parent
21902b8512
commit
f5133d287b
@ -160,7 +160,7 @@ Creates vertical walls of `<replace_node>` around the inside edges of the define
|
|||||||
|
|
||||||
|
|
||||||
### `//spiral2 [<circle|square>] [<replace_node=dirt> [<interval=3> [<acceleration=0>] ] ]`
|
### `//spiral2 [<circle|square>] [<replace_node=dirt> [<interval=3> [<acceleration=0>] ] ]`
|
||||||
Generates both square and circular spiral shapes with the given `<replace_node>`. The interval defines the gap between the spiral in nodes, and the acceleration defines by how much the interval should be increased (a value of 1 means 1 node per revolution).
|
Generates both square and circular spiral shapes with the given `<replace_node>` - defaulting to square spirals. The interval defines the gap between the spiral in nodes, and the acceleration defines by how much the interval should be increased (a value of 1 means 1 node per revolution).
|
||||||
|
|
||||||
```
|
```
|
||||||
//spiral2
|
//spiral2
|
||||||
|
@ -4,17 +4,17 @@ local Vector3 = wea.Vector3
|
|||||||
|
|
||||||
worldedit.register_command("spiral2", {
|
worldedit.register_command("spiral2", {
|
||||||
params = "[<circle|square>] [<replace_node=dirt> [<interval=3> [<acceleration=0>] ] ]",
|
params = "[<circle|square>] [<replace_node=dirt> [<interval=3> [<acceleration=0>] ] ]",
|
||||||
description = "Generates a spiral that fills the defined region using the specified replace node. The spiral is either circular (default) or square in shape. The interval specifies the distance between the walls of the spiral, and the acceleration specifies how quickly this value should increase.",
|
description = "Generates a spiral that fills the defined region using the specified replace node. The spiral is either square (default) or circular in shape. The interval specifies the distance between the walls of the spiral, and the acceleration specifies how quickly this value should increase.",
|
||||||
privs = { worldedit = true },
|
privs = { worldedit = true },
|
||||||
require_pos = 2,
|
require_pos = 2,
|
||||||
parse = function(params_text)
|
parse = function(params_text)
|
||||||
if not params_text then params_text = "" end
|
if not params_text then params_text = "" end
|
||||||
params_text = wea.trim(params_text)
|
params_text = wea.trim(params_text)
|
||||||
if params_text == "" then return true, "circle", "dirt", 3, 0 end
|
if params_text == "" then return true, "square", "dirt", 3, 0 end
|
||||||
|
|
||||||
local parts = wea.split_shell(params_text)
|
local parts = wea.split_shell(params_text)
|
||||||
|
|
||||||
local mode = "circle"
|
local mode = "square"
|
||||||
local target_node = "dirt"
|
local target_node = "dirt"
|
||||||
local target_node_found = false
|
local target_node_found = false
|
||||||
local interval = 3
|
local interval = 3
|
||||||
|
Loading…
Reference in New Issue
Block a user