From 375fbf3c68f4add4a0ce6ae434c586aad745e690 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Sun, 17 Jan 2021 16:35:58 +0100 Subject: [PATCH] Remove trailing whitespaces --- worldedit/cuboid.lua | 48 ++++++++++++++++++------------------- worldedit_commands/init.lua | 4 ++-- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/worldedit/cuboid.lua b/worldedit/cuboid.lua index d27e233..f9a647f 100644 --- a/worldedit/cuboid.lua +++ b/worldedit/cuboid.lua @@ -2,16 +2,16 @@ worldedit.cuboid_volumetric_expand = function(name, amount) local pos1 = worldedit.pos1[name] local pos2 = worldedit.pos2[name] - + if pos1 == nil or pos2 == nil then return false, "Undefined cuboid" end - + local delta1 = vector.new() local delta2 = vector.new() local delta_dir1 local delta_dir2 - + delta1 = vector.add(delta1, amount) delta2 = vector.add(delta2, amount) delta_dir1, delta_dir2 = worldedit.get_expansion_directions(pos1, pos2) @@ -19,7 +19,7 @@ worldedit.cuboid_volumetric_expand = function(name, amount) delta2 = vector.multiply(delta2, delta_dir2) worldedit.pos1[name] = vector.add(pos1, delta1) worldedit.pos2[name] = vector.add(pos2, delta2) - + return true end @@ -28,18 +28,18 @@ end worldedit.cuboid_linear_expand = function(name, axis, direction, amount) local pos1 = worldedit.pos1[name] local pos2 = worldedit.pos2[name] - + if pos1 == nil or pos2 == nil then return false, "undefined cuboid" end - + if direction ~= 1 and direction ~= -1 then return false, "invalid marker" end - + local marker = worldedit.marker_get_closest_to_axis(name, axis, direction) local deltavect = vector.new() - + if axis == 'x' then deltavect.x = amount * direction elseif axis == 'y' then @@ -49,7 +49,7 @@ worldedit.cuboid_linear_expand = function(name, axis, direction, amount) else return false, "invalid axis" end - + worldedit.marker_move(name, marker, deltavect) return true end @@ -59,11 +59,11 @@ end worldedit.cuboid_shift = function(name, axis, amount) local pos1 = worldedit.pos1[name] local pos2 = worldedit.pos2[name] - + if pos1 == nil or pos2 == nil then return false, "undefined cuboid" end - + if axis == 'x' then worldedit.pos1[name].x = pos1.x + amount worldedit.pos2[name].x = pos2.x + amount @@ -76,7 +76,7 @@ worldedit.cuboid_shift = function(name, axis, amount) else return false, "invalid axis" end - + return true end @@ -86,7 +86,7 @@ worldedit.marker_move = function(name, marker, deltavector) if marker ~= 1 and marker ~= 2 then return false end - + if marker == 1 then local pos = worldedit.pos1[name] worldedit.pos1[name] = vector.add(deltavector, pos) @@ -94,7 +94,7 @@ worldedit.marker_move = function(name, marker, deltavector) local pos = worldedit.pos2[name] worldedit.pos2[name] = vector.add(deltavector, pos) end - + return true end @@ -137,7 +137,7 @@ worldedit.marker_get_closest_to_player = function(name) local playerpos = minetest.get_player_by_name(name):get_pos() local dist1 = vector.distance(playerpos, worldedit.pos1[name]) local dist2 = vector.distance(playerpos, worldedit.pos2[name]) - + if dist1 < dist2 then return 1 else @@ -150,7 +150,7 @@ end worldedit.marker_get_closest_to_axis = function(name, axis, direction) local pos1 = vector.new() local pos2 = vector.new() - + if direction ~= 1 and direction ~= -1 then return nil end @@ -185,20 +185,20 @@ worldedit.marker_get_closest_to_axis = function(name, axis, direction) end --- Translates up, down, left, right, front, back to their corresponding axes and +-- Translates up, down, left, right, front, back to their corresponding axes and -- directions according to faced direction worldedit.translate_direction = function(name, direction) local axis, dir = worldedit.player_axis(name) local resaxis, resdir - + if direction == "up" then return 'y', 1 end - + if direction == "down" then return 'y', -1 end - + if direction == "front" then if axis == "y" then resaxis = nil @@ -208,7 +208,7 @@ worldedit.translate_direction = function(name, direction) resdir = dir end end - + if direction == "back" then if axis == "y" then resaxis = nil @@ -218,7 +218,7 @@ worldedit.translate_direction = function(name, direction) resdir = -dir end end - + if direction == "left" then if axis == 'x' then resaxis = 'z' @@ -228,7 +228,7 @@ worldedit.translate_direction = function(name, direction) resdir = -dir end end - + if direction == "right" then if axis == 'x' then resaxis = 'z' @@ -238,6 +238,6 @@ worldedit.translate_direction = function(name, direction) resdir = dir end end - + return resaxis, resdir end diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua index 379370d..8fac3b2 100644 --- a/worldedit_commands/init.lua +++ b/worldedit_commands/init.lua @@ -64,7 +64,7 @@ end -- def = { -- privs = {}, -- Privileges needed -- params = "", -- Human readable parameter list (optional) --- -- setting params = "" will automatically provide a parse() if not given +-- -- setting params = "" will automatically provide a parse() if not given -- description = "", -- Description -- require_pos = 0, -- Number of positions required to be set (optional) -- parse = function(param) @@ -877,7 +877,7 @@ local check_pyramid = function(param) end return true, axis, tonumber(height), node end - + worldedit.register_command("hollowpyramid", { params = "x/y/z/? ", description = "Add hollow pyramid centered at WorldEdit position 1 along the given axis with height , composed of ",