Skip to content

Commit

Permalink
Merge pull request #1 from thomasrudin-mt/glass-support
Browse files Browse the repository at this point in the history
Glass support
  • Loading branch information
acmgit authored Dec 11, 2019
2 parents ee06f4c + 933d000 commit b894590
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/luacheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: luacheck

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: apt
run: sudo apt-get install -y luarocks
- name: luacheck install
run: luarocks install --local luacheck
- name: luacheck run
run: $HOME/.luarocks/bin/luacheck ./
8 changes: 6 additions & 2 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -14,5 +17,6 @@ read_globals = {
"dump", "DIR_DELIM", "VoxelArea", "Settings",

-- MTG
"default"
"default",
"mesecon"
}
12 changes: 8 additions & 4 deletions mesecons_stealthnode/register.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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() .. ": "
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions register_stealthnodes/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down

0 comments on commit b894590

Please sign in to comment.