forked from mrkubax10/industrialtest
Implement copper cable
This commit is contained in:
16
nodes.lua
16
nodes.lua
@@ -43,20 +43,6 @@ minetest.register_craft({
|
||||
minetest.register_on_placenode(function(pos,newNode)
|
||||
local def=minetest.registered_nodes[newNode.name]
|
||||
if def and def._industrialtest_hasPowerInput then
|
||||
local neighbourPositions={
|
||||
vector.offset(pos,-1,0,0),
|
||||
vector.offset(pos,1,0,0),
|
||||
vector.offset(pos,0,-1,0),
|
||||
vector.offset(pos,0,1,0),
|
||||
vector.offset(pos,0,0,-1),
|
||||
vector.offset(pos,0,0,1)
|
||||
}
|
||||
for key,value in ipairs(neighbourPositions) do
|
||||
local meta=minetest.get_meta(value)
|
||||
local strIndex=(key%2==0 and key-1 or key+1)
|
||||
if industrialtest.api.hasPowerStorage(meta) and string.sub(meta:get_string("industrialtest.ioConfig"),strIndex,strIndex)=="o" then
|
||||
minetest.get_node_timer(value):start(1.0)
|
||||
end
|
||||
end
|
||||
industrialtest.api.triggerNeighbours(pos)
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user