From d00b5a62139f02778b011ff6d33717f2fcc843d4 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 26 Jul 2021 19:06:23 +0100 Subject: [PATCH 1/3] docs/Tutorial: typo --- .docs/Tutorial.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.docs/Tutorial.md b/.docs/Tutorial.md index e8c6d41..4870a79 100644 --- a/.docs/Tutorial.md +++ b/.docs/Tutorial.md @@ -100,7 +100,7 @@ WorldEditAdditions provides a number of *meta commands*. Such commands don't do - [`//subdivide`](/Reference#subdivide): split a region into chunks, and execute the command once for each chunk - [`//many`](/Reference#many): Execute a command multiple times - - [`//multi`](/!node_modules, !_sitemulti): Execute multiple commands in sequence + - [`//multi`](/Reference#multi): Execute multiple commands in sequence Of course, this isn't an exhaustive list - check the [reference](/Reference) for a full list. From 2687c4a5f66f226a3599bf9d8be8a5ff7649564f Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Tue, 27 Jul 2021 00:09:05 +0100 Subject: [PATCH 2/3] README: Add link to contributing guide --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 58a7adc..545572b 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ As far as I can tell, the saplings provided by the [`moretrees` mod](https://con ## Contributing Contributions are welcome! Please state in your pull request(s) that you release your contribution under the _Mozilla Public License 2.0_. -Please also make sure that the logic for every new command has it's own file. For example, the logic for `//floodfill` goes in `worldeditadditions/floodfill.lua`, the logic for `//overlay` goes in `worldeditadditions/overlay.lua`, etc. +Please also make sure that the logic for every new command has it's own file. For example, the logic for `//floodfill` goes in `worldeditadditions/floodfill.lua`, the logic for `//overlay` goes in `worldeditadditions/overlay.lua`, etc. More contributing help can be found in [the contributing guide](./Contributing.md) I, Starbeamrainbowlabs (@sbrl), have the ultimate final say. From 77fef22d299b3947c5b06fe0ce914453cddcb410 Mon Sep 17 00:00:00 2001 From: VorTechnix <45538536+VorTechnix@users.noreply.github.com> Date: Mon, 26 Jul 2021 16:29:01 -0700 Subject: [PATCH 3/3] Update CONTRIBUTING.md with template --- CONTRIBUTING.md | 35 +++++++++++++++++++++++++++++++++++ README.md | 2 ++ 2 files changed, 37 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 427c273..b02dc46 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,6 +16,41 @@ Additionally, every command should be implemented in its own file. This helps ke Don't forget to update `init.lua` to `dofile()` the new file(s) you create in each submod :-) +## Chat command template + +```lua +-- ███ ██ █████ ███ ███ ███████ +-- ████ ██ ██ ██ ████ ████ ██ +-- ██ ██ ██ ███████ ██ ████ ██ █████ +-- ██ ██ ██ ██ ██ ██ ██ ██ ██ +-- ██ ████ ██ ██ ██ ██ ███████ +local wea = worldeditadditions +worldedit.register_command("{name}", { + params = " [ ...] | [ []]", + description = "A **brief** description of what this command does", + privs = { worldedit = true }, + require_pos = 0, -- Optional | (0|1|2) + parse = function(params_text) + -- Do stuff with params_text + return true, param1, param2 + end, + nodes_needed = function(name) --Optional + return worldedit.volume(worldedit.pos1[name], worldedit.pos2[name]) + end, + func = function(name, param1, param2) + -- Start a timer + local start_time = wea.get_ms_time() + -- Do stuff + + -- Finish timer + local time_taken = wea.get_ms_time() - start_time + + minetest.log("This is a logged message!") + return true, "Completed command in " .. wea.format.human_time(time_taken) + end +}) +``` + ## Guidelines When actually implementing stuff, here are a few guidelines that I recommend to summarise everything: diff --git a/README.md b/README.md index 545572b..99159ba 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,8 @@ Contributions are welcome! Please state in your pull request(s) that you release Please also make sure that the logic for every new command has it's own file. For example, the logic for `//floodfill` goes in `worldeditadditions/floodfill.lua`, the logic for `//overlay` goes in `worldeditadditions/overlay.lua`, etc. More contributing help can be found in [the contributing guide](./Contributing.md) +For more information check out [CONTRIBUTING.md](CONTRIBUTING.md). + I, Starbeamrainbowlabs (@sbrl), have the ultimate final say.