From 41e9f16513f0523f4ae80f47efb50c61c23382ea Mon Sep 17 00:00:00 2001 From: Thomas Rudin Date: Thu, 5 Dec 2019 15:04:32 +0100 Subject: [PATCH] add flags for glass and register obsidian and default glass --- .luacheckrc | 8 ++++++-- mesecons_stealthnode/register.lua | 12 ++++++++---- register_stealthnodes/init.lua | 3 +++ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index f512afd..8f5548a 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -2,7 +2,10 @@ unused_args = false allow_defined_top = true globals = { - "minetest","mesecons_stealthnode","mesecons_random" + "minetest", + "mesecons_stealthnode", + "mesecons_random", + "stealthnode" } read_globals = { @@ -14,5 +17,6 @@ read_globals = { "dump", "DIR_DELIM", "VoxelArea", "Settings", -- MTG - "default" + "default", + "mesecon" } diff --git a/mesecons_stealthnode/register.lua b/mesecons_stealthnode/register.lua index 8a1fbb2..15d4ecc 100644 --- a/mesecons_stealthnode/register.lua +++ b/mesecons_stealthnode/register.lua @@ -14,9 +14,10 @@ function stealthnode.register_stealthnode(modname, node) + local nodedef = minetest.registered_nodes[modname .. ":" .. node] local tile - if minetest.registered_nodes[modname .. ":" .. node] == nil then + if nodedef == nil then print("[MOD] " .. minetest.get_current_modname() .. ": " .. modname .. ":" .. node .. " not found to register a stealthnode.") minetest.log("warning", "[MOD] " .. minetest.get_current_modname() .. ": " @@ -27,11 +28,14 @@ function stealthnode.register_stealthnode(modname, node) end - local newgroup = stealthnode.table_clone(minetest.registered_nodes[modname .. ":" .. node].groups) + local newgroup = stealthnode.table_clone(nodedef.groups) minetest.register_node(":mesecons_stealthnode:" .. modname .. "_" .. node, { - description="Stealthnode " .. minetest.registered_nodes[modname .. ":" .. node].description, + description="Stealthnode " .. nodedef.description, tiles = tile, + drawtype = nodedef.drawtype, + sunlight_propagates = nodedef.sunlight_propagates, + paramtype = nodedef.paramtype, is_ground_content = false, inventory_image = tile, groups = newgroup, @@ -60,7 +64,7 @@ function stealthnode.register_stealthnode(modname, node) }}, on_construct = function(pos) -- remove shadow - shadowpos = vector.add(pos, vector.new(0, 1, 0)) + local shadowpos = vector.add(pos, vector.new(0, 1, 0)) if (minetest.get_node(shadowpos).name == "air") then minetest.dig_node(shadowpos) end diff --git a/register_stealthnodes/init.lua b/register_stealthnodes/init.lua index 79366d5..593b908 100644 --- a/register_stealthnodes/init.lua +++ b/register_stealthnodes/init.lua @@ -15,6 +15,9 @@ local snodes = { {"default", "stonebrick"}, {"default", "stone_block"}, + {"default", "glass"}, + {"default", "obsidian_glass"}, + {"default", "desert_cobble"}, {"default", "desert_stone"}, {"default", "desert_stonebrick"},