From 365b491aa175e5b84da06efb83814870b2c4501d Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Tue, 4 Jul 2023 22:44:28 +0100 Subject: [PATCH] contributing guide: update example command --- CONTRIBUTING.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4b6ebc3..446ba96 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,7 +37,8 @@ When actually implementing stuff, here are a few guidelines that I recommend to -- ██ ██ ██ ██ ██ ██ ██ ██ ██ -- ██ ████ ██ ██ ██ ██ ███████ local wea = worldeditadditions -local wea_c = worldeditadditions_core +local weac = worldeditadditions_core +local Vector3 = weac.Vector3 worldeditadditions_core.register_command("{name}", { params = " [ ...] | [ []]", description = "A **brief** description of what this command does", @@ -48,18 +49,18 @@ worldeditadditions_core.register_command("{name}", { return true, param1, param2 end, nodes_needed = function(name) --Optional - return worldedit.volume(worldedit.pos1[name], worldedit.pos2[name]) + return Vector3.volume(weac.pos.get1(name), weac.pos.get2(name)) end, func = function(name, param1, param2) -- Start a timer - local start_time = wea_c.get_ms_time() + local start_time = weac.get_ms_time() -- Do stuff -- Finish timer - local time_taken = wea_c.get_ms_time() - start_time + local time_taken = weac.get_ms_time() - start_time minetest.log("This is a logged message!") - return true, "Completed command in " .. wea_c.format.human_time(time_taken) + return true, "Completed command in " .. weac.format.human_time(time_taken) end }) ```