diff --git a/CHANGELOG.md b/CHANGELOG.md index 34ef006..6873550 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,10 @@ Note to self: See the bottom of this file for the release template text. - Added [`//ndef`](https://worldeditadditions.mooncarrot.space/Reference/#ndef) to print a given node's definition table. This is for debugging and development purposes. - Added `//sgrow` and `//sshrink` commands to enlarge and shrink selection regions and aliased them over WorldEdit equivalents (`//expand`, `//outset` and `//contract`, `//inset` respectively). - Added Unified Axis Syntax (UAS) parser. - Implementation by @VorTechnix - - See [UAS System reference] for details. (Note to self hook up hyperlink) + - See [UAS System reference](https://worldeditadditions.mooncarrot.space/Reference/#unified-axis-syntax-uas) for details. - Added `//uasparse` command to show the vectors produced by a given UAS expression. - Implementation by @VorTechnix +- Added `//tool` command to list available tools and give tools to players. (Requires players to have the `weatool` privilege) - Implementation by @VorTechnix +- Added `weatool` privilege. - Implementation by @VorTechnix ### Bugfixes and changes - When commands produce an error, the name of the command that produced the error is now also printed. Useful when using e.g. [`//multi`](https://worldeditadditions.mooncarrot.space/Reference/#multi) etc. @@ -36,6 +38,7 @@ Note to self: See the bottom of this file for the release template text. ### Lua API changes - Add `core.pos.get12(player_name, sort=false)` +- Add `tools.register_tool(name, tool_def)` - Implementation by @VorTechnix ## v1.14.5: The multipoint update, hotfix 5 (1st August 2023) diff --git a/Chat-Command-Reference.md b/Chat-Command-Reference.md index d45196b..a66fa71 100644 --- a/Chat-Command-Reference.md +++ b/Chat-Command-Reference.md @@ -1896,6 +1896,17 @@ Prevents the execution of a command if it could potentially affect a large numbe ██ ██████ ██████ ███████ ███████ --> +### `//tool list || give|exists ` +> Added in v1.15 + +Lists available tools, allowes player to check if a specific tool exists and gives tools on demand as long as the player doesn't already have them, has room in their inventory, and has the `weatool` privilege. + +```weacmd +//tool list +//tool give cloudwand +//tool exists multiwand +``` + ### Movement speed adjustment tool The movement speed adjustment tool, as the name suggests, adjusts your local player movement speed. It looks like this: ![A picture of the move speed adjustment tool. It looks like a monarch butterfly.](https://raw.githubusercontent.com/sbrl/Minetest-WorldEditAdditions/dev/worldeditadditions_tools/textures/worldeditadditions_movement.png). @@ -1908,7 +1919,7 @@ See also [`//speed`](#speed). ### Far Wand > Added in v1.7 -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/main/worldeditadditions_tools/textures/worldeditadditions_tools.png) +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/main/worldeditadditions_tools/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. diff --git a/README.md b/README.md index 56f1244..fe0380a 100644 --- a/README.md +++ b/README.md @@ -129,6 +129,7 @@ The detailed explanations have moved! Check them out [here](https://worldeditadd - [WorldEditAdditions Far Wand](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/Chat-Command-Reference.md#far-wand) - [WorldEditAdditions Cloud Wand](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/Chat-Command-Reference.md#cloud-wand) - [`//farwand skip_liquid (true|false) | maxdist `](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/Chat-Command-Reference.md#farwand-skip_liquid-truefalse--maxdist-number) + - [`//tool list || give|exists `](https://github.com/sbrl/Minetest-WorldEditAdditions/blob/main/Chat-Command-Reference.md#tool-list-giveexists-tool-name) _(new in v1.15)_ ## Installation diff --git a/worldeditadditions_tools/commands/weatool.lua b/worldeditadditions_tools/commands/weatool.lua index f8886c5..7565e98 100644 --- a/worldeditadditions_tools/commands/weatool.lua +++ b/worldeditadditions_tools/commands/weatool.lua @@ -10,7 +10,7 @@ local wea_t = worldeditadditions_tools worldeditadditions_core.register_command("tool", { params = "list || give|exists ", description = "Give WEA tools by name to the calling player or list available tools.", - privs = { worldedit = true, give = true }, + privs = { worldedit = true, weatool = true }, require_pos = 0, parse = function(params_text) local ret = wea_c.split(params_text) diff --git a/worldeditadditions_tools/init.lua b/worldeditadditions_tools/init.lua index 98e8068..7c50cc2 100644 --- a/worldeditadditions_tools/init.lua +++ b/worldeditadditions_tools/init.lua @@ -4,6 +4,11 @@ worldeditadditions_tools = { } local wea_t = worldeditadditions_tools +minetest.register_privilege("weatool", { + description = "Allows players to use WEA tools.", + give_to_singleplayer = true, + give_to_admin = true, +}) local modpath = minetest.get_modpath("worldeditadditions_tools")