diff --git a/CHANGELOG.md b/CHANGELOG.md index ddc7ddb..559f0be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ It's about time I started a changelog! This will serve from now on as the master - Add `//many` for executing a command many times in a row - Add **experimental** `//erode` command - Add `//fillcaves` command - fills in all air nodes beneath non air-nodes + - Add `//forest` command for quickly generating forests ## v1.8: The Quality of Life Update (17th July 2020) diff --git a/Chat-Command-Reference.md b/Chat-Command-Reference.md index aed1c05..f30e1a6 100644 --- a/Chat-Command-Reference.md +++ b/Chat-Command-Reference.md @@ -48,6 +48,42 @@ The list of nodes has a form similar to that of a chance list you might find in //layers cobble 2 dirt ``` +### `//forest [] [] [] [ []] ...` +Plants and grows saplings to generate a forest. A density value is optionally taken, which controls the overall density of the forest that is generated. The `bonemeal` mod is required - just like for the [`//bonemeal`](#bonemeal-strength-chance) command. + +The density defaults to 1, acts like a multiplier, and is not affected by the chances of all saplings listed (e.g. you can have a sapling with a chance of 1-in-50, and the overall density of the forest will be unaffected). For example, 2 results in a forest twice as dense as the default, and 0.5 a forest half as dense as the default density. + +The tree types are provided as a list of names and weights, just like [`//overlay`](#overlay-node_name_a-chance_a-node_name_b-chance_b-node_name_n-chance_n-), `//mix`, `//layers`, etc. Unlike the aforementioned commands however, `//forest` has an additional layer of alias resolution to ease the process of determining what the name of the sapling is you want to use to generate forests with. See [`//saplingaliases`](#saplingaliases-aliases-all_saplings) for more details. + +Saplings are placed with [`//overlay`](#overlay-node_name_a-chance_a-node_name_b-chance_b-node_name_n-chance_n-) and grown using the same method that's used by the `//bonemeal` command. Up to 100 attempts are made to grow placed saplings. If all of those attempts fail (success is determined by whether the sapling is still present or not), the sapling is removed and the failure counter is incremented. + +Currently, the following mods are known to have aliases registered: + + - `default` + - [`moretrees`](https://content.minetest.net/packages/VanessaE/moretrees/) (warning: these saplings don't appear to work very well with the `bonemeal` mod - assistance in debugging this would be very helpful) + - [`cool_trees`](https://content.minetest.net/packages/runs/cool_trees/) + +``` +//forest aspen +//forest 2 oak 3 aspen pine +//forest 0.5 acacia +``` + +### `//saplingaliases [aliases|all_saplings]` +Lists all the currently registered sapling aliases in alphabetical order. Optionally take a single parameter, which is the operating mode. Current implemented operating modes: + +Mode | Description +----------------|---------------------- +`aliases` | The default. Lists all the currently registered sapling aliases in alphabetical order. +`all_saplings` | Spins through all the nodes currently registered in Minetest, and lists all the nodes that have the `sapling` group. + +``` +//saplingaliases +//saplingaliases all_saplings +//saplingaliases aliases +``` + + ### `//fillcaves []` Fills in all airlike nodes beneath non airlike nodes, which gives the effect of filling in caves. Defaults to filling in with stone, but this can be customised. diff --git a/README.md b/README.md index 91b7982..6be9b22 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,6 @@ The detailed explanations have moved! Check them out [here](https://github.com/s - [`//maze3d [ [ [ []]]]`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/master/Chat-Command-Reference.md#maze3d-replace_node-seed) ### Misc - - [`//bonemeal [ []]`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/master/Chat-Command-Reference.md#bonemeal-strength-chance) - [`//replacemix [] [] [ []] [ []] ....`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/master/Chat-Command-Reference.md#replacemix-target_node-chance-replace_node_a-chance_a-replace_node_b-chance_b-replace_node_n-chance_n-) - [`//floodfill [ []]`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/master/Chat-Command-Reference.md#floodfill-replace_node-radius-floodfill) @@ -44,6 +43,11 @@ The detailed explanations have moved! Check them out [here](https://github.com/s - [`//convolve [[,]] []`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/master/Chat-Command-Reference.md#convolve-kernel-widthheight-sigma) - [`//erode [ [ []] [ []] ...]`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/master/Chat-Command-Reference.md#erode-snowballs-key_1-value_1-key_2-value_2-) **experimental** +### Flora + - [`//bonemeal [ []]`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/master/Chat-Command-Reference.md#bonemeal-strength-chance) + - [`//forest [] [] [] [ []] ...`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/master/Chat-Command-Reference.md#forest-density-sapling_a-chance_a-sapling_b-chance_b-sapling_N-chance_N-) + - [`//saplingaliases [aliases|all_saplings]`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/master/Chat-Command-Reference.md#saplingaliases-aliases-all_saplings) + ### Statistics - [`//count`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/master/Chat-Command-Reference.md#count) diff --git a/worldeditadditions/depends.txt b/worldeditadditions/depends.txt index 7a0a3ba..ae1d9ed 100644 --- a/worldeditadditions/depends.txt +++ b/worldeditadditions/depends.txt @@ -1,2 +1,5 @@ worldedit bonemeal? +cool_trees? +default? +moretrees? diff --git a/worldeditadditions_commands/init.lua b/worldeditadditions_commands/init.lua index 1ce100b..420e201 100644 --- a/worldeditadditions_commands/init.lua +++ b/worldeditadditions_commands/init.lua @@ -32,7 +32,6 @@ dofile(we_c.modpath.."/commands/maze.lua") dofile(we_c.modpath.."/commands/replacemix.lua") dofile(we_c.modpath.."/commands/convolve.lua") dofile(we_c.modpath.."/commands/erode.lua") -dofile(we_c.modpath.."/commands/forest.lua") dofile(we_c.modpath.."/commands/count.lua") dofile(we_c.modpath.."/commands/saplingaliases.lua") @@ -42,8 +41,9 @@ dofile(we_c.modpath.."/commands/subdivide.lua") -- Don't registry the //bonemeal command if the bonemeal mod isn't present if minetest.get_modpath("bonemeal") then dofile(we_c.modpath.."/commands/bonemeal.lua") + dofile(we_c.modpath.."/commands/forest.lua") else - minetest.log("action", "[WorldEditAdditions] bonemeal mod not detected: //bonemeal command not registered (if you see this message and you're using an alternative mod that provides bonemeal, please get in touch by opening an issue)") + minetest.log("action", "[WorldEditAdditions] bonemeal mod not detected: //bonemeal and //forest commands not registered (if you see this message and you're using an alternative mod that provides bonemeal, please get in touch by opening an issue)") end