Merge branch 'main' into VorTechnix

This commit is contained in:
VorTechnix 2021-10-10 18:37:58 -07:00
commit 0352595e41
11 changed files with 900 additions and 541 deletions

View file

@ -2,23 +2,30 @@ const fs = require("fs");
const path = require("path");
const parse_sections = require("./lib/parse_sections.js");
const sections = parse_sections(fs.readFileSync(
let { sections, categories } = parse_sections(fs.readFileSync(
path.resolve(
__dirname,
`../Chat-Command-Reference.md`
),
"utf-8"
));
))
console.log(`REFERENCE SECTION TITLES`, sections.slice(1)
.sort((a, b) => a.title.localeCompare(b.title)).map(s => s.title));
sections = sections.slice(1).sort((a, b) => a.title.replace(/^\/+/g, "").localeCompare(
b.title.replace(/^\/+/g, "")));
console.log(`REFERENCE SECTION TITLES`)
console.log(sections
.map(s => [s.category, s.title].join(`\t`)).join(`\n`));
console.log(`************************`);
console.log(`REFERENCE SECTION COLOURS`, categories);
module.exports = {
layout: "theme.njk",
title: "Reference",
tags: "navigable",
date: "2001-01-01",
section_intro: sections[0],
sections_help: sections.slice(1)
.sort((a, b) => a.title.localeCompare(b.title))
sections_help: sections, // Remove the very beginning bit
categories: [...categories.keys()].join("|")
}

View file

@ -1,6 +1,6 @@
<main>
<section class="panel-generic">
<h1 id="{{ section.slug }}">{{ section_intro.title }}</h1>
<h1 id="#reference">Reference</h1>
<p>This is the full chat command reference for WorldEditAdditions. It has 2 parts:</p>
<ol>
@ -8,7 +8,8 @@
<li>A full reference, with detailed explanations for each command</li>
</ol>
<p>After the contents, there is a <a href="#filter">filter box</a> for filtering the detailed explanations to quickly find the one you're after.</p>
<p>There is also a <a href="#filter">filter box</a> for filtering the detailed explanations to quickly find the one you're after.</p>
</section>
<section id="filter" class="panel-generic">
@ -25,16 +26,23 @@
<section class="panel-generic">
<h2 id="contents" class="linked-section-heading">
<a class="section-link" href="#{{ section.slug }}">&#x1f517; <!-- Link Symbol --></a>
<span>Contents</span>
<span class="title">Contents</span>
</h2>
<p>TODO: Group commands here by category (*especially* the meta commands)</p>
<div class="command-ordering-tabs">
<button class="active" data-mode="alphabetical">Alphabetical</button>
<button data-mode="categorical">Categorical</button>
</div>
<input type="hidden" id="category-names" value="{{ categories }}" />
<div class="command-container">
<h3>Alphabetical</h3>
<ul class="command-list">
{% for section in sections_help %}
<li data-filtermode-force="all"><a href="#{{ section.slug }}">
<li data-filtermode-force="all" data-category="{{ section.category }}" style="--cat-colour: {{ section.category_colour }};"><a href="#{{ section.slug }}">
<code>{{ section.title }}</code>
</a></li>
{% endfor %}
</ul>
</div>
</section>
<script>
@ -42,6 +50,81 @@
return text.toLocaleLowerCase().includes(query);
}
function handle_display_mode(event) {
set_display_mode(event.target.dataset.mode);
localStorage.setItem("commandlist-displaymode", event.target.dataset.mode);
}
function sort_command_list(list) {
list.sort((a, b) =>
a.querySelector("a").href.localeCompare(b.querySelector("a").href))
}
function nodelist2array(list) {
const result = [];
for(let i = 0; i < list.length; i++) result.push(list[i]);
return result;
}
function set_display_mode(mode) {
console.info(`SET DISPLAYMODE ${mode}`)
const commands = nodelist2array(document.querySelectorAll(`.command-list li`));
const container = document.querySelector(`.command-container`);
switch(mode) {
case "categorical":
const sections = Object.create(null);
for(const command of [...commands]) {
const cat = command.dataset.category;
if(!(sections[cat] instanceof Array))
sections[cat] = [];
sections[cat].push(command);
}
const section_names = document.querySelector("#category-names").value
.split("|");
const fragment = new DocumentFragment();
for(const section_name of section_names) {
sort_command_list(sections[section_name]);
const header = document.createElement("h3");
header.appendChild(document.createTextNode(section_name));
fragment.appendChild(header);
const list = document.createElement("ul");
list.classList.add("command-list", "coloured");
for(const item of sections[section_name])
list.appendChild(item);
fragment.appendChild(list);
}
container.replaceChildren(fragment);
break;
case "alphabetical":
const alpha_fragment = new DocumentFragment();
const alpha_header = document.createElement("h3");
alpha_header.appendChild(document.createTextNode("Alphabetical"));
alpha_fragment.appendChild(alpha_header);
const alpha_list = document.createElement("ul");
alpha_list.classList.add("command-list");
alpha_list.classList.add("command-alpha_list");
sort_command_list(commands);
for(let i = 0; i < commands.length; i++)
alpha_list.appendChild(commands[i]);
alpha_fragment.appendChild(alpha_list);
container.replaceChildren(alpha_fragment);
break;
}
const el_alpha = document.querySelector(".command-ordering-tabs [data-mode=alphabetical]");
const el_cats = document.querySelector(".command-ordering-tabs [data-mode=categorical]");
el_alpha.classList.toggle("active");
el_cats.classList.toggle("active");
}
function do_filter() {
let el_search = document.querySelector("#input-filter");
let el_searchall = document.querySelector("#input-searchall");
@ -68,7 +151,7 @@
switch(mode_this) {
case "all":
show = search_text(query,
el_next.textContent
el_next.textContent + ` ` + el_next.dataset.category
);
break;
case "header":
@ -87,18 +170,28 @@
window.addEventListener("load", (_event) => {
let el_search = document.querySelector("#input-filter");
let el_searchall = document.querySelector("#input-searchall");
let els_cats = document.querySelectorAll(".command-ordering-tabs button");
el_search.addEventListener("input", do_filter);
el_search.addEventListener("search", do_filter);
el_searchall.addEventListener("change", do_filter);
for(let i = 0; i < els_cats.length; i++) {
els_cats[i].addEventListener("click", handle_display_mode);
els_cats[i].addEventListener("touchend", handle_display_mode);
}
if(localStorage.getItem("commandlist-displaymode") !== null)
set_display_mode(localStorage.getItem("commandlist-displaymode"))
});
</script>
{% for section in sections_help %}
<section class="panel-generic filterable">
<section class="panel-generic filterable" style="--cat-colour: {{ section.category_colour_dark }};">
<h2 id="{{ section.slug }}" class="linked-section-heading">
<a class="section-link" href="#{{ section.slug }}">&#x1f517; <!-- Link Symbol --></a>
<span>{{ section.title }}</span>
<span class="title">{{ section.title }}</span>
<span class="category">{{ section.category }}</span>
</h2>
{{ section.content }}

View file

@ -78,10 +78,18 @@ h1, h2, h3, h4, h5, h6 {
.linked-section-heading > a.section-link:hover {
opacity: 1;
}
.linked-section-heading > span {
.linked-section-heading > span.title {
flex: 1;
word-wrap: anywhere;
}
.linked-section-heading > span.category {
font-size: 0.75em;
border-radius: 1em;
background: var(--cat-colour);
padding: 0 0.5em;
line-height: 1.5;
align-self: flex-start;
}
nav {
background: var(--bg-bright);
@ -353,6 +361,17 @@ footer {
background: var(--pattern-hex), var(--bg-transcluscent);
}
.command-ordering-tabs {
display: flex;
gap: 1em;
margin-bottom: 2em;
}
.command-ordering-tabs button {
flex: 1;
font-size: 1.1em;
padding: 0.5em;
}
.command-ordering-tabs button.active { font-weight: bold; }
.command-list {
margin: 0;
@ -363,11 +382,16 @@ footer {
.command-list > li > a {
text-decoration: none;
}
.command-list.coloured code { background: var(--cat-colour); }
.command-list code {
display: block;
padding: 0.5em;
box-sizing: border-box;
margin: 0.5em;
margin: 0.5em 0;
}
.filterable {
border: 0.2em solid var(--cat-colour);
}

View file

@ -1,7 +1,11 @@
const crypto = require("crypto");
const htmlentities = require("html-entities");
const markdown = require("markdown-it")({
xhtmlOut: true
});
const chroma = require("chroma-js");
const markdown_prism = require("markdown-it-prism");
markdown.use(markdown_prism, {
@ -16,27 +20,66 @@ markdown.use(markdown_prism, {
}
});
module.exports = function parse_sections(source) {
const lines = source.split(/\r?\n/gi);
const result = [];
let acc = [];
for(let line of lines) {
if(line.startsWith(`#`) && !line.startsWith(`###`)) {
function extract_title(line) {
return line.match(/#+\s+(.+)\s*/)[1].replace(/^`*|`*$/g, "")
}
if(acc.length > 0) {
let title = acc[0].match(/#+\s+(.+)\s*/)[1].replace(/^`*|`*$/g, "");
result.push({
function make_section(acc, cat_current, cats) {
let title = extract_title(acc[0]);
return {
category: cat_current,
category_colour: cats.get(cat_current),
category_colour_dark: chroma(cats.get(cat_current))
.set("hsl.s", 0.8)
.set("hsl.l", "*0.6")
.css("hsl"),
title: htmlentities.encode(title),
slug: title.toLowerCase().replace(/[^a-z0-9-_\s]+/gi, "")
.replace(/\s+/g, "-")
.replace(/-.*$/, ""),
content: markdown.render(acc.slice(1).join("\n"))
});
};
}
module.exports = function parse_sections(source) {
const cats = new Map();
source.match(/^##\s+.*$/gm)
.map(extract_title)
.map((item, i, all) => cats.set(
item,
chroma(`hsl(${i/all.length*(360-360/all.length)}, 60%, 90%)`).css("hsl")
));
const lines = source.split(/\r?\n/gi);
const result = [];
let acc = [];
let cat_current = null;
for(let line of lines) {
if(line.startsWith(`#`)) {
// 1: Deal with the previous section
if(acc.length > 0) {
let heading_level_prev = acc[0].match(/^#+/)[0].length;
if(heading_level_prev === 3 && acc.length > 0) {
result.push(make_section(acc, cat_current, cats));
}
}
// 2: Deal with the new line
let heading_level = line.match(/^#+/)[0].length
if(heading_level === 2)
cat_current = extract_title(line);
acc = [ line ];
}
else
acc.push(line);
}
return result;
if(acc.length > 0)
result.push(make_section(acc, cat_current, cats));
return { sections: result, categories: cats };
}

515
.docs/package-lock.json generated
View file

@ -13,8 +13,9 @@
},
"devDependencies": {
"@11ty/eleventy": "^0.12.1",
"@11ty/eleventy-img": "^0.9.0",
"markdown-it-prism": "^2.1.8",
"@11ty/eleventy-img": "^0.10.0",
"chroma-js": "^2.1.2",
"markdown-it-prism": "^2.2.1",
"phin": "^3.6.0"
}
},
@ -75,9 +76,9 @@
}
},
"node_modules/@11ty/eleventy-cache-assets": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/@11ty/eleventy-cache-assets/-/eleventy-cache-assets-2.2.1.tgz",
"integrity": "sha512-RnbYXSFmj0d7+9kOPdCmdFou3616++aCNLBBNXxjVJF5tXdziO8PdjS9w0ktBgCIGfxz1/nwPHhL+HEqo3Iz/Q==",
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/@11ty/eleventy-cache-assets/-/eleventy-cache-assets-2.3.0.tgz",
"integrity": "sha512-W8tvO00GlWaKt3ccpEStaUBoj9BE3EgzuD8uYChCfYbN2Q4HkEItkiapvIJT0zJwAwoMfnSq6VHPLScYlX2XCg==",
"dev": true,
"dependencies": {
"debug": "^4.3.1",
@ -95,17 +96,16 @@
}
},
"node_modules/@11ty/eleventy-img": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/@11ty/eleventy-img/-/eleventy-img-0.9.0.tgz",
"integrity": "sha512-bw6++TlUokFuv/VUvnAyVQp5bykSleVvmvedIWkN8iKMykrNnf+UAUi9byXrlsFwgUvWBdMZH+0j1/1nKhv5VQ==",
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/@11ty/eleventy-img/-/eleventy-img-0.10.0.tgz",
"integrity": "sha512-9Mi1Wg8qc1gD7TixQtbwa8t0Z4D2hZF0eweYeMHEFr4WGklnSVckUnTJBr0qG+9f+UX7MzUDXbDPPSRCIRdyYw==",
"dev": true,
"dependencies": {
"@11ty/eleventy-cache-assets": "^2.2.1",
"debug": "^4.3.1",
"fs-extra": "^9.0.1",
"image-size": "^0.9.3",
"@11ty/eleventy-cache-assets": "^2.3.0",
"debug": "^4.3.2",
"image-size": "^1.0.0",
"p-queue": "^6.6.2",
"sharp": "^0.28.2",
"sharp": "^0.29.0",
"short-hash": "^1.0.0"
},
"funding": {
@ -113,40 +113,21 @@
"url": "https://opencollective.com/11ty"
}
},
"node_modules/@11ty/eleventy-img/node_modules/fs-extra": {
"version": "9.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
"integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
"node_modules/@11ty/eleventy-img/node_modules/debug": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
"integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
"dev": true,
"dependencies": {
"at-least-node": "^1.0.0",
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^2.0.0"
"ms": "2.1.2"
},
"engines": {
"node": ">=10"
"node": ">=6.0"
},
"peerDependenciesMeta": {
"supports-color": {
"optional": true
}
},
"node_modules/@11ty/eleventy-img/node_modules/jsonfile": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
"dev": true,
"dependencies": {
"universalify": "^2.0.0"
},
"optionalDependencies": {
"graceful-fs": "^4.1.6"
}
},
"node_modules/@11ty/eleventy-img/node_modules/universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"dev": true,
"engines": {
"node": ">= 10.0.0"
}
},
"node_modules/@babel/helper-validator-identifier": {
@ -305,9 +286,9 @@
"dev": true
},
"node_modules/are-we-there-yet": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz",
"integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz",
"integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==",
"dev": true,
"dependencies": {
"delegates": "^1.0.0",
@ -392,15 +373,6 @@
"node": ">=0.8.0"
}
},
"node_modules/at-least-node": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
"integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==",
"dev": true,
"engines": {
"node": ">= 4.0.0"
}
},
"node_modules/axios": {
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
@ -758,6 +730,15 @@
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
"dev": true
},
"node_modules/chroma-js": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/chroma-js/-/chroma-js-2.1.2.tgz",
"integrity": "sha512-ri/ouYDWuxfus3UcaMxC1Tfp3IE9K5iQzxc2hSxbBRVNQFut1UuGAsZmiAf2mOUubzGJwgMSv9lHg+XqLaz1QQ==",
"dev": true,
"dependencies": {
"cross-env": "^6.0.3"
}
},
"node_modules/cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
@ -779,13 +760,13 @@
}
},
"node_modules/color": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/color/-/color-3.1.3.tgz",
"integrity": "sha512-xgXAcTHa2HeFCGLE9Xs/R82hujGtu9Jd9x4NW3T34+OMs7VoPsjwzRczKHvTAHeJwWFwX5j15+MgAppE8ztObQ==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/color/-/color-4.0.1.tgz",
"integrity": "sha512-rpZjOKN5O7naJxkH2Rx1sZzzBgaiWECc6BYXjeCE6kF0kcASJYbUq02u7JqIHwCb/j3NhV+QhRL2683aICeGZA==",
"dev": true,
"dependencies": {
"color-convert": "^1.9.1",
"color-string": "^1.5.4"
"color-convert": "^2.0.1",
"color-string": "^1.6.0"
}
},
"node_modules/color-convert": {
@ -807,30 +788,15 @@
"dev": true
},
"node_modules/color-string": {
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.5.tgz",
"integrity": "sha512-jgIoum0OfQfq9Whcfc2z/VhCNcmQjWbey6qBX0vqt7YICflUmBCh9E9CiQD5GSJ+Uehixm3NUwHVhqUAWRivZg==",
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.6.0.tgz",
"integrity": "sha512-c/hGS+kRWJutUBEngKKmk4iH3sD59MBkoxVapS/0wgpCz2u7XsNloxknyvBhzwEs1IbV36D9PwqLPJ2DTu3vMA==",
"dev": true,
"dependencies": {
"color-name": "^1.0.0",
"simple-swizzle": "^0.2.2"
}
},
"node_modules/color/node_modules/color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"dependencies": {
"color-name": "1.1.3"
}
},
"node_modules/color/node_modules/color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
"node_modules/commander": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz",
@ -965,11 +931,41 @@
}
},
"node_modules/core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
"dev": true
},
"node_modules/cross-env": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-6.0.3.tgz",
"integrity": "sha512-+KqxF6LCvfhWvADcDPqo64yVIB31gv/jQulX2NGzKS/g3GEVz6/pt4wjHFtFWsHMddebWD/sDthJemzM4MaAag==",
"dev": true,
"dependencies": {
"cross-spawn": "^7.0.0"
},
"bin": {
"cross-env": "src/bin/cross-env.js",
"cross-env-shell": "src/bin/cross-env-shell.js"
},
"engines": {
"node": ">=8.0"
}
},
"node_modules/cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"dependencies": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/date-time": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/date-time/-/date-time-0.1.1.tgz",
@ -1488,9 +1484,9 @@
}
},
"node_modules/flatted": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz",
"integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==",
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz",
"integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==",
"dev": true
},
"node_modules/follow-redirects": {
@ -1945,9 +1941,9 @@
]
},
"node_modules/image-size": {
"version": "0.9.7",
"resolved": "https://registry.npmjs.org/image-size/-/image-size-0.9.7.tgz",
"integrity": "sha512-KRVgLNZkr00YGN0qn9MlIrmlxbRhsCcEb1Byq3WKGnIV4M48iD185cprRtaoK4t5iC+ym2Q5qlArxZ/V1yzDgA==",
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/image-size/-/image-size-1.0.0.tgz",
"integrity": "sha512-JLJ6OwBfO1KcA+TvJT+v8gbE6iWbj24LyDNFgFEN0lzegn6cC6a/p3NIDaepMsJjQjlUWqIC7wJv8lBFxPNjcw==",
"dev": true,
"dependencies": {
"queue": "6.0.2"
@ -1956,7 +1952,7 @@
"image-size": "bin/image-size.js"
},
"engines": {
"node": ">=10.18.0"
"node": ">=12.0.0"
}
},
"node_modules/immutable": {
@ -2224,6 +2220,12 @@
"integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=",
"dev": true
},
"node_modules/isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
"dev": true
},
"node_modules/javascript-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/javascript-stringify/-/javascript-stringify-2.1.0.tgz",
@ -2482,12 +2484,12 @@
}
},
"node_modules/markdown-it-prism": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.1.8.tgz",
"integrity": "sha512-PBiqlX3zGPQnOk7q7TkeveQfXlqzhjfHg2zSwntDNauYY7KFhg2FzO6O+1boillQptEBcIaEAO9gwKq/tXGHUQ==",
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.2.1.tgz",
"integrity": "sha512-Lo7nQxI+x+MXQkeEXVNIer7fWCGasuEEMxYU63HJCxZNF8bfzWrXDHGsxv0a/qD3mL4sYHj0jUFT0h4fG8WQVw==",
"dev": true,
"dependencies": {
"prismjs": "1.24.1"
"prismjs": "1.25.0"
},
"engines": {
"node": ">=6.0.0"
@ -2712,9 +2714,9 @@
"dev": true
},
"node_modules/node-abi": {
"version": "2.30.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.0.tgz",
"integrity": "sha512-g6bZh3YCKQRdwuO/tSZZYJAw622SjsRfJ2X0Iy4sSOHZ34/sPPdVBn8fev2tj7njzLwuqPw9uMtGsGkO5kIQvg==",
"version": "2.30.1",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz",
"integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==",
"dev": true,
"dependencies": {
"semver": "^5.4.1"
@ -2730,26 +2732,20 @@
}
},
"node_modules/node-addon-api": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
"integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.1.0.tgz",
"integrity": "sha512-Zz1o1BDX2VtduiAt6kgiUl8jX1Vm3NMboljFYKQJ6ee8AGfiTvM2mlZFI3xPbqjs80rCQgiVJI/DjQ/1QJ0HwA==",
"dev": true
},
"node_modules/node-fetch": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==",
"dev": true,
"engines": {
"node": "4.x || >=6.0.0"
}
},
"node_modules/noop-logger": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz",
"integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=",
"dev": true
},
"node_modules/nopt": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz",
@ -3009,6 +3005,15 @@
"integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=",
"dev": true
},
"node_modules/path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/path-parse": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
@ -3114,9 +3119,9 @@
}
},
"node_modules/prebuild-install": {
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.2.tgz",
"integrity": "sha512-PzYWIKZeP+967WuKYXlTOhYBgGOvTRSfaKI89XnfJ0ansRAH7hDU45X+K+FZeI1Wb/7p/NnuctPH3g0IqKUuSQ==",
"version": "6.1.4",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz",
"integrity": "sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ==",
"dev": true,
"dependencies": {
"detect-libc": "^1.0.3",
@ -3126,7 +3131,6 @@
"mkdirp-classic": "^0.5.3",
"napi-build-utils": "^1.0.1",
"node-abi": "^2.21.0",
"noop-logger": "^0.1.1",
"npmlog": "^4.0.1",
"pump": "^3.0.0",
"rc": "^1.2.7",
@ -3171,9 +3175,9 @@
}
},
"node_modules/prismjs": {
"version": "1.24.1",
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.24.1.tgz",
"integrity": "sha512-mNPsedLuk90RVJioIky8ANZEwYm5w9LcvCXrxHlwf4fNVSn8jEipMybMkWUyyF0JhnC+C4VcOVSBuHRKs1L5Ow==",
"version": "1.25.0",
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.25.0.tgz",
"integrity": "sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg==",
"dev": true
},
"node_modules/process-nextick-args": {
@ -3850,28 +3854,49 @@
"dev": true
},
"node_modules/sharp": {
"version": "0.28.3",
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.28.3.tgz",
"integrity": "sha512-21GEP45Rmr7q2qcmdnjDkNP04Ooh5v0laGS5FDpojOO84D1DJwUijLiSq8XNNM6e8aGXYtoYRh3sVNdm8NodMA==",
"version": "0.29.1",
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.29.1.tgz",
"integrity": "sha512-DpgdAny9TuS+oWCQ7MRS8XyY9x6q1+yW3a5wNx0J3HrGuB/Jot/8WcT+lElHY9iJu2pwtegSGxqMaqFiMhs4rQ==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
"color": "^3.1.3",
"color": "^4.0.1",
"detect-libc": "^1.0.3",
"node-addon-api": "^3.2.0",
"prebuild-install": "^6.1.2",
"node-addon-api": "^4.1.0",
"prebuild-install": "^6.1.4",
"semver": "^7.3.5",
"simple-get": "^3.1.0",
"tar-fs": "^2.1.1",
"tunnel-agent": "^0.6.0"
},
"engines": {
"node": ">=10"
"node": ">=12.13.0"
},
"funding": {
"url": "https://opencollective.com/libvips"
}
},
"node_modules/shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dev": true,
"dependencies": {
"shebang-regex": "^3.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true,
"engines": {
"node": ">=8"
}
},
"node_modules/short-hash": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/short-hash/-/short-hash-1.0.0.tgz",
@ -4485,6 +4510,21 @@
"node": ">=0.10.0"
}
},
"node_modules/which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"dependencies": {
"isexe": "^2.0.0"
},
"bin": {
"node-which": "bin/node-which"
},
"engines": {
"node": ">= 8"
}
},
"node_modules/which-module": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
@ -4716,9 +4756,9 @@
}
},
"@11ty/eleventy-cache-assets": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/@11ty/eleventy-cache-assets/-/eleventy-cache-assets-2.2.1.tgz",
"integrity": "sha512-RnbYXSFmj0d7+9kOPdCmdFou3616++aCNLBBNXxjVJF5tXdziO8PdjS9w0ktBgCIGfxz1/nwPHhL+HEqo3Iz/Q==",
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/@11ty/eleventy-cache-assets/-/eleventy-cache-assets-2.3.0.tgz",
"integrity": "sha512-W8tvO00GlWaKt3ccpEStaUBoj9BE3EgzuD8uYChCfYbN2Q4HkEItkiapvIJT0zJwAwoMfnSq6VHPLScYlX2XCg==",
"dev": true,
"requires": {
"debug": "^4.3.1",
@ -4729,47 +4769,27 @@
}
},
"@11ty/eleventy-img": {
"version": "0.9.0",
"resolved": "https://registry.npmjs.org/@11ty/eleventy-img/-/eleventy-img-0.9.0.tgz",
"integrity": "sha512-bw6++TlUokFuv/VUvnAyVQp5bykSleVvmvedIWkN8iKMykrNnf+UAUi9byXrlsFwgUvWBdMZH+0j1/1nKhv5VQ==",
"version": "0.10.0",
"resolved": "https://registry.npmjs.org/@11ty/eleventy-img/-/eleventy-img-0.10.0.tgz",
"integrity": "sha512-9Mi1Wg8qc1gD7TixQtbwa8t0Z4D2hZF0eweYeMHEFr4WGklnSVckUnTJBr0qG+9f+UX7MzUDXbDPPSRCIRdyYw==",
"dev": true,
"requires": {
"@11ty/eleventy-cache-assets": "^2.2.1",
"debug": "^4.3.1",
"fs-extra": "^9.0.1",
"image-size": "^0.9.3",
"@11ty/eleventy-cache-assets": "^2.3.0",
"debug": "^4.3.2",
"image-size": "^1.0.0",
"p-queue": "^6.6.2",
"sharp": "^0.28.2",
"sharp": "^0.29.0",
"short-hash": "^1.0.0"
},
"dependencies": {
"fs-extra": {
"version": "9.1.0",
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz",
"integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==",
"debug": {
"version": "4.3.2",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
"integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
"dev": true,
"requires": {
"at-least-node": "^1.0.0",
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^2.0.0"
"ms": "2.1.2"
}
},
"jsonfile": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
"dev": true,
"requires": {
"graceful-fs": "^4.1.6",
"universalify": "^2.0.0"
}
},
"universalify": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
"dev": true
}
}
},
@ -4893,9 +4913,9 @@
"dev": true
},
"are-we-there-yet": {
"version": "1.1.5",
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz",
"integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
"version": "1.1.7",
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz",
"integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==",
"dev": true,
"requires": {
"delegates": "^1.0.0",
@ -4965,12 +4985,6 @@
"integrity": "sha1-dhfBkXQB/Yykooqtzj266Yr+tDI=",
"dev": true
},
"at-least-node": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz",
"integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==",
"dev": true
},
"axios": {
"version": "0.21.1",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz",
@ -5257,6 +5271,15 @@
"integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==",
"dev": true
},
"chroma-js": {
"version": "2.1.2",
"resolved": "https://registry.npmjs.org/chroma-js/-/chroma-js-2.1.2.tgz",
"integrity": "sha512-ri/ouYDWuxfus3UcaMxC1Tfp3IE9K5iQzxc2hSxbBRVNQFut1UuGAsZmiAf2mOUubzGJwgMSv9lHg+XqLaz1QQ==",
"dev": true,
"requires": {
"cross-env": "^6.0.3"
}
},
"cliui": {
"version": "6.0.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
@ -5275,30 +5298,13 @@
"dev": true
},
"color": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/color/-/color-3.1.3.tgz",
"integrity": "sha512-xgXAcTHa2HeFCGLE9Xs/R82hujGtu9Jd9x4NW3T34+OMs7VoPsjwzRczKHvTAHeJwWFwX5j15+MgAppE8ztObQ==",
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/color/-/color-4.0.1.tgz",
"integrity": "sha512-rpZjOKN5O7naJxkH2Rx1sZzzBgaiWECc6BYXjeCE6kF0kcASJYbUq02u7JqIHwCb/j3NhV+QhRL2683aICeGZA==",
"dev": true,
"requires": {
"color-convert": "^1.9.1",
"color-string": "^1.5.4"
},
"dependencies": {
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
}
"color-convert": "^2.0.1",
"color-string": "^1.6.0"
}
},
"color-convert": {
@ -5317,9 +5323,9 @@
"dev": true
},
"color-string": {
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.5.5.tgz",
"integrity": "sha512-jgIoum0OfQfq9Whcfc2z/VhCNcmQjWbey6qBX0vqt7YICflUmBCh9E9CiQD5GSJ+Uehixm3NUwHVhqUAWRivZg==",
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/color-string/-/color-string-1.6.0.tgz",
"integrity": "sha512-c/hGS+kRWJutUBEngKKmk4iH3sD59MBkoxVapS/0wgpCz2u7XsNloxknyvBhzwEs1IbV36D9PwqLPJ2DTu3vMA==",
"dev": true,
"requires": {
"color-name": "^1.0.0",
@ -5446,11 +5452,31 @@
"dev": true
},
"core-util-is": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
"dev": true
},
"cross-env": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/cross-env/-/cross-env-6.0.3.tgz",
"integrity": "sha512-+KqxF6LCvfhWvADcDPqo64yVIB31gv/jQulX2NGzKS/g3GEVz6/pt4wjHFtFWsHMddebWD/sDthJemzM4MaAag==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.0"
}
},
"cross-spawn": {
"version": "7.0.3",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
"dev": true,
"requires": {
"path-key": "^3.1.0",
"shebang-command": "^2.0.0",
"which": "^2.0.1"
}
},
"date-time": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/date-time/-/date-time-0.1.1.tgz",
@ -5869,9 +5895,9 @@
}
},
"flatted": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz",
"integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==",
"version": "3.2.2",
"resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz",
"integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==",
"dev": true
},
"follow-redirects": {
@ -6213,9 +6239,9 @@
"dev": true
},
"image-size": {
"version": "0.9.7",
"resolved": "https://registry.npmjs.org/image-size/-/image-size-0.9.7.tgz",
"integrity": "sha512-KRVgLNZkr00YGN0qn9MlIrmlxbRhsCcEb1Byq3WKGnIV4M48iD185cprRtaoK4t5iC+ym2Q5qlArxZ/V1yzDgA==",
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/image-size/-/image-size-1.0.0.tgz",
"integrity": "sha512-JLJ6OwBfO1KcA+TvJT+v8gbE6iWbj24LyDNFgFEN0lzegn6cC6a/p3NIDaepMsJjQjlUWqIC7wJv8lBFxPNjcw==",
"dev": true,
"requires": {
"queue": "6.0.2"
@ -6429,6 +6455,12 @@
"integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=",
"dev": true
},
"isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
"dev": true
},
"javascript-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/javascript-stringify/-/javascript-stringify-2.1.0.tgz",
@ -6636,12 +6668,12 @@
}
},
"markdown-it-prism": {
"version": "2.1.8",
"resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.1.8.tgz",
"integrity": "sha512-PBiqlX3zGPQnOk7q7TkeveQfXlqzhjfHg2zSwntDNauYY7KFhg2FzO6O+1boillQptEBcIaEAO9gwKq/tXGHUQ==",
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/markdown-it-prism/-/markdown-it-prism-2.2.1.tgz",
"integrity": "sha512-Lo7nQxI+x+MXQkeEXVNIer7fWCGasuEEMxYU63HJCxZNF8bfzWrXDHGsxv0a/qD3mL4sYHj0jUFT0h4fG8WQVw==",
"dev": true,
"requires": {
"prismjs": "1.24.1"
"prismjs": "1.25.0"
}
},
"maximatch": {
@ -6811,9 +6843,9 @@
"dev": true
},
"node-abi": {
"version": "2.30.0",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.0.tgz",
"integrity": "sha512-g6bZh3YCKQRdwuO/tSZZYJAw622SjsRfJ2X0Iy4sSOHZ34/sPPdVBn8fev2tj7njzLwuqPw9uMtGsGkO5kIQvg==",
"version": "2.30.1",
"resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.30.1.tgz",
"integrity": "sha512-/2D0wOQPgaUWzVSVgRMx+trKJRC2UG4SUc4oCJoXx9Uxjtp0Vy3/kt7zcbxHF8+Z/pK3UloLWzBISg72brfy1w==",
"dev": true,
"requires": {
"semver": "^5.4.1"
@ -6828,21 +6860,15 @@
}
},
"node-addon-api": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz",
"integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-4.1.0.tgz",
"integrity": "sha512-Zz1o1BDX2VtduiAt6kgiUl8jX1Vm3NMboljFYKQJ6ee8AGfiTvM2mlZFI3xPbqjs80rCQgiVJI/DjQ/1QJ0HwA==",
"dev": true
},
"node-fetch": {
"version": "2.6.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==",
"dev": true
},
"noop-logger": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz",
"integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=",
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.2.tgz",
"integrity": "sha512-aLoxToI6RfZ+0NOjmWAgn9+LEd30YCkJKFSyWacNZdEKTit/ZMcKjGkTRo8uWEsnIb/hfKecNPEbln02PdWbcA==",
"dev": true
},
"nopt": {
@ -7030,6 +7056,12 @@
"integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=",
"dev": true
},
"path-key": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
"integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
"dev": true
},
"path-parse": {
"version": "1.0.7",
"resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
@ -7107,9 +7139,9 @@
}
},
"prebuild-install": {
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.2.tgz",
"integrity": "sha512-PzYWIKZeP+967WuKYXlTOhYBgGOvTRSfaKI89XnfJ0ansRAH7hDU45X+K+FZeI1Wb/7p/NnuctPH3g0IqKUuSQ==",
"version": "6.1.4",
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.1.4.tgz",
"integrity": "sha512-Z4vpywnK1lBg+zdPCVCsKq0xO66eEV9rWo2zrROGGiRS4JtueBOdlB1FnY8lcy7JsUud/Q3ijUxyWN26Ika0vQ==",
"dev": true,
"requires": {
"detect-libc": "^1.0.3",
@ -7119,7 +7151,6 @@
"mkdirp-classic": "^0.5.3",
"napi-build-utils": "^1.0.1",
"node-abi": "^2.21.0",
"noop-logger": "^0.1.1",
"npmlog": "^4.0.1",
"pump": "^3.0.0",
"rc": "^1.2.7",
@ -7149,9 +7180,9 @@
}
},
"prismjs": {
"version": "1.24.1",
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.24.1.tgz",
"integrity": "sha512-mNPsedLuk90RVJioIky8ANZEwYm5w9LcvCXrxHlwf4fNVSn8jEipMybMkWUyyF0JhnC+C4VcOVSBuHRKs1L5Ow==",
"version": "1.25.0",
"resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.25.0.tgz",
"integrity": "sha512-WCjJHl1KEWbnkQom1+SzftbtXMKQoezOCYs5rECqMN+jP+apI7ftoflyqigqzopSO3hMhTEb0mFClA8lkolgEg==",
"dev": true
},
"process-nextick-args": {
@ -7742,21 +7773,36 @@
"dev": true
},
"sharp": {
"version": "0.28.3",
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.28.3.tgz",
"integrity": "sha512-21GEP45Rmr7q2qcmdnjDkNP04Ooh5v0laGS5FDpojOO84D1DJwUijLiSq8XNNM6e8aGXYtoYRh3sVNdm8NodMA==",
"version": "0.29.1",
"resolved": "https://registry.npmjs.org/sharp/-/sharp-0.29.1.tgz",
"integrity": "sha512-DpgdAny9TuS+oWCQ7MRS8XyY9x6q1+yW3a5wNx0J3HrGuB/Jot/8WcT+lElHY9iJu2pwtegSGxqMaqFiMhs4rQ==",
"dev": true,
"requires": {
"color": "^3.1.3",
"color": "^4.0.1",
"detect-libc": "^1.0.3",
"node-addon-api": "^3.2.0",
"prebuild-install": "^6.1.2",
"node-addon-api": "^4.1.0",
"prebuild-install": "^6.1.4",
"semver": "^7.3.5",
"simple-get": "^3.1.0",
"tar-fs": "^2.1.1",
"tunnel-agent": "^0.6.0"
}
},
"shebang-command": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
"integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
"dev": true,
"requires": {
"shebang-regex": "^3.0.0"
}
},
"shebang-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
"dev": true
},
"short-hash": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/short-hash/-/short-hash-1.0.0.tgz",
@ -8250,6 +8296,15 @@
"integrity": "sha1-YU9/v42AHwu18GYfWy9XhXUOTwk=",
"dev": true
},
"which": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
"integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
"dev": true,
"requires": {
"isexe": "^2.0.0"
}
},
"which-module": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",

View file

@ -21,8 +21,9 @@
"homepage": "https://github.com/sbrl/Minetest-WorldEditAdditions#readme",
"devDependencies": {
"@11ty/eleventy": "^0.12.1",
"@11ty/eleventy-img": "^0.9.0",
"markdown-it-prism": "^2.1.8",
"@11ty/eleventy-img": "^0.10.0",
"chroma-js": "^2.1.2",
"markdown-it-prism": "^2.2.1",
"phin": "^3.6.0"
},
"dependencies": {

View file

@ -29,6 +29,8 @@ Note to self: See the bottom of this file for the release template text.
- `moretrees:apple_tree_sapling_ongen` from `apple` to `apple_moretrees`
- Add `plum``plumtree:sapling`
- Add `holly``hollytree:sapling`
- `//replacemix`: Improve error handling to avoid crashes (thanks, Jonathon for reporting via Discord!)
- Cloud wand: Improve chat message text
## v1.12: The selection tools update (26th June 2021)

View file

@ -2,6 +2,8 @@
This is the full chat command reference for WorldEditAdditions. Having trouble finding the section you want? Try the **[quick reference](https://github.com/sbrl/Minetest-WorldEditAdditions#quick-command-reference)** instead, which has links to back to sections of this document!
Check out the reference on the new website - it's even searchable: <https://worldeditadditions.mooncarrot.space/Reference/>
Other useful links:
- [WorldEditAdditions quick reference](https://github.com/sbrl/Minetest-WorldEditAdditions#quick-command-reference)
@ -11,112 +13,17 @@ Other useful links:
**Note:** If anything in this reference isn't clear, that's a bug. Please [open an issue](https://github.com/sbrl/Minetest-WorldEditAdditions/issues/new) (or even better a PR improving it) to let me know precisely which bit you don't understand and why.
## `//floodfill [<replace_node> [<radius>]]`
Floods all connected nodes of the same type starting at _pos1_ with <replace_node> (which defaults to `water_source`), in a sphere with a radius of <radius> (which defaults to 50).
```weacmd
//floodfill
//floodfill water_source 50
//floodfill glass 25
```
## `//overlay <node_name_a> [<chance_a>] <node_name_b> [<chance_b>] [<node_name_N> [<chance_N>]] ...`
Places `<node_name_a>` in the last contiguous air space encountered above the first non-air node. In other words, overlays all top-most nodes in the specified area with `<node_name_a>`. Optionally supports a mix of node names and chances, as `//mix` (WorldEdit) and `//replacemix` (WorldEditAdditions) does.
Will also work in caves, as it scans columns of nodes from top to bottom, skipping every non-air node until it finds one - and only then will it start searching for a node to place the target node on top of.
Note that all-air columns are skipped - so if you experience issues with it not overlaying correctly, try `//expand down 1` to add an extra node's space to your defined region.
Note also that columns without any air nodes in them at all are also skipped, so try `//expand y 1` to add an extra layer to your defined region.
```weacmd
//overlay grass
//overlay glass
//overlay grass_with_dirt
//overlay grass_with_dirt 10 dirt
//overlay grass_with_dirt 10 dirt 2 sand 1
//overlay sandstone dirt 2 sand 5
//overlay dirt 90% stone 10%
```
## `//layers [<max_slope|min_slope..max_slope>] [<node_name_1> [<layer_count_1>]] [<node_name_2> [<layer_count_2>]] ...`
Finds the first non-air node in each column and works downwards, replacing non-air nodes with a defined list of nodes in sequence. Like WorldEdit for Minecraft's `//naturalize` command, and also similar to [`we_env`'s `//populate`](https://github.com/sfan5/we_env). Speaking of, this command has `//naturalise` and `//naturalize` as aliases. Defaults to 1 layer of grass followed by 3 layers of dirt.
Since WorldEditAdditions v1.13, a maximum and minimum slope is optionally accepted, and constrains the columns in the defined region that `//layers` will operate on. For example, specifying a value of `20` would mean that only columns with a slop less than or equal to 20° (degrees, not radians) will be operated on. A value of `45..60` would mean that only columns with a slope between 45° and 60° will be operated on.
The list of nodes has a form similar to that of a chance list you might find in `//replacemix`, `//overlay`, or `//mix` - see the examples below. If the number of layers isn't specified, `1` is assumed (i.e. a single layer).
## Geometry
<!--
██████ ███████ ██████ ███ ███ ███████ ████████ ██████ ██ ██
██ ██ ██ ██ ████ ████ ██ ██ ██ ██ ██ ██
██ ███ █████ ██ ██ ██ ████ ██ █████ ██ ██████ ████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██████ ███████ ██████ ██ ██ ███████ ██ ██ ██ ██
-->
```weacmd
//layers dirt_with_grass dirt 3
//layers sand 5 sandstone 4 desert_stone 2
//layers brick stone 3
//layers cobble 2 dirt
//layers 45..60 dirt_with_snow dirt 2
//layers 30 snowblock dirt_with_snow dirt 2
```
## `//forest [<density>] <sapling_a> [<chance_a>] <sapling_b> [<chance_b>] [<sapling_N> [<chance_N>]] ...`
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 1-in-N chances, 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-aliasesall_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 this command - assistance in debugging this would be very helpful)
- [`cool_trees`](https://content.minetest.net/packages/runs/cool_trees/)
If you like, you can also reference the full name of a sapling node instead. The only requirements for saplings to be supported by this mod are:
1. It can be bonemealed
2. It has the `sapling` group
For example, the first 2 examples below are functionally equivalent.
```weacmd
//forest aspen
//forest default:aspen_sapling
//forest 2 oak 3 aspen pine
//forest 0.5 acacia
```
## `//saplingaliases [aliases|all_saplings]`
Lists all the currently registered sapling aliases in alphabetical order. These aliases can be used in the `//forest` subcommand.
Optionally takes 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.
```weacmd
//saplingaliases
//saplingaliases all_saplings
//saplingaliases aliases
```
## `//fillcaves [<node_name>]`
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.
Note that the *entire* cave you want filling must be selected, as `//fillcaves` only operates within the defined region (ref #50).
```weacmd
//fillcaves
//fillcaves dirt
//fillcaves brick
```
## `//ellipsoid <rx> <ry> <rz> <node_name> [h[ollow]]`
### `//ellipsoid <rx> <ry> <rz> <node_name> [h[ollow]]`
Creates a solid ellipsoid at position 1 with the radius `(rx, ry, rz)`.
```weacmd
@ -127,7 +34,7 @@ Creates a solid ellipsoid at position 1 with the radius `(rx, ry, rz)`.
//ellipsoid 7 4 7 papyrus hollow
```
## `//hollowellipsoid <rx> <ry> <rz> <node_name>`
### `//hollowellipsoid <rx> <ry> <rz> <node_name>`
Creates a hollow ellipsoid at position 1 with the radius `(rx, ry, rz)`. Works the same way as `//ellipsoid` does.
```weacmd
@ -135,7 +42,7 @@ Creates a hollow ellipsoid at position 1 with the radius `(rx, ry, rz)`. Works t
//hollowellipsoid 21 11 41 stone
```
## `//torus <major_radius> <minor_radius> <node_name> [<axes=xy> [h[ollow]]]`
### `//torus <major_radius> <minor_radius> <node_name> [<axes=xy> [h[ollow]]]`
Creates a solid torus at position 1 with the specified major and minor radii. The major radius is the distance from the centre of the torus to the centre of the circle bit, and the minor radius is the radius of the circle bit.
The optional axes sets the axes upon which the torus will lay flat. Possible values: `xy` (the default), `xz`, `yz`. A single axis may also be specified (i.e. `x`, `y`, or `z`) - this will be interpreted as the axis that runs through the hole in the middle of the torus.
@ -148,7 +55,7 @@ The optional axes sets the axes upon which the torus will lay flat. Possible val
//torus 25 10 dirt xz hollow
```
## `//hollowtorus <major_radius> <minor_radius> <node_name> [<axes=xy>]`
### `//hollowtorus <major_radius> <minor_radius> <node_name> [<axes=xy>]`
Creates a hollow torus at position 1 with the radius major and minor radii. Works the same way as `//torus` does.
```weacmd
@ -157,7 +64,7 @@ Creates a hollow torus at position 1 with the radius major and minor radii. Work
//hollowtorus 18 6 dirt xz
```
## `//line [<replace_node> [<radius>]]`
### `//line [<replace_node> [<radius>]]`
Draw a line from position 1 to position 2, optionally with a given thickness.
The radius can be thought of as the thickness of the line, and is defined as the distance from a given node to an imaginary line from pos1 to pos2. Defaults to drawing with dirt and a radius of 1.
@ -171,7 +78,7 @@ Floating-point values are fully supported for the radius.
//line glass 0.5
```
## `//hollow [<wall_thickness>]`
### `//hollow [<wall_thickness>]`
Replaces nodes inside the defined region with air, but leaving a given number of nodes near the outermost edges alone. In other words, it makes the defined region hollow, while leaving walls around the edges of a given thickness (defaulting to a wall thickness of 1).
Note that all air-like nodes are also left alone.
@ -181,7 +88,7 @@ Note that all air-like nodes are also left alone.
//hollow 2
```
## `//maze <replace_node> [<path_length> [<path_width> [<seed>]]]`
### `//maze <replace_node> [<path_length> [<path_width> [<seed>]]]`
Generates a maze using replace_node as the walls and air as the paths. Uses [an algorithm of my own devising](https://starbeamrainbowlabs.com/blog/article.php?article=posts/070-Language-Review-Lua.html) (see also [this post of mine that has lots of eye candy :D](https://starbeamrainbowlabs.com/blog/article.php?article=posts/429-lua-blender-mazes.html)). It is guaranteed that you can get from every point to every other point in generated mazes, and there are no loops.
Requires the currently selected area to be at least 3x3 on the x and z axes respectively.
@ -203,7 +110,8 @@ The last example below shows how to set the path length and width:
//maze glass 2 1 minetestiscool
```
## `//maze3d <replace_node> [<path_length> [<path_width> [<path_depth> [<seed>]]]]`
### `//maze3d <replace_node> [<path_length> [<path_width> [<path_depth> [<seed>]]]]`
Same as `//maze`, but instead generates mazes in 3 dimensions instead of 2. Requires the currently selected area to be at least 3x3x3.
The optional `path_depth` parameter defaults to `1` and allows customisation of the height of the paths generated.
@ -225,36 +133,8 @@ Additional examples:
//maze3d stone 6 3 3 54321
```
## `//bonemeal [<strength> [<chance> [<node_name> [<node_name> ...]]]]`
Requires the [`bonemeal`](https://content.minetest.net/packages/TenPlus1/bonemeal/) ([repo](https://notabug.org/TenPlus1/bonemeal/)) mod (otherwise _WorldEditAdditions_ will not register this command and output a message to the server log). Alias: `//flora`.
Bonemeals all eligible nodes in the current region. An eligible node is one that has an air node directly above it - note that just because a node is eligible doesn't mean to say that something will actually happen when the `bonemeal` mod bonemeals it.
Optionally takes a strength value (that's passed to `bonemeal:on_use()`, the method in the `bonemeal` mod that is called to actually do the bonemealing). The strength value is a positive integer from 1 to 4 (i.e. 1, 2, 3, or 4) - the default is 1 (the lowest strength).
I observe that a higher strength value gives a higher chance that something will actually grow. In the case of soil or sand nodes, I observe that it increases the area of effect of a single bonemeal action (thus at higher strengths generally you'll probably want a higher chance number - see below). See the [`bonemeal` mod README](https://notabug.org/TenPlus1/bonemeal) for more information.
Also optionally takes a chance number. This is the chance that an eligible node will actually get bonemealed, and is a positive integer that defaults to 1. The chance number represents a 1-in-{number} chance to bonemeal any given eligible node, where {number} is the chance number. In other words, the higher the chance number the lower the chance that a node will be bonemealed.
For example, a chance number of 2 would mean a 50% chance that any given eligible node will get bonemealed. A chance number of 16 would be a 6.25% chance, and a chance number of 25 would be 2%.
Since WorldEditAdditions v1.12, a percentage chance is also supported. This is denoted by suffixing a number with a percent sign (e.g. `//bonemeal 1 25%`).
Since WorldEditAdditions v1.13, a list of node names is also optionally supported. This will constrain bonemeal operations to be performed only on the node names listed.
```weacmd
//bonemeal
//bonemeal 3 25
//bonemeal 4
//bonemeal 1 10
//bonemeal 2 15
//bonemeal 2 10%
//bonemeal 2 10% dirt
//bonemeal 4 50 ethereal:grove_dirt
```
## `//walls <replace_node> [<thickness=1>]`
### `//walls <replace_node> [<thickness=1>]`
Creates vertical walls of `<replace_node>` around the inside edges of the defined region, optionally specifying the thickness thereof.
```weacmd
@ -265,6 +145,28 @@ Creates vertical walls of `<replace_node>` around the inside edges of the define
//walls glass 4
```
## Misc
<!--
███ ███ ██ ███████ ██████
████ ████ ██ ██ ██
██ ████ ██ ██ ███████ ██
██ ██ ██ ██ ██ ██
██ ██ ██ ███████ ██████
-->
### `//floodfill [<replace_node> [<radius>]]`
Floods all connected nodes of the same type starting at _pos1_ with <replace_node> (which defaults to `water_source`), in a sphere with a radius of <radius> (which defaults to 50).
```weacmd
//floodfill
//floodfill water_source 50
//floodfill glass 25
```
## `//wbox <replace_node>`
Sets the edges of the current selection to `<replace_node>`to create an outline of a rectangular prism. Useful for roughing in walls.
@ -310,7 +212,7 @@ In short, you can specify the scale factor directly, as a percentage, or as 1 nu
With this in mind, there are 3 forms that you can tell `//scale` how you want to scale the defined region:
### Single Axis
#### Single Axis
If you just need to scale a single axis, you can tell `//scale` that like so:
```weacmd
@ -336,7 +238,7 @@ This will scale in the _negative_ y direction by 2 times (again, doubling the he
//scale -x 1/3
```
### All axes
#### All axes
To scale on all axes at once, `//scale` takes the shortcut syntax of specifying a single scale factor:
```weacmd
@ -346,7 +248,7 @@ To scale on all axes at once, `//scale` takes the shortcut syntax of specifying
Both of the above will scale the defined region up by 2 times in all directions.
### Multiple scale factors
#### Multiple scale factors
If you want to specify different scale factors for difference axes, then `//scale` also supports a third syntax. Here's an example:
```weacmd
@ -372,7 +274,7 @@ By adding 3 extra numbers for the x, y, and z axes respectively, we can control
So in the above example, we scale in the positive x and z directions, and the negative y direction.
## `//replacemix <target_node> [<chance>] <replace_node_a> [<chance_a>] [<replace_node_b> [<chance_b>]] [<replace_node_N> [<chance_N>]] ...`
### `//replacemix <target_node> [<chance>] <replace_node_a> [<chance_a>] [<replace_node_b> [<chance_b>]] [<replace_node_N> [<chance_N>]] ...`
Replaces a given node with a random mix of other nodes. Functions like `//mix`.
This command is best explained with examples:
@ -431,7 +333,19 @@ Here are all the above examples together:
//replacemix dirt 3 sandstone 10 dry_dirt cobble 2
```
## `//convolve <kernel> [<width>[,<height>]] [<sigma>]`
## Terrain
<!--
████████ ███████ ██████ ██████ █████ ██ ███ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██
██ █████ ██████ ██████ ███████ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ███████ ██ ██ ██ ██ ██ ██ ██ ██ ████
-->
### `//convolve <kernel> [<width>[,<height>]] [<sigma>]`
Advanced version of `//smooth` from we_env, and one of the few WorldEditAdditions commands to have any aliases (`//smoothadv` and `//conv`).
Extracts a heightmap from the defined region and then proceeds to [convolve](https://en.wikipedia.org/wiki/Kernel_(image_processing)) over it with the specified kernel. The kernel can be thought of as the filter that will be applied to the heightmap. Once done, the newly convolved heightmap is applied to the terrain.
@ -459,7 +373,59 @@ The sigma value is only applicable to the `gaussian` kernel, and can be thought
//convolve gaussian 5 0.2
```
## `//erode [<snowballs|river> [<key_1> [<value_1>]] [<key_2> [<value_2>]] ...]`
### `//overlay <node_name_a> [<chance_a>] <node_name_b> [<chance_b>] [<node_name_N> [<chance_N>]] ...`
Places `<node_name_a>` in the last contiguous air space encountered above the first non-air node. In other words, overlays all top-most nodes in the specified area with `<node_name_a>`. Optionally supports a mix of node names and chances, as `//mix` (WorldEdit) and `//replacemix` (WorldEditAdditions) does.
Will also work in caves, as it scans columns of nodes from top to bottom, skipping every non-air node until it finds one - and only then will it start searching for a node to place the target node on top of.
Note that all-air columns are skipped - so if you experience issues with it not overlaying correctly, try `//expand down 1` to add an extra node's space to your defined region.
Note also that columns without any air nodes in them at all are also skipped, so try `//expand y 1` to add an extra layer to your defined region.
```weacmd
//overlay grass
//overlay glass
//overlay grass_with_dirt
//overlay grass_with_dirt 10 dirt
//overlay grass_with_dirt 10 dirt 2 sand 1
//overlay sandstone dirt 2 sand 5
//overlay dirt 90% stone 10%
```
### `//fillcaves [<node_name>]`
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.
Note that the *entire* cave you want filling must be selected, as `//fillcaves` only operates within the defined region (ref #50).
```weacmd
//fillcaves
//fillcaves dirt
//fillcaves brick
```
### `//layers [<max_slope|min_slope..max_slope>] [<node_name_1> [<layer_count_1>]] [<node_name_2> [<layer_count_2>]] ...`
Finds the first non-air node in each column and works downwards, replacing non-air nodes with a defined list of nodes in sequence. Like WorldEdit for Minecraft's `//naturalize` command, and also similar to [`we_env`'s `//populate`](https://github.com/sfan5/we_env). Speaking of, this command has `//naturalise` and `//naturalize` as aliases. Defaults to 1 layer of grass followed by 3 layers of dirt.
Since WorldEditAdditions v1.13, a maximum and minimum slope is optionally accepted, and constrains the columns in the defined region that `//layers` will operate on. For example, specifying a value of `20` would mean that only columns with a slop less than or equal to 20° (degrees, not radians) will be operated on. A value of `45..60` would mean that only columns with a slope between 45° and 60° will be operated on.
The list of nodes has a form similar to that of a chance list you might find in `//replacemix`, `//overlay`, or `//mix` - see the examples below. If the number of layers isn't specified, `1` is assumed (i.e. a single layer).
```weacmd
//layers dirt_with_grass dirt 3
//layers sand 5 sandstone 4 desert_stone 2
//layers brick stone 3
//layers cobble 2 dirt
//layers 45..60 dirt_with_snow dirt 2
//layers 30 snowblock dirt_with_snow dirt 2
```
### `//erode [<snowballs|river> [<key_1> [<value_1>]] [<key_2> [<value_2>]] ...]`
Runs an erosion algorithm over the defined region, optionally passing a number of key - value pairs representing parameters that are passed to the chosen algorithm. This command is **experimental**, as the author is currently on-the-fence about the effects it produces.
Works best if you run `//fillcaves` first, or otherwise have no air nodes below the top non-air node in each column.
@ -481,7 +447,7 @@ Usage examples:
Each of the algorithms above have 1 or more parameters that they support. These are detailed below.
### Algorithm: `snowballs`
#### Algorithm: `snowballs`
Based on the algorithm detailed in [this blog post](https://jobtalle.com/simulating_hydraulic_erosion.html) ([direct link to the source code](https://github.com/jobtalle/HydraulicErosion/blob/master/js/archipelago/island/terrain/erosionHydraulic.js)), devised by [Job Talle](https://jobtalle.com/).
Parameter | Type | Default Value | Description
@ -508,7 +474,7 @@ Usage examples:
If you find any good combinations of these parameters, please [open an issue](https://github.com/sbrl/Minetest-WorldEditAdditions/issues/new) (or a PR!) and let me know! I'll include good combinations here, and possibly add a presets feature too.
### Algorithm: `river`
#### Algorithm: `river`
Ever been annoyed by small 1 wide holes or thin pillars all over the place? This command is for you! Does not operate on the very edge of the defined region, because the algorithm can't see the neighbours of those columns.
Parameter | Type | Default Value | Description
@ -527,7 +493,7 @@ Usage examples:
```
## `//noise2d [<key_1> [<value_1>]] [<key_2> [<value_2>]] ...]`
### `//noise2d [<key_1> [<value_1>]] [<key_2> [<value_2>]] ...]`
Applies 2D noise to the terrain in the defined region. Like `//erode`, this command accepts a number of different key-value parameters and provides a number of different underlying algorithms.
Parameter | Type | Default Value | Description
@ -578,7 +544,107 @@ Example invocations:
```
## `//count`
## Flora
<!--
███████ ██ ██████ ██████ █████
██ ██ ██ ██ ██ ██ ██ ██
█████ ██ ██ ██ ██████ ███████
██ ██ ██ ██ ██ ██ ██ ██
██ ███████ ██████ ██ ██ ██ ██
-->
### `//forest [<density>] <sapling_a> [<chance_a>] <sapling_b> [<chance_b>] [<sapling_N> [<chance_N>]] ...`
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 1-in-N chances, 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-aliasesall_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 this command - assistance in debugging this would be very helpful)
- [`cool_trees`](https://content.minetest.net/packages/runs/cool_trees/)
If you like, you can also reference the full name of a sapling node instead. The only requirements for saplings to be supported by this mod are:
1. It can be bonemealed
2. It has the `sapling` group
For example, the first 2 examples below are functionally equivalent.
```weacmd
//forest aspen
//forest default:aspen_sapling
//forest 2 oak 3 aspen pine
//forest 0.5 acacia
```
### `//saplingaliases [aliases|all_saplings]`
Lists all the currently registered sapling aliases in alphabetical order. These aliases can be used in the `//forest` subcommand.
Optionally takes 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.
```weacmd
//saplingaliases
//saplingaliases all_saplings
//saplingaliases aliases
```
### `//bonemeal [<strength> [<chance> [<node_name> [<node_name> ...]]]]`
Requires the [`bonemeal`](https://content.minetest.net/packages/TenPlus1/bonemeal/) ([repo](https://notabug.org/TenPlus1/bonemeal/)) mod (otherwise _WorldEditAdditions_ will not register this command and output a message to the server log). Alias: `//flora`.
Bonemeals all eligible nodes in the current region. An eligible node is one that has an air node directly above it - note that just because a node is eligible doesn't mean to say that something will actually happen when the `bonemeal` mod bonemeals it.
Optionally takes a strength value (that's passed to `bonemeal:on_use()`, the method in the `bonemeal` mod that is called to actually do the bonemealing). The strength value is a positive integer from 1 to 4 (i.e. 1, 2, 3, or 4) - the default is 1 (the lowest strength).
I observe that a higher strength value gives a higher chance that something will actually grow. In the case of soil or sand nodes, I observe that it increases the area of effect of a single bonemeal action (thus at higher strengths generally you'll probably want a higher chance number - see below). See the [`bonemeal` mod README](https://notabug.org/TenPlus1/bonemeal) for more information.
Also optionally takes a chance number. This is the chance that an eligible node will actually get bonemealed, and is a positive integer that defaults to 1. The chance number represents a 1-in-{number} chance to bonemeal any given eligible node, where {number} is the chance number. In other words, the higher the chance number the lower the chance that a node will be bonemealed.
For example, a chance number of 2 would mean a 50% chance that any given eligible node will get bonemealed. A chance number of 16 would be a 6.25% chance, and a chance number of 25 would be 2%.
Since WorldEditAdditions v1.12, a percentage chance is also supported. This is denoted by suffixing a number with a percent sign (e.g. `//bonemeal 1 25%`).
Since WorldEditAdditions v1.13, a list of node names is also optionally supported. This will constrain bonemeal operations to be performed only on the node names listed.
```weacmd
//bonemeal
//bonemeal 3 25
//bonemeal 4
//bonemeal 1 10
//bonemeal 2 15
//bonemeal 2 10%
//bonemeal 2 10% dirt
//bonemeal 4 50 ethereal:grove_dirt
```
## Statistics
<!--
███████ ████████ █████ ████████ ██ ███████ ████████ ██ ██████ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
███████ ██ ███████ ██ ██ ███████ ██ ██ ██ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
███████ ██ ██ ██ ██ ██ ███████ ██ ██ ██████ ███████
-->
### `//count`
Counts all the nodes in the defined region and returns the result along with calculated percentages (note that if the chat window used a monospace font, the returned result would be a perfect table. If someone has a ~~hack~~ solution to make the columns line up neatly, please [open an issue](https://github.com/sbrl/Minetest-WorldEditAdditions/issues/new) :D)
**Note:** The output of `//count` can be rather long sometimes, and Minetest by default only shows the last few lines of chat. Press <kbd>F10</kbd> to show the full chat window that you can then scroll through to inspect the full output.
@ -588,7 +654,7 @@ Counts all the nodes in the defined region and returns the result along with cal
```
## `//basename <name>`
### `//basename <name>`
Returns the absolute canonical name of a node, given an alias or partial node name. For example:
```weacmd
@ -603,101 +669,20 @@ Returns the absolute canonical name of a node, given an alias or partial node na
```
## `//subdivide <size_x> <size_y> <size_z> <cmd_name> <args>`
Splits the current WorldEdit region into `(<size_x>, <size_y>, <size_z>)` sized chunks, and run `//<cmd_name> <args>` over each chunk.
Sometimes, we want to run a single command on a truly vast area. Usually, this results in running out of memory. If this was you, then this command is just what you need! It should be able to handle any sized region - the only limit is your patience for command to complete.....
Note that this command only works with WorldEdit commands, and only those which require 2 points (e.g. `//torus` only requires a single point, so it wouldn't work very well - but `//set` or `//clearcut` would).
Note also that `<cmd_name>` should _not_ be prefixed with _any_ forward slashes - see the examples below.
While other server commands can be executed while a `//subdivide` is running, `//subdivide` manipulates your player's defined region when running. This has the side-effect that you can check on where it has got up to with `//p get` for example - but means that attempting to change your pos1 & pos2 manually will have no effect until the `//subdivide` completes.
**Warning:** Once started, this command cannot be stopped without restarting your server! This is the case with all WorldEdit commands, but it's worth a special mention here.
```weacmd
//subdivide 10 10 10 set dirt
//subdivice 25 25 25 fixlight
```
## Selection
<!--
███████ ███████ ██ ███████ ██████ ████████ ██ ██████ ███ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ████ ██
███████ █████ ██ █████ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
███████ ███████ ███████ ███████ ██████ ██ ██ ██████ ██ ████
-->
## `//multi <command_a> <command_b> <command_c> .....`
Executes multi chat commands in sequence. Intended for _WorldEdit_ commands, but does work with others too. Don't forget a space between commands!
```weacmd
//multi //set dirt //shift x 10 //set glass
```
Since WorldEditAdditions v1.12, curly brace syntax has also been introduced to allow nesting of commands:
```weacmd
//multi //fixlight {//many 5 //bonemeal 3 100}
```
This syntax can also be nested arbitrarily in arbitrarily complex combinations, and can also be used multiple separate times in a single `//multi` invocation (if you find a bug, please [open an issue](https://github.com/sbrl/Minetest-WorldEditAdditions/issues/new)), though do remember that only `//multi` supports parsing out this syntax (e.g. if you want to nest multiple commands in a `//many` that's inside a `//multi`, you'll need a sub `//multi` there).
In addition, this also allows for including a double forward slash in the argument list for a command, should you need to do so (e.g. `//multi //example {//bar //baz} //example` will be executed as 3 commands: `/example`, then `/bar` with an argument of `//baz`, then finally `/example`).
```weacmd
//multi //1 //2 //shift z -10 //sphere 5 sand //shift z 20 //ellipsoid 5 3 5 ice
//multi //1 //hollowtorus 30 5 stone //hollowtorus 20 3 dirt //torus 10 2 dirt_with_grass
//multi /time 7:00 //1 //outset h 20 //outset v 5 //overlay dirt_with_grass //1 //2 //sphere 8 air //shift down 1 //floodfill //reset
```
## `//many <times> <command>`
Executes a single chat command many times in a row. Uses `minetest.after()` to yield to the main server thread to allow other things to happen at the same time, so technically you could have multiple `//many` calls going at once (but multithreading support is out of reach, so only a single one will be executing at the same time).
Note that this isn't necessarily limited to executing WorldEdit / WorldEditAdditions commands. Combine with `//multi` (see above) execute multiple commands at once for even more power and flexibility!
```weacmd
//many 10 //bonemeal 3 100
//many 100 //multi //1 //2 //outset 20 //set dirt
```
## `//ellipsoidapply <command_name> <args>`
Executes the given command, and then clips the result to the largest ellipsoid that will fit inside the defined region. The specified command must obviously take 2 positions - so for example `//set`, `//replacemix`, and `//maze3d` will work, but `//sphere`, `//torus`, and `//floodfill` won't.
For advanced users, `//multi` is also supported - but make sure your modifications stay within the defined region - otherwise they will not be affected by the ellipsoidal clipping operation.
```weacmd
//ellipsoidapply set dirt
//ellipsoidapply maze3d dirt 4 2 2
//ellipsoidapply erode
//ellipsoidapply replacemix sand bakedclay:red bakedclay:orange
//ellipsoidapply layers desert_sand sand 2 desert_sandstone 4 sandstone 10
```
## `//airapply <command_name> <args>`
Like [`//ellipsoidapply`](#ellipsoidapply), but instead only keeps changes that replace airlike nodes, and discards any other changes made.
As with `//ellipsoidapply` for advanced users `//multi` is also supported - but make sure your modifications stay within the defined region - otherwise they be kept regardless, as `//airapply` only applies the masking to the nodes in the defined region.
```weacmd
//airapply set sandstone
//airapply maze3d dirt 4 2 2
```
## `//noiseapply2d <threshold> <scale> <command_name> <args>`
Like [`//ellipsoidapply`](#ellipsoidapply), but instead only keeps changes where a noise function (defaults to `perlinmt`, see [`//noise2d`](#noise2d)) returns a value greater than a given threshold value.
Also takes a scale value that controls the scale of the noise - -higher values result in smaller "blobs". If you're operating on small areas, then a value of at least 10 is advised as "blobs" are by default on the scale of ~50 nodes.
As with `//ellipsoidapply` for advanced users `//multi` is also supported - but make sure your modifications stay within the defined region - otherwise they be kept regardless, as `//noiseapply2d` only applies the masking to the nodes in the defined region.
Any suggestions on how to provide more customisability without making this command more difficult to use or significantly more inconsistent with other `//*apply` functions are welcome - please [open an issue](https://github.com/sbrl/Minetest-WorldEditAdditions/issues/new).
```weacmd
//noiseapply2d 0.5 10 set dirt
//noiseapply2d 0.4 3 layers dirt_with_snow dirt 3 stone 10
```
## `//scol [<axis1> ] <length>`
### `//scol [<axis1> ] <length>`
Short for _select column_. Sets the pos2 at a set distance along 1 axis from pos1. If the axis isn't specified, defaults the direction you are facing. Implementation thanks to @VorTechnix.
```weacmd
@ -706,7 +691,7 @@ Short for _select column_. Sets the pos2 at a set distance along 1 axis from pos
```
## `//srect [<axis1> [<axis2>]] <length>`
### `//srect [<axis1> [<axis2>]] <length>`
Short for _select rectangle_. Sets the pos2 at a set distance along 2 axes from pos1. If the axes aren't specified, defaults to positive y and the direction you are facing. Implementation thanks to @VorTechnix.
```weacmd
@ -716,7 +701,7 @@ Short for _select rectangle_. Sets the pos2 at a set distance along 2 axes from
```
## `//scube [<axis1> [<axis2> [<axis3>]]] <length>`
### `//scube [<axis1> [<axis2> [<axis3>]]] <length>`
Short for _select cube_. Sets the pos2 at a set distance along 3 axes from pos1. If the axes aren't specified, defaults to positive y, the direction you are facing and the axis to the left of facing. Implementation thanks to @VorTechnix.
```weacmd
@ -727,7 +712,7 @@ Short for _select cube_. Sets the pos2 at a set distance along 3 axes from pos1.
```
## `//scloud <0-6|stop|reset>`
### `//scloud <0-6|stop|reset>`
Short for _select point cloud_. Sets pos1 and pos2 to include the nodes you punch. Numbers 1-6 designate how many nodes you want to punch before the operation ends. 0 or stop terminate the operation so that any further nodes you punch won't be added to selection. Reset terminates operation if one is running and resets the selection area.
```weacmd
@ -737,7 +722,7 @@ Short for _select point cloud_. Sets pos1 and pos2 to include the nodes you punc
```
## `//scentre`
### `//scentre`
Short for _select center_. Sets pos1 and pos2 to the centre point(s) of the current selection area. 1, 2, 4 or 8 nodes may be selected depending on what parts of the original selection are even in distance. Implementation thanks to @VorTechnix.
```weacmd
@ -764,7 +749,7 @@ Short for _selection shift_. Shifts the WorldEdit region along 3 axes. The axis
//sshift -z 12 -y -2 x -2
```
## `//smake <operation:odd|even|equal> <mode:grow|shrink|average> [<target=xz> [<base>]]`
### `//smake <operation:odd|even|equal> <mode:grow|shrink|average> [<target=xz> [<base>]]`
Short for _selection make_. Modifies existing selection by moving pos2. Allows you to make the selection an odd or even length on one or more axes or set two or more axes equal to each other or the longest, shortest or average of them. Implementation thanks to @VorTechnix.
Usage examples:
@ -777,7 +762,7 @@ Usage examples:
//smake equal zy x
```
### `<operation>`: odd|even|equal
#### `<operation>`: odd|even|equal
Value | Description
--------|---------------
@ -785,7 +770,7 @@ Value | Description
`even` | Round up or down, based on mode, all axes specified in `<target>` to the nearest even length relative to pos1
`equal` | Set `<target>` axes length equal to the length of `<base>` axis if specified or to the length of the largest, smallest or average of the `<target>` axes based on mode.
### `<mode>`: grow|shrink|average
#### `<mode>`: grow|shrink|average
#### *If `<operation>` == odd or even:*
@ -805,7 +790,7 @@ Value | Description
`average`/`avg` | Set each axis specified in `<target>` to the average length of all the specified axes
If `<base>` | `<mode>` becomes optional. If present it will be ignored.
### Additional arguments:
#### Additional arguments:
Name | Description
------------|------------------
@ -813,7 +798,7 @@ Name | Description
`<base>`: If `<operation>` == odd or even | Does nothing
`<base>`: If `<operation>` == equal | Overrides `<mode>` and sets all `<target>` axes equal to itself
## `//sfactor <mode:grow|shrink|average> <factor> [<target=xz>]`
### `//sfactor <mode:grow|shrink|average> <factor> [<target=xz>]`
Short for _selection factor_; alias: `//sfac`. Built specifically for use with `//maze`, this command sets targeted axes equal to the nearest multiple of `<factor>` based on the `<mode>`.
Usage examples:
@ -823,7 +808,7 @@ Usage examples:
//sfac avg 3 xy
```
### `<mode>`: grow|shrink|average
#### `<mode>`: grow|shrink|average
Value | Description
--------|--------------
@ -831,14 +816,14 @@ Value | Description
`shrink` | Rounds the length of each target axis down to the nearest multiple of `<factor>`
`average`/`avg` | Takes the average of all axes specified in `<target>` and then for each specified axis grows or shrinks it, depending on whether it is less than or greater than the average, to the nearest multiple of `<factor>`
## `//sstack`
### `//sstack`
Displays the contents of your per-user selection stack. This stack can be pushed to and popped from rather like a stack of plates. See also `//spush` (for pushing to the selection stack) and `//spop` (for popping from the selection stack).
```weacmd
//sstack
```
## `//spush`
### `//spush`
Pushes the currently defined region onto your per-user selection stack. Does not otherwise alter the defined region.
If the stack is full (currently the limit is set to 100 regions in the stack), then it will complain at you but otherwise will have no effect.
@ -849,21 +834,34 @@ Note that pos2 does _not_ need to be defined in order to use this. if it isn't d
//spush
```
## `//spop`
### `//spop`
Pops a selection off your per-user selection stack and applies it to the currently defined region. If pos2 from the item popped from the stack is nil, then pos2 is explicitly unset. If the stack is empty, this has no effect.
```weacmd
//spop
```
## `//mcount`
## Measurement
<!--
███ ███ ███████ █████ ███████ ██ ██ ██████ ███████
████ ████ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ████ ██ █████ ███████ ███████ ██ ██ ██████ █████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ███████ ██ ██ ███████ ██████ ██ ██ ███████
-->
### `//mcount`
Alias for [`//count`](#count).
```
//mcount
```
## `//mface`
### `//mface`
Returns the horizontal (X/Z) axis or axes the player is looking along.
Aliases: `//mfacing`.
@ -871,28 +869,148 @@ Aliases: `//mfacing`.
//mface
```
## `//midpos`
### `//midpos`
Returns the coordinates of the centre of the current selection.
```
//midpos
```
## `//msize`
### `//msize`
Returns the lengths of the current selection on the X, Y and Z axes.
```
//msize
```
## `//mtrig`
### `//mtrig`
Returns the length of the diagonal from pos1 to pos2 and its angle on the XZ (horizontal) and Y (vertical) axes.
```
//mtrig
```
## `//y`
## Meta
<!--
███ ███ ███████ ████████ █████
████ ████ ██ ██ ██ ██
██ ████ ██ █████ ██ ███████
██ ██ ██ ██ ██ ██ ██
██ ██ ███████ ██ ██ ██
-->
### `//subdivide <size_x> <size_y> <size_z> <cmd_name> <args>`
Splits the current WorldEdit region into `(<size_x>, <size_y>, <size_z>)` sized chunks, and run `//<cmd_name> <args>` over each chunk.
Sometimes, we want to run a single command on a truly vast area. Usually, this results in running out of memory. If this was you, then this command is just what you need! It should be able to handle any sized region - the only limit is your patience for command to complete.....
Note that this command only works with WorldEdit commands, and only those which require 2 points (e.g. `//torus` only requires a single point, so it wouldn't work very well - but `//set` or `//clearcut` would).
Note also that `<cmd_name>` should _not_ be prefixed with _any_ forward slashes - see the examples below.
While other server commands can be executed while a `//subdivide` is running, `//subdivide` manipulates your player's defined region when running. This has the side-effect that you can check on where it has got up to with `//p get` for example - but means that attempting to change your pos1 & pos2 manually will have no effect until the `//subdivide` completes.
**Warning:** Once started, this command cannot be stopped without restarting your server! This is the case with all WorldEdit commands, but it's worth a special mention here.
```weacmd
//subdivide 10 10 10 set dirt
//subdivice 25 25 25 fixlight
```
### `//multi <command_a> <command_b> <command_c> .....`
Executes multi chat commands in sequence. Intended for _WorldEdit_ commands, but does work with others too. Don't forget a space between commands!
```weacmd
//multi //set dirt //shift x 10 //set glass
```
Since WorldEditAdditions v1.12, curly brace syntax has also been introduced to allow nesting of commands:
```weacmd
//multi //fixlight {//many 5 //bonemeal 3 100}
```
This syntax can also be nested arbitrarily in arbitrarily complex combinations, and can also be used multiple separate times in a single `//multi` invocation (if you find a bug, please [open an issue](https://github.com/sbrl/Minetest-WorldEditAdditions/issues/new)), though do remember that only `//multi` supports parsing out this syntax (e.g. if you want to nest multiple commands in a `//many` that's inside a `//multi`, you'll need a sub `//multi` there).
In addition, this also allows for including a double forward slash in the argument list for a command, should you need to do so (e.g. `//multi //example {//bar //baz} //example` will be executed as 3 commands: `/example`, then `/bar` with an argument of `//baz`, then finally `/example`).
```weacmd
//multi //1 //2 //shift z -10 //sphere 5 sand //shift z 20 //ellipsoid 5 3 5 ice
//multi //1 //hollowtorus 30 5 stone //hollowtorus 20 3 dirt //torus 10 2 dirt_with_grass
//multi /time 7:00 //1 //outset h 20 //outset v 5 //overlay dirt_with_grass //1 //2 //sphere 8 air //shift down 1 //floodfill //reset
```
### `//many <times> <command>`
Executes a single chat command many times in a row. Uses `minetest.after()` to yield to the main server thread to allow other things to happen at the same time, so technically you could have multiple `//many` calls going at once (but multithreading support is out of reach, so only a single one will be executing at the same time).
Note that this isn't necessarily limited to executing WorldEdit / WorldEditAdditions commands. Combine with `//multi` (see above) execute multiple commands at once for even more power and flexibility!
```weacmd
//many 10 //bonemeal 3 100
//many 100 //multi //1 //2 //outset 20 //set dirt
```
### `//ellipsoidapply <command_name> <args>`
Executes the given command, and then clips the result to the largest ellipsoid that will fit inside the defined region. The specified command must obviously take 2 positions - so for example `//set`, `//replacemix`, and `//maze3d` will work, but `//sphere`, `//torus`, and `//floodfill` won't.
For advanced users, `//multi` is also supported - but make sure your modifications stay within the defined region - otherwise they will not be affected by the ellipsoidal clipping operation.
```weacmd
//ellipsoidapply set dirt
//ellipsoidapply maze3d dirt 4 2 2
//ellipsoidapply erode
//ellipsoidapply replacemix sand bakedclay:red bakedclay:orange
//ellipsoidapply layers desert_sand sand 2 desert_sandstone 4 sandstone 10
```
### `//airapply <command_name> <args>`
Like [`//ellipsoidapply`](#ellipsoidapply), but instead only keeps changes that replace airlike nodes, and discards any other changes made.
As with `//ellipsoidapply` for advanced users `//multi` is also supported - but make sure your modifications stay within the defined region - otherwise they be kept regardless, as `//airapply` only applies the masking to the nodes in the defined region.
```weacmd
//airapply set sandstone
//airapply maze3d dirt 4 2 2
```
### `//noiseapply2d <threshold> <scale> <command_name> <args>`
Like [`//ellipsoidapply`](#ellipsoidapply), but instead only keeps changes where a noise function (defaults to `perlinmt`, see [`//noise2d`](#noise2d)) returns a value greater than a given threshold value.
Also takes a scale value that controls the scale of the noise - -higher values result in smaller "blobs". If you're operating on small areas, then a value of at least 10 is advised as "blobs" are by default on the scale of ~50 nodes.
As with `//ellipsoidapply` for advanced users `//multi` is also supported - but make sure your modifications stay within the defined region - otherwise they be kept regardless, as `//noiseapply2d` only applies the masking to the nodes in the defined region.
Any suggestions on how to provide more customisability without making this command more difficult to use or significantly more inconsistent with other `//*apply` functions are welcome - please [open an issue](https://github.com/sbrl/Minetest-WorldEditAdditions/issues/new).
```weacmd
//noiseapply2d 0.5 10 set dirt
//noiseapply2d 0.4 3 layers dirt_with_snow dirt 3 stone 10
```
## Extras
<!--
███████ ██ ██ ████████ ██████ █████ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██
█████ ███ ██ ██████ ███████ ███████
██ ██ ██ ██ ██ ██ ██ ██ ██
███████ ██ ██ ██ ██ ██ ██ ██ ███████
-->
### `//y`
Confirms the execution of a command if it could potentially affect a large number of nodes and take a while. This is a regular WorldEdit command.
<!-- Equivalent to _WorldEdit_'s `//y`, but because of security sandboxing issues it's not really possible to hook into WorldEdit's existing command. -->
@ -901,7 +1019,8 @@ Confirms the execution of a command if it could potentially affect a large numbe
//y
```
## `//n`
### `//n`
Prevents the execution of a command if it could potentially affect a large number of nodes and take a while. This is a regular WorldEdit command.
<!-- Equivalent to _WorldEdit_'s `//y`, but because of security sandboxing issues it's not really possible to hook into WorldEdit's existing command. -->
@ -911,13 +1030,23 @@ Prevents the execution of a command if it could potentially affect a large numbe
```
## Far Wand
## Tools
<!--
████████ ██████ ██████ ██ ███████
██ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ███████
██ ██ ██ ██ ██ ██ ██
██ ██████ ██████ ███████ ███████
-->
### Far Wand
The far wand (`worldeditadditions:farwand`) is a variant on the traditional WorldEdit wand (`worldedit:wand`). It looks like this: ![A picture of the far wand](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/master/worldeditadditions_farwand/textures/worldeditadditions_farwand.png)
It functions very similarly to the regular WorldEdit wand, except that it has a _much_ longer range - which can be very useful for working on large-scale terrain for example. It also comes with an associated command to control it.
## `//farwand skip_liquid (true|false) | maxdist <number>`
This command helps control the behaviour of the [WorldEditAdditions far wand](#far-wand). Calling it without any arguments shows the current status:
### `//farwand skip_liquid (true|false) | maxdist <number>`
This command helps control the behaviour of the [WorldEditAdditions far wand](#far-wand) and [cloud wand](#cloud-wand). Calling it without any arguments shows the current status:
```weacmd
//farwand
@ -940,7 +1069,7 @@ You can change the maximum range with the `maxdist` subcommand:
Note that the number there isn't in blocks (because hard maths). It is however proportional to the distance the wand will raycast looks for nodes, so a higher value will result in it raycasting further.
## Cloud Wand
### Cloud Wand
The cloud wand (`worldeditadditions:cloudwand`) is a another variant the above _Far Wand_. It looks like this: ![A picture of the far wand](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/master/worldeditadditions_farwand/textures/worldeditadditions_cloudwand.png)
Unlike the other 2 wands, this wand functions in an additive manner. Left-click on a node to expand the currently defined region (creating a new one if one isn't defined already) to include that node. Right click to clear the currently defined region.

View file

@ -45,19 +45,20 @@ The detailed explanations have moved! Check them out [here](https://github.com/s
### Terrain
- [`//overlay <node_name_a> [<chance_a>] <node_name_b> [<chance_b>] [<node_name_N> [<chance_N>]] ...`](https://worldeditadditions.mooncarrot.space/Reference/#overlay)
- [`//layers [<node_name_1> [<layer_count_1>]] [<node_name_2> [<layer_count_2>]] ...`](https://worldeditadditions.mooncarrot.space/Reference/#layers)
- [`//layers [<max_slope|min_slope..max_slope>] [<node_name_1> [<layer_count_1>]] [<node_name_2> [<layer_count_2>]] ...`](https://worldeditadditions.mooncarrot.space/Reference/#layers)
- [`//fillcaves [<node_name>]`](https://worldeditadditions.mooncarrot.space/Reference/#fillcaves)
- [`//convolve <kernel> [<width>[,<height>]] [<sigma>]`](https://worldeditadditions.mooncarrot.space/Reference/#convolve)
- [`//erode [<snowballs|river> [<key_1> [<value_1>]] [<key_2> [<value_2>]] ...]`](https://worldeditadditions.mooncarrot.space/Reference/#erode) **experimental**
- [`//noise2d [<key_1> [<value_1>]] [<key_2> [<value_2>]] ...]`](https://worldeditadditions.mooncarrot.space/Reference/#noise2d)
### Flora
- [`//bonemeal [<strength> [<chance>]]`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/Chat-Command-Reference.md#bonemeal-strength-chance)
- [`//bonemeal [<strength> [<chance> [<node_name> [<node_name> ...]]]]`](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/Chat-Command-Reference.md#bonemeal-strength-chance)
- [`//forest [<density>] <sapling_a> [<chance_a>] <sapling_b> [<chance_b>] [<sapling_N> [<chance_N>]] ...`](https://worldeditadditions.mooncarrot.space/Reference/#forest) _(new in v1.9)_
- [`//saplingaliases [aliases|all_saplings]`](https://worldeditadditions.mooncarrot.space/Reference/#saplingaliases) _(new in v1.9)_
### Statistics
- [`//count`](https://worldeditadditions.mooncarrot.space/Reference/#count)
- [`//basename <name>`](https://worldeditadditions.mooncarrot.space/Reference/#basename)
### Selection
- [`//scol [<axis1> ] <length>`](https://worldeditadditions.mooncarrot.space/Reference/#scol)

View file

@ -1,10 +1,11 @@
#!/usr/bin/env bash
set -e;
current_branch="$(git rev-parse --abbrev-ref HEAD)";
# current_branch="$(git rev-parse --abbrev-ref HEAD)";
is_main="$(git branch --contains HEAD | awk '/HEAD/ { next } /main/ { print $1 }')";
if [[ "${1}" == "ci" ]] && [[ "${current_branch}" != "main" ]]; then
echo "Skipping build, because we are currently on the branch '${current_branch}', and we only deploy on the 'main' branch.";
if [[ "${1}" == "ci" ]] && [[ ! -z "${is_main}" ]]; then
echo "Skipping build, because this commit does not appear to be on the 'main' branch, and we only deploy commits on the 'main' branch.";
fi
# ██████ ██ ██████ ██ ██ ██ ██ ██████
@ -43,7 +44,7 @@ log_msg() {
# $1 - Command name to check for
check_command() {
set +e;
which $1 >/dev/null 2>&1; exit_code=$?
command -v "$1" >/dev/null 2>&1; exit_code="$?";
if [[ "${exit_code}" -ne 0 ]]; then
log_msg "Error: Couldn't locate $1. Make sure it's installed and in your path.";
fi

View file

@ -53,6 +53,9 @@ worldedit.register_command("replacemix", {
end
end
end
if not target_node then return false, "Error: No target node specified." end
if not last_node_name then return false, "Error: At least 1 replace node must be specified." end
if not replace_nodes[last_node_name] then
replace_nodes[last_node_name] = 1
end