From 5658011d7637355f33a5609235b4a9eb9f434f2f Mon Sep 17 00:00:00 2001 From: "A.C.M" Date: Sun, 21 Jul 2019 13:32:56 +0200 Subject: [PATCH] Bug fixed, splitted in 2 mods. --- LICENSE => mesecons_stealthnode/LICENSE | 0 README.md => mesecons_stealthnode/README.md | 0 .../depends.txt | 0 mesecons_stealthnode/init.lua | 17 +++++++++ mod.conf => mesecons_stealthnode/mod.conf | 0 .../register.lua | 4 +- .../scrshot_1.jpg | Bin .../scrshot_2.jpg | Bin modpack.txt | 0 register_stealthnodes/depends.txt | 3 ++ init.lua => register_stealthnodes/init.lua | 35 +++++++++--------- register_stealthnodes/mod.conf | 4 ++ 12 files changed, 43 insertions(+), 20 deletions(-) rename LICENSE => mesecons_stealthnode/LICENSE (100%) rename README.md => mesecons_stealthnode/README.md (100%) rename depends.txt => mesecons_stealthnode/depends.txt (100%) create mode 100644 mesecons_stealthnode/init.lua rename mod.conf => mesecons_stealthnode/mod.conf (100%) rename register.lua => mesecons_stealthnode/register.lua (94%) rename scrshot_1.jpg => mesecons_stealthnode/scrshot_1.jpg (100%) rename scrshot_2.jpg => mesecons_stealthnode/scrshot_2.jpg (100%) create mode 100644 modpack.txt create mode 100644 register_stealthnodes/depends.txt rename init.lua => register_stealthnodes/init.lua (66%) create mode 100644 register_stealthnodes/mod.conf diff --git a/LICENSE b/mesecons_stealthnode/LICENSE similarity index 100% rename from LICENSE rename to mesecons_stealthnode/LICENSE diff --git a/README.md b/mesecons_stealthnode/README.md similarity index 100% rename from README.md rename to mesecons_stealthnode/README.md diff --git a/depends.txt b/mesecons_stealthnode/depends.txt similarity index 100% rename from depends.txt rename to mesecons_stealthnode/depends.txt diff --git a/mesecons_stealthnode/init.lua b/mesecons_stealthnode/init.lua new file mode 100644 index 0000000..3a014f7 --- /dev/null +++ b/mesecons_stealthnode/init.lua @@ -0,0 +1,17 @@ +--[[ + ******************************************** + *** Mesecons Stealthnodes ** + ******************************************** + + A mod for Minetest to register various Ghoststones. + +]]-- + +stealthnode = {} +stealthnode.version = "1" +stealthnode.revision = "3" + +dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/register.lua") + +print("[MOD] " .. minetest.get_current_modname() .. " loaded.") +minetest.log("info", "[MOD] " .. minetest.get_current_modname() .. " loaded.") diff --git a/mod.conf b/mesecons_stealthnode/mod.conf similarity index 100% rename from mod.conf rename to mesecons_stealthnode/mod.conf diff --git a/register.lua b/mesecons_stealthnode/register.lua similarity index 94% rename from register.lua rename to mesecons_stealthnode/register.lua index 02769b5..6c48990 100644 --- a/register.lua +++ b/mesecons_stealthnode/register.lua @@ -28,7 +28,7 @@ function stealthnode.register_stealthnode(modname, node) local newgroup = {} newgroup = stealthnode.table_clone(minetest.registered_nodes[modname .. ":" .. node].groups) - minetest.register_node("mesecons_stealthnode:" .. modname .. "_" .. node, { + minetest.register_node(":mesecons_stealthnode:" .. modname .. "_" .. node, { description="Stealthnode " .. minetest.registered_nodes[modname .. ":" .. node].description, tiles = tile, is_ground_content = false, @@ -43,7 +43,7 @@ function stealthnode.register_stealthnode(modname, node) on_blast = mesecon.on_blastnode, }) - minetest.register_node("mesecons_stealthnode:" .. modname .. "_" .. node .. "_active", { + minetest.register_node(":mesecons_stealthnode:" .. modname .. "_" .. node .. "_active", { drawtype = "airlike", pointable = false, walkable = false, diff --git a/scrshot_1.jpg b/mesecons_stealthnode/scrshot_1.jpg similarity index 100% rename from scrshot_1.jpg rename to mesecons_stealthnode/scrshot_1.jpg diff --git a/scrshot_2.jpg b/mesecons_stealthnode/scrshot_2.jpg similarity index 100% rename from scrshot_2.jpg rename to mesecons_stealthnode/scrshot_2.jpg diff --git a/modpack.txt b/modpack.txt new file mode 100644 index 0000000..e69de29 diff --git a/register_stealthnodes/depends.txt b/register_stealthnodes/depends.txt new file mode 100644 index 0000000..978516b --- /dev/null +++ b/register_stealthnodes/depends.txt @@ -0,0 +1,3 @@ +default +mesecons_stealthnode +moretores? diff --git a/init.lua b/register_stealthnodes/init.lua similarity index 66% rename from init.lua rename to register_stealthnodes/init.lua index dcf6330..a59f6f6 100644 --- a/init.lua +++ b/register_stealthnodes/init.lua @@ -1,18 +1,14 @@ --[[ - ******************************************** - *** Mesecons Stealthnodes ** - ******************************************** - - A mod for Minetest to register various Ghoststones. - + ******************************************** + ** ** + ** Stealthnode-Register ** + ** ** + ** Helpmod for Stealthnode to ** + ** easy Register new Stealthnodes ** + ** ** + ******************************************** ]]-- -stealthnode = {} -stealthnode.version = "1" -stealthnode.revision = "0" - -dofile(minetest.get_modpath(minetest.get_current_modname()) .. "/register.lua") - local snodes = { {"default", "cobble"}, {"default", "stone"}, @@ -54,14 +50,17 @@ local snodes = { {"default", "acacia_wood"}, {"default", "acacia_tree"}, + + {"moreores", "mithril_block"}, } local register = stealthnode.register_stealthnode for i,value in pairs(snodes) do - register(value[1], value[2]) - -end - -print("[MOD] " .. minetest.get_current_modname() .. " loaded.") -minetest.log("info", "[MOD] " .. minetest.get_current_modname() .. " loaded.") + 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.") + end -- if(mintest.registered_nodes + +end -- for i,value diff --git a/register_stealthnodes/mod.conf b/register_stealthnodes/mod.conf new file mode 100644 index 0000000..e471f18 --- /dev/null +++ b/register_stealthnodes/mod.conf @@ -0,0 +1,4 @@ +name = register_stealthnode +description = A helpmod to register Ghoststones. +depends = default, mesecons_stealthnode +optional_depends = moreores