mirror of
https://github.com/acmgit/mesecons_stealthnode.git
synced 2024-11-22 15:23:47 +01:00
Bugfix.
This commit is contained in:
parent
5ffbad8afb
commit
f145e30bb2
@ -16,6 +16,9 @@ The function to register your own ghoststones are integrated.<br>
|
|||||||
|
|
||||||
Move your Download to the Mods-Folder.<br>
|
Move your Download to the Mods-Folder.<br>
|
||||||
|
|
||||||
|
## Version
|
||||||
|
V 1.6
|
||||||
|
|
||||||
## Depends
|
## Depends
|
||||||
|
|
||||||
default<br>
|
default<br>
|
||||||
|
2
init.lua
2
init.lua
@ -14,7 +14,7 @@ stealthnode.revision = "6"
|
|||||||
local modpath = minetest.get_modpath("mesecons_stealthnodes")
|
local modpath = minetest.get_modpath("mesecons_stealthnodes")
|
||||||
local S = minetest.get_translator(minetest.get_current_modname())
|
local S = minetest.get_translator(minetest.get_current_modname())
|
||||||
|
|
||||||
stealhnode.S = S
|
stealthnode.S = S
|
||||||
|
|
||||||
dofile(modpath .. "/register.lua")
|
dofile(modpath .. "/register.lua")
|
||||||
dofile(modpath .. "/nodes.lua")
|
dofile(modpath .. "/nodes.lua")
|
||||||
|
39
register.lua
39
register.lua
@ -119,19 +119,45 @@ function stealthnode.register_conductnode(modname, node)
|
|||||||
|
|
||||||
if not nodedef then
|
if not nodedef then
|
||||||
local message = "[MOD] " .. minetest.get_current_modname() .. ": "
|
local message = "[MOD] " .. minetest.get_current_modname() .. ": "
|
||||||
.. node_name .. " not found to register a conductnode."
|
.. node_name .. " not found to register a stealthnode."
|
||||||
print(message)
|
print(message)
|
||||||
minetest.log("warning", message)
|
minetest.log("warning", message)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local conductnode_name = "mesecons_stealthnode:" .. modname .. "_" .. node
|
local stealthnode_name = "mesecons_stealthnode:" .. modname .. "_" .. node .. "_conducting"
|
||||||
|
|
||||||
local node_groups = copy_table(nodedef.groups) or {}
|
local node_groups = copy_table(nodedef.groups) or {}
|
||||||
node_groups.mesecons_stealthnode = 1
|
node_groups.mesecons_stealthnode = 1
|
||||||
|
|
||||||
minetest.register_node(":" .. conductnode_name, {
|
minetest.register_node(":" .. stealthnode_name, {
|
||||||
description = S("Conducting") .. " " .. nodedef.description,
|
description = S("Conducting") .. " " .. nodedef.description,
|
||||||
|
drawtype = nodedef.drawtype,
|
||||||
|
tiles = nodedef.tiles,
|
||||||
|
use_texture_alpha = nodedef.use_texture_alpha,
|
||||||
|
paramtype = nodedef.paramtype,
|
||||||
|
paramtype2 = nodedef.paramtype2,
|
||||||
|
is_ground_content = false,
|
||||||
|
sunlight_propagates = nodedef.sunlight_propagates,
|
||||||
|
node_box = nodedef.node_box,
|
||||||
|
mesh = nodedef.mesh,
|
||||||
|
selection_box = nodedef.selection_box,
|
||||||
|
collision_box = nodedef.collision_box,
|
||||||
|
sounds = nodedef.sounds,
|
||||||
|
groups = node_groups,
|
||||||
|
inventory_image = nodedef.inventory_image,
|
||||||
|
drop = stealthnode_name,
|
||||||
|
mesecons = {
|
||||||
|
conductor = {
|
||||||
|
state = mesecon.state.off,
|
||||||
|
rules = mesecon.rules.alldirs,
|
||||||
|
onstate = stealthnode_name .. "_on",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
on_blast = mesecon.on_blastnode,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_node(":" .. stealthnode_name .. "_on", {
|
||||||
drawtype = nodedef.drawtype,
|
drawtype = nodedef.drawtype,
|
||||||
tiles = nodedef.tiles,
|
tiles = nodedef.tiles,
|
||||||
use_texture_alpha = nodedef.use_texture_alpha,
|
use_texture_alpha = nodedef.use_texture_alpha,
|
||||||
@ -148,18 +174,19 @@ function stealthnode.register_conductnode(modname, node)
|
|||||||
inventory_image = nodedef.inventory_image,
|
inventory_image = nodedef.inventory_image,
|
||||||
mesecons = {
|
mesecons = {
|
||||||
conductor = {
|
conductor = {
|
||||||
state = mesecon.state.off,
|
state = mesecon.state.on,
|
||||||
rules = mesecon.rules.alldirs,
|
rules = mesecon.rules.alldirs,
|
||||||
|
offstate = stealthnode_name,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
on_blast = mesecon.on_blastnode,
|
on_blast = mesecon.on_blastnode,
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = conductnode_name .. " 4",
|
output = stealthnode_name .. "_off" .. " 4",
|
||||||
recipe = {
|
recipe = {
|
||||||
{"default:tin_ingot", node_name, "default:tin_ingot"},
|
{"default:tin_ingot", node_name, "default:tin_ingot"},
|
||||||
{node_name, "mesecons:wire_00000000_off", node_name},
|
{node_name, "group:mesecon_conductor_craftable", node_name},
|
||||||
{"default:tin_ingot", node_name, "default:tin_ingot"},
|
{"default:tin_ingot", node_name, "default:tin_ingot"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user