mirror of
https://github.com/acmgit/mesecons_stealthnode.git
synced 2024-11-22 07:13:45 +01:00
add flags for glass and register obsidian and default glass
This commit is contained in:
parent
ee06f4c468
commit
41e9f16513
@ -2,7 +2,10 @@ unused_args = false
|
|||||||
allow_defined_top = true
|
allow_defined_top = true
|
||||||
|
|
||||||
globals = {
|
globals = {
|
||||||
"minetest","mesecons_stealthnode","mesecons_random"
|
"minetest",
|
||||||
|
"mesecons_stealthnode",
|
||||||
|
"mesecons_random",
|
||||||
|
"stealthnode"
|
||||||
}
|
}
|
||||||
|
|
||||||
read_globals = {
|
read_globals = {
|
||||||
@ -14,5 +17,6 @@ read_globals = {
|
|||||||
"dump", "DIR_DELIM", "VoxelArea", "Settings",
|
"dump", "DIR_DELIM", "VoxelArea", "Settings",
|
||||||
|
|
||||||
-- MTG
|
-- MTG
|
||||||
"default"
|
"default",
|
||||||
|
"mesecon"
|
||||||
}
|
}
|
||||||
|
@ -14,9 +14,10 @@
|
|||||||
|
|
||||||
function stealthnode.register_stealthnode(modname, node)
|
function stealthnode.register_stealthnode(modname, node)
|
||||||
|
|
||||||
|
local nodedef = minetest.registered_nodes[modname .. ":" .. node]
|
||||||
local tile
|
local tile
|
||||||
|
|
||||||
if minetest.registered_nodes[modname .. ":" .. node] == nil then
|
if nodedef == nil then
|
||||||
print("[MOD] " .. minetest.get_current_modname() .. ": "
|
print("[MOD] " .. minetest.get_current_modname() .. ": "
|
||||||
.. modname .. ":" .. node .. " not found to register a stealthnode.")
|
.. modname .. ":" .. node .. " not found to register a stealthnode.")
|
||||||
minetest.log("warning", "[MOD] " .. minetest.get_current_modname() .. ": "
|
minetest.log("warning", "[MOD] " .. minetest.get_current_modname() .. ": "
|
||||||
@ -27,11 +28,14 @@ function stealthnode.register_stealthnode(modname, node)
|
|||||||
|
|
||||||
end
|
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, {
|
minetest.register_node(":mesecons_stealthnode:" .. modname .. "_" .. node, {
|
||||||
description="Stealthnode " .. minetest.registered_nodes[modname .. ":" .. node].description,
|
description="Stealthnode " .. nodedef.description,
|
||||||
tiles = tile,
|
tiles = tile,
|
||||||
|
drawtype = nodedef.drawtype,
|
||||||
|
sunlight_propagates = nodedef.sunlight_propagates,
|
||||||
|
paramtype = nodedef.paramtype,
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
inventory_image = tile,
|
inventory_image = tile,
|
||||||
groups = newgroup,
|
groups = newgroup,
|
||||||
@ -60,7 +64,7 @@ function stealthnode.register_stealthnode(modname, node)
|
|||||||
}},
|
}},
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
-- remove shadow
|
-- 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
|
if (minetest.get_node(shadowpos).name == "air") then
|
||||||
minetest.dig_node(shadowpos)
|
minetest.dig_node(shadowpos)
|
||||||
end
|
end
|
||||||
|
@ -15,6 +15,9 @@ local snodes = {
|
|||||||
{"default", "stonebrick"},
|
{"default", "stonebrick"},
|
||||||
{"default", "stone_block"},
|
{"default", "stone_block"},
|
||||||
|
|
||||||
|
{"default", "glass"},
|
||||||
|
{"default", "obsidian_glass"},
|
||||||
|
|
||||||
{"default", "desert_cobble"},
|
{"default", "desert_cobble"},
|
||||||
{"default", "desert_stone"},
|
{"default", "desert_stone"},
|
||||||
{"default", "desert_stonebrick"},
|
{"default", "desert_stonebrick"},
|
||||||
|
Loading…
Reference in New Issue
Block a user