From 0b0595a1d3347b254528f1c9e97c81a677230441 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sun, 4 Jul 2021 14:35:02 +0100 Subject: [PATCH] Remove a whole bunch of stray debug print statements --- worldeditadditions/lib/forest.lua | 2 +- worldeditadditions/lib/line.lua | 2 -- worldeditadditions/lib/noise/apply_2d.lua | 9 ++------- worldeditadditions/lib/noise/make_2d.lua | 3 --- worldeditadditions/lib/noise/run2d.lua | 5 ++--- worldeditadditions/lib/scale_down.lua | 1 - worldeditadditions/utils/parse/map.lua | 2 -- .../commands/extra/saplingaliases.lua | 1 - worldeditadditions_commands/commands/meta/multi.lua | 4 ++-- worldeditadditions_commands/commands/noise2d.lua | 3 --- worldeditadditions_commands/commands/scale.lua | 2 +- 11 files changed, 8 insertions(+), 26 deletions(-) diff --git a/worldeditadditions/lib/forest.lua b/worldeditadditions/lib/forest.lua index ce27f01..5294174 100644 --- a/worldeditadditions/lib/forest.lua +++ b/worldeditadditions/lib/forest.lua @@ -66,7 +66,7 @@ function worldeditadditions.forest(pos1, pos2, density_multiplier, sapling_weigh end end if not did_grow then - print("[//forest] Failed to grow sapling, detected node id", new_id_at_pos, "name", new_name_at_pos, "was originally", minetest.get_name_from_content_id(node_id)) + -- print("[//forest] Failed to grow sapling, detected node id", new_id_at_pos, "name", new_name_at_pos, "was originally", minetest.get_name_from_content_id(node_id)) -- We can't set it to air here because then when we save back we would overwrite all the newly grown trees stats.failures = stats.failures + 1 end diff --git a/worldeditadditions/lib/line.lua b/worldeditadditions/lib/line.lua index 67e17c9..4fc7a89 100644 --- a/worldeditadditions/lib/line.lua +++ b/worldeditadditions/lib/line.lua @@ -14,7 +14,6 @@ function worldeditadditions.line(pos1, pos2, thickness, node_name) pos2 = vector.new(pos2) local node_id_replace = minetest.get_content_id(node_name) - print("thickness", thickness, "node_name", node_name, "node_id_replace", node_id_replace) -- Fetch the nodes in the specified area local manip, area = worldedit.manip_helpers.init(pos1, pos2) @@ -37,7 +36,6 @@ function worldeditadditions.line(pos1, pos2, thickness, node_name) local distance = vector.length(vector.subtract(here, closest_on_line)) if distance < thickness then - print("[line] vector", closest_on_line.x, closest_on_line.y, closest_on_line.z, "length", distance) data[area:index(x, y, z)] = node_id_replace counts.replaced = counts.replaced + 1 end diff --git a/worldeditadditions/lib/noise/apply_2d.lua b/worldeditadditions/lib/noise/apply_2d.lua index 081b668..4ac888a 100644 --- a/worldeditadditions/lib/noise/apply_2d.lua +++ b/worldeditadditions/lib/noise/apply_2d.lua @@ -16,14 +16,12 @@ function worldeditadditions.noise.apply_2d(heightmap, noise, heightmap_size, pos local region_height = pos2.y - pos1.y - print("NOISE\n") - worldeditadditions.format.array_2d(noise, heightmap_size.x) + -- print("NOISE\n") + -- worldeditadditions.format.array_2d(noise, heightmap_size.x) local height = tonumber(apply_mode) - print("HEIGHT", height) - for z = heightmap_size.z - 1, 0, -1 do for x = heightmap_size.x - 1, 0, -1 do local i = (z * heightmap_size.x) + x @@ -35,15 +33,12 @@ function worldeditadditions.noise.apply_2d(heightmap, noise, heightmap_size, pos elseif height then -- Rescale from 0 - 1 to -1 - +1 local rescaled = (noise[i] * 2) - 1 - -- print("DEBUG x", x, "z", z, "rescaled 1", rescaled) -- Rescale to match the height specified rescaled = rescaled * height - -- print("DEBUG x", x, "z", z, "rescaled 2", rescaled) rescaled = math.floor(wea.clamp( heightmap[i] + rescaled, 0, region_height )) - -- print("DEBUG x", x, "z", z, "before", heightmap[i], "after", rescaled) heightmap[i] = rescaled else return false, "Error: Unknown apply mode '"..apply_mode.."'" diff --git a/worldeditadditions/lib/noise/make_2d.lua b/worldeditadditions/lib/noise/make_2d.lua index addea4b..9d07570 100644 --- a/worldeditadditions/lib/noise/make_2d.lua +++ b/worldeditadditions/lib/noise/make_2d.lua @@ -13,8 +13,6 @@ local wea = worldeditadditions function worldeditadditions.noise.make_2d(size, start_pos, params) local result = {} - print("size x", size.x, "z", size.z, "start_pos x", start_pos.x, "z", start_pos.z) - for i, layer in ipairs(params) do local generator if layer.algorithm == "perlin" then @@ -33,7 +31,6 @@ function worldeditadditions.noise.make_2d(size, start_pos, params) local noise_y = (y + 100000+start_pos.z+layer.offset.z) * layer.scale.z local noise_value = generator:noise(noise_x, noise_y, 0) - -- print("DEBUG NOISE x", noise_x, "y", noise_y, "value", noise_value) if type(result[i]) ~= "number" then result[i] = 0 end result[i] = result[i] + (noise_value ^ layer.exponent) * layer.multiply + layer.add end diff --git a/worldeditadditions/lib/noise/run2d.lua b/worldeditadditions/lib/noise/run2d.lua index 3a14d15..d285a3b 100644 --- a/worldeditadditions/lib/noise/run2d.lua +++ b/worldeditadditions/lib/noise/run2d.lua @@ -17,9 +17,9 @@ function worldeditadditions.noise.run2d(pos1, pos2, noise_params) -- pos2 will always have the highest co-ordinates now -- Fill in the default params - print("DEBUG noise_params_custom ", wea.format.map(noise_params)) + -- print("DEBUG noise_params_custom ", wea.format.map(noise_params)) noise_params = worldeditadditions.noise.params_apply_default(noise_params) - print("DEBUG noise_params[1] ", wea.format.map(noise_params[1])) + -- print("DEBUG noise_params[1] ", wea.format.map(noise_params[1])) -- Fetch the nodes in the specified area local manip, area = worldedit.manip_helpers.init(pos1, pos2) @@ -46,7 +46,6 @@ function worldeditadditions.noise.run2d(pos1, pos2, noise_params) pos1, pos2, noise_params[1].apply ) - print("RETURNED apply_2d success", success, "message", message) if not success then return success, message end diff --git a/worldeditadditions/lib/scale_down.lua b/worldeditadditions/lib/scale_down.lua index 7cbc14f..7bc95fc 100644 --- a/worldeditadditions/lib/scale_down.lua +++ b/worldeditadditions/lib/scale_down.lua @@ -25,7 +25,6 @@ function worldeditadditions.scale_down(pos1, pos2, scale, anchor) z = math.floor(1 / scale.z) } local size = vector.subtract(pos2, pos1) - print("[DEBUG] scale_down", worldeditadditions.vector.tostring(scale_down), "size", size) if size.x < scale_down.x or size.y < scale_down.y or size.z < scale.z then return false, "Error: Area isn't big enough to apply scale down by "..worldeditadditions.vector.tostring(scale).."." diff --git a/worldeditadditions/utils/parse/map.lua b/worldeditadditions/utils/parse/map.lua index 805d7fd..58e311d 100644 --- a/worldeditadditions/utils/parse/map.lua +++ b/worldeditadditions/utils/parse/map.lua @@ -13,7 +13,6 @@ function worldeditadditions.parse.map(params_text, keywords) local last_key = nil local mode = "KEY" for i, part in ipairs(parts) do - print("PARSE_MAP | i", i, "MODE", mode, "PART", part) if mode == "VALUE" then -- Try converting to a number to see if it works local part_converted = tonumber(part) @@ -27,7 +26,6 @@ function worldeditadditions.parse.map(params_text, keywords) last_key = part -- Keyword support if wea.table.contains(keywords, last_key) then - print("IS KEYWORD") result[last_key] = true else mode = "VALUE" diff --git a/worldeditadditions_commands/commands/extra/saplingaliases.lua b/worldeditadditions_commands/commands/extra/saplingaliases.lua index 5dcb6ac..1c48f57 100644 --- a/worldeditadditions_commands/commands/extra/saplingaliases.lua +++ b/worldeditadditions_commands/commands/extra/saplingaliases.lua @@ -28,7 +28,6 @@ minetest.register_chatcommand("/saplingaliases", { local results = worldeditadditions.registered_nodes_by_group("sapling") table.insert(msg, "Sapling-like nodes:\n") local str = table.concat(results, "\n") - print(str) table.insert(msg, str) else table.insert(msg, "Unknown mode '") diff --git a/worldeditadditions_commands/commands/meta/multi.lua b/worldeditadditions_commands/commands/meta/multi.lua index 81fec34..61ae9b7 100644 --- a/worldeditadditions_commands/commands/meta/multi.lua +++ b/worldeditadditions_commands/commands/meta/multi.lua @@ -45,7 +45,7 @@ minetest.register_chatcommand("/multi", { if not success then return success, commands end for i, command in ipairs(commands) do - print("[DEBUG] i", i, "command: '"..command.."'") + -- print("[DEBUG] i", i, "command: '"..command.."'") local start_time = worldeditadditions.get_ms_time() local found, _, command_name, args = command:find("^([^%s]+)%s(.+)$") @@ -53,7 +53,7 @@ minetest.register_chatcommand("/multi", { -- Things start at 1, not 0 in Lua :-( command_name = worldeditadditions.trim(command_name):sub(2) -- Strip the leading / if not args then args = "" end - print("command_name", command_name) + -- print("command_name", command_name) worldedit.player_notify(name, "#"..i..": "..command) diff --git a/worldeditadditions_commands/commands/noise2d.lua b/worldeditadditions_commands/commands/noise2d.lua index 68e8cee..8ae0973 100644 --- a/worldeditadditions_commands/commands/noise2d.lua +++ b/worldeditadditions_commands/commands/noise2d.lua @@ -18,9 +18,6 @@ worldedit.register_command("noise2d", { }) if not success then return success, map end - print("DEBUG noise_params raw ", wea.format.map(map)) - - if map.scale then map.scale = tonumber(map.scale) map.scale = wea.Vector3.new(map.scale, map.scale, map.scale) diff --git a/worldeditadditions_commands/commands/scale.lua b/worldeditadditions_commands/commands/scale.lua index 43044bd..01a3503 100644 --- a/worldeditadditions_commands/commands/scale.lua +++ b/worldeditadditions_commands/commands/scale.lua @@ -102,7 +102,7 @@ worldedit.register_command("scale", { return volume * factor end, func = function(name, scale, anchor) - print("initial scale: "..worldeditadditions.vector.tostring(scale)..", anchor: "..worldeditadditions.vector.tostring(anchor)) + -- print("initial scale: "..worldeditadditions.vector.tostring(scale)..", anchor: "..worldeditadditions.vector.tostring(anchor)) local start_time = worldeditadditions.get_ms_time()