From 9dc8165464553605bb3515bb2f0c178c1c5773e3 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Mon, 19 Sep 2022 17:34:53 +0100 Subject: [PATCH] fixup --- CONTRIBUTING.md | 7 ++++--- worldeditadditions/lib/conv/conv.lua | 4 ++-- worldeditadditions/lib/layers.lua | 6 +++--- worldeditadditions_commands/commands/torus.lua | 8 ++++---- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 518cd91..4b6ebc3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,6 +37,7 @@ When actually implementing stuff, here are a few guidelines that I recommend to -- ██ ██ ██ ██ ██ ██ ██ ██ ██ -- ██ ████ ██ ██ ██ ██ ███████ local wea = worldeditadditions +local wea_c = worldeditadditions_core worldeditadditions_core.register_command("{name}", { params = " [ ...] | [ []]", description = "A **brief** description of what this command does", @@ -51,14 +52,14 @@ worldeditadditions_core.register_command("{name}", { end, func = function(name, param1, param2) -- Start a timer - local start_time = wea.get_ms_time() + local start_time = wea_c.get_ms_time() -- Do stuff -- Finish timer - local time_taken = wea.get_ms_time() - start_time + local time_taken = wea_c.get_ms_time() - start_time minetest.log("This is a logged message!") - return true, "Completed command in " .. wea.format.human_time(time_taken) + return true, "Completed command in " .. wea_c.format.human_time(time_taken) end }) ``` diff --git a/worldeditadditions/lib/conv/conv.lua b/worldeditadditions/lib/conv/conv.lua index 6a43996..1a664c5 100644 --- a/worldeditadditions/lib/conv/conv.lua +++ b/worldeditadditions/lib/conv/conv.lua @@ -74,9 +74,9 @@ function wea.convolve(pos1, pos2, kernel, kernel_size) ) -- print("original") - -- wea.format.array_2d(heightmap, (pos2.z - pos1.z) + 1) + -- wea_c.format.array_2d(heightmap, (pos2.z - pos1.z) + 1) -- print("transformed") - -- wea.format.array_2d(heightmap_conv, (pos2.z - pos1.z) + 1) + -- wea_c.format.array_2d(heightmap_conv, (pos2.z - pos1.z) + 1) wea_c.terrain.apply_heightmap_changes( pos1, pos2, area, data, diff --git a/worldeditadditions/lib/layers.lua b/worldeditadditions/lib/layers.lua index 100a826..a287d1e 100644 --- a/worldeditadditions/lib/layers.lua +++ b/worldeditadditions/lib/layers.lua @@ -42,14 +42,14 @@ function worldeditadditions.layers(pos1, pos2, node_weights, min_slope, max_slop manip, area, data ) local slopemap = wea_c.terrain.calculate_slopes(heightmap, heightmap_size) - -- worldeditadditions.format.array_2d(heightmap, heightmap_size.x) + -- wea_c.format.array_2d(heightmap, heightmap_size.x) -- print_slopes(slopemap, heightmap_size.x) --luacheck:ignore 311 heightmap = nil -- Just in case Lua wants to garbage collect it - -- minetest.log("action", "pos1: " .. wea.vector.tostring(pos1)) - -- minetest.log("action", "pos2: " .. wea.vector.tostring(pos2)) + -- minetest.log("action", "pos1: " .. pos1) + -- minetest.log("action", "pos2: " .. pos2) -- for i,v in ipairs(node_ids) do -- print("[layer] i", i, "node id", v) -- end diff --git a/worldeditadditions_commands/commands/torus.lua b/worldeditadditions_commands/commands/torus.lua index de68f11..7e60ade 100644 --- a/worldeditadditions_commands/commands/torus.lua +++ b/worldeditadditions_commands/commands/torus.lua @@ -93,13 +93,13 @@ worldeditadditions_core.register_command("hollowtorus", { require_pos = 1, parse = function(params_text) local values = {parse_params_torus(params_text)} - return worldeditadditions.table.unpack(values) + return wea_c.table.unpack(values) end, nodes_needed = function(name, target_node, major_radius, minor_radius) return math.ceil(2 * math.pi*math.pi * major_radius * minor_radius*minor_radius) end, func = function(name, target_node, major_radius, minor_radius, axes) - local start_time = worldeditadditions.get_ms_time() + local start_time = wea_c.get_ms_time() local pos1 = Vector3.clone(worldedit.pos1[name]) local replaced = worldeditadditions.torus( pos1, @@ -108,9 +108,9 @@ worldeditadditions_core.register_command("hollowtorus", { axes, true -- hollow ) - local time_taken = worldeditadditions.get_ms_time() - start_time + local time_taken = wea_c.get_ms_time() - start_time minetest.log("action", name .. " used //hollowtorus at "..pos1..", replacing " .. replaced .. " nodes in " .. time_taken .. "s") - return true, replaced .. " nodes replaced in " .. worldeditadditions.format.human_time(time_taken) + return true, replaced .. " nodes replaced in " .. wea_c.format.human_time(time_taken) end })