From ee06f4c4684358bc06f4108878d865d107c45f3e Mon Sep 17 00:00:00 2001 From: "A.C.M" Date: Sun, 21 Jul 2019 13:47:11 +0200 Subject: [PATCH] Remove Whitespaces --- .luacheckrc | 18 +++++++++++++++++ mesecons_stealthnode/register.lua | 33 ++++++++++++++++--------------- register_stealthnodes/init.lua | 8 ++++---- 3 files changed, 39 insertions(+), 20 deletions(-) create mode 100644 .luacheckrc diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..f512afd --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,18 @@ +unused_args = false +allow_defined_top = true + +globals = { + "minetest","mesecons_stealthnode","mesecons_random" +} + +read_globals = { + string = {fields = {"split"}}, + table = {fields = {"copy", "getn"}}, + + -- Builtin + "vector", "ItemStack", + "dump", "DIR_DELIM", "VoxelArea", "Settings", + + -- MTG + "default" +} diff --git a/mesecons_stealthnode/register.lua b/mesecons_stealthnode/register.lua index 6c48990..8a1fbb2 100644 --- a/mesecons_stealthnode/register.lua +++ b/mesecons_stealthnode/register.lua @@ -1,8 +1,8 @@ ---[[ +--[[ ******************************************** *** Register Stealthnodes ** ******************************************** - + Registers a new Ghoststone with the tile of the given Node. stealthnode.register_stealthnode(Name, Node) @@ -13,21 +13,22 @@ ]]-- function stealthnode.register_stealthnode(modname, node) - - local tile = "" - - if minetest.registered_nodes[modname .. ":" .. node] == nil then - print("[MOD] " .. minetest.get_current_modname() .. ": " .. modname .. ":" .. node .. " not found to register a stealthnode.") - minetest.log("warning", "[MOD] " .. minetest.get_current_modname() .. ": " .. modname .. ":" .. node .. " not found to register a stealthnode.") + + local tile + + if minetest.registered_nodes[modname .. ":" .. node] == nil then + print("[MOD] " .. minetest.get_current_modname() .. ": " + .. modname .. ":" .. node .. " not found to register a stealthnode.") + minetest.log("warning", "[MOD] " .. minetest.get_current_modname() .. ": " + .. modname .. ":" .. node .. " not found to register a stealthnode.") return else tile = minetest.registered_nodes[modname .. ":" .. node].tiles - + end - - local newgroup = {} - newgroup = stealthnode.table_clone(minetest.registered_nodes[modname .. ":" .. node].groups) - + + local newgroup = stealthnode.table_clone(minetest.registered_nodes[modname .. ":" .. node].groups) + minetest.register_node(":mesecons_stealthnode:" .. modname .. "_" .. node, { description="Stealthnode " .. minetest.registered_nodes[modname .. ":" .. node].description, tiles = tile, @@ -84,9 +85,9 @@ function stealthnode.table_clone(c_table) local t2 = {} for k,v in pairs(c_table) do t2[k] = v - + end - + return t2 - + end -- function cucina_vegana.table_clone diff --git a/register_stealthnodes/init.lua b/register_stealthnodes/init.lua index a59f6f6..79366d5 100644 --- a/register_stealthnodes/init.lua +++ b/register_stealthnodes/init.lua @@ -38,7 +38,7 @@ local snodes = { {"default", "wood"}, {"default", "tree"}, - + {"default", "junglewood"}, {"default", "jungletree"}, @@ -50,7 +50,7 @@ local snodes = { {"default", "acacia_wood"}, {"default", "acacia_tree"}, - + {"moreores", "mithril_block"}, } @@ -60,7 +60,7 @@ for i,value in pairs(snodes) do if(minetest.registered_nodes[value[1]..":"..value[2]]) then register(value[1], value[2]) else - minetest.log("info","[MOD]stealthnode: Node " .. value[1]..":"..value[2].." not found to register a Stealthnode.") + minetest.log("info","[MOD]stealthnode:Node ".. value[1]..":"..value[2].." not found to register a Stealthnode.") end -- if(mintest.registered_nodes - + end -- for i,value