Use nodebox for rendering cables

This commit is contained in:
2023-03-11 19:50:49 +01:00
parent 4e7499279c
commit 7ce091f423
5 changed files with 149 additions and 42 deletions

16
api.lua
View File

@@ -131,13 +131,15 @@ industrialtest.api.powerFlow=function(pos)
transferred=true
end
local def=minetest.registered_nodes[minetest.get_node(neighbourPositions[key]).name]
local updateFormspec=def._industrialtest_updateFormspec
if updateFormspec then
updateFormspec(value)
end
local onPowerFlow=def._industrialtest_onPowerFlow
if onPowerFlow and transferred then
onPowerFlow(neighbourPositions[key],industrialtest.api.getOppositeSide(key))
if def then
local updateFormspec=def._industrialtest_updateFormspec
if updateFormspec then
updateFormspec(value)
end
local onPowerFlow=def._industrialtest_onPowerFlow
if onPowerFlow and transferred then
onPowerFlow(neighbourPositions[key],industrialtest.api.getOppositeSide(key))
end
end
minetest.get_node_timer(neighbourPositions[key]):start(industrialtest.updateDelay)
if not industrialtest.api.isFullyCharged(value) then