From 170ec01bed58f0738a6125efb9a7acc8d177b624 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 25 May 2024 14:48:38 +0100 Subject: [PATCH] Alias //napply to //nodeapply --- CHANGELOG.md | 2 ++ Chat-Command-Reference.md | 2 ++ worldeditadditions_commands/aliases.lua | 27 ++++++++++++++----------- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0bef8ed..ff58473 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ Note to self: See the bottom of this file for the release template text. ### Bugfixes and changes - Don't warn on failed registration of `//flora` → [`//bonemeal`](https://worldeditadditions.mooncarrot.space/Reference/#bonemeal) if the `bonemeal` mod isn't installed (e.g. in MineClone2) - thanks @VorTechnix in #106 - Improve documentation of [`//noise2d`](https://worldeditadditions.mooncarrot.space/Reference/#noise2d). If it still doesn't make sense, please let me know. It's a complicated command that needs reworking a bit to be easier to use. +- Alias `//napply` to [`//nodeapply`](https://worldeditadditions.mooncarrot.space/Reference/#nodeapply) + ### Lua API changes - Add `core.pos.get12(player_name, sort=false)` diff --git a/Chat-Command-Reference.md b/Chat-Command-Reference.md index 0820949..9c73859 100644 --- a/Chat-Command-Reference.md +++ b/Chat-Command-Reference.md @@ -1433,6 +1433,8 @@ As with `//ellipsoidapply` for advanced users `//multi` is also supported - but ### `//nodeapply [] [... ] -- ` +**Aliases:** `//napply` + It's got `apply` in the name, so as you might imagine it works the same as [`//ellipsoidapply`](#ellipsoidapply), [`//airapply`](#airapply), [`//noiseapply2d`](#noiseapply2d), etc. Only changes made by the given command that replace nodes on the list given will be replaced. For example: ```weacmd diff --git a/worldeditadditions_commands/aliases.lua b/worldeditadditions_commands/aliases.lua index b5e5df5..de1aaa4 100644 --- a/worldeditadditions_commands/aliases.lua +++ b/worldeditadditions_commands/aliases.lua @@ -1,27 +1,30 @@ -local wea_c = worldeditadditions_core +local core = worldeditadditions_core -wea_c.register_alias("smoothadv", "convolve") -wea_c.register_alias("conv", "convolve") +core.register_alias("smoothadv", "convolve") +core.register_alias("conv", "convolve") -wea_c.register_alias("naturalise", "layers") -wea_c.register_alias("naturalize", "layers") +core.register_alias("naturalise", "layers") +core.register_alias("naturalize", "layers") -if wea_c.command_exists("/bonemeal") then +-- Commands prefixed with n affect nodes +core.register_alias("napply", "nodeapply") + +if core.command_exists("/bonemeal") then -- No need to log here, since we notify the server admin in the server logs in the dofile() for the main //bonemeal command - wea_c.register_alias("flora", "bonemeal") + core.register_alias("flora", "bonemeal") end -- Measure Tools -wea_c.register_alias("mcount", "count") -wea_c.register_alias("mfacing", "mface") +core.register_alias("mcount", "count") +core.register_alias("mfacing", "mface") --- Overrides to core WorldEdit commands that have been thoroughly tested -- These are now enabled by default, but if you find a bug please report and -- it will be fixed as a matter of priority. -wea_c.register_alias("copy", "copy+", true) -wea_c.register_alias("move", "move+", true) +core.register_alias("copy", "copy+", true) +core.register_alias("move", "move+", true) --- Overrides to core WorldEdit commands -- These are disabled by default for now, as they could be potentially dangerous to stability @@ -30,5 +33,5 @@ local worldmt_settings = Settings(minetest.get_worldpath().."/world.mt") local should_override = worldmt_settings:get_bool("worldeditadditions_override_commands", false) if should_override then minetest.log("info", "[WorldEditAdditions] Enabling override aliases") - wea_c.register_alias("replace", "replacemix", true) + core.register_alias("replace", "replacemix", true) end