Refactor machines.lua (reduced ~300 lines of code)

This commit is contained in:
mrkubax10 2023-04-07 19:50:39 +02:00
parent dbb83ba6e3
commit 40d0e578c4
3 changed files with 523 additions and 600 deletions

View File

@ -249,7 +249,7 @@ industrialtest.api.powerFlow=function(pos)
if def then
local updateFormspec=def._industrialtest_updateFormspec
if updateFormspec then
updateFormspec(value)
updateFormspec(neighbourPositions[key])
end
local onPowerFlow=def._industrialtest_onPowerFlow
if onPowerFlow and transferred then

File diff suppressed because it is too large Load Diff

View File

@ -75,7 +75,7 @@ minetest.register_on_player_receive_fields(function(player,formname,fields)
meta:set_string("industrialtest.powerIOConfig",fields.powerIOConfig)
local def=minetest.registered_nodes[minetest.get_node(context).name]
if def and def._industrialtest_updateFormspec then
def._industrialtest_updateFormspec(meta)
def._industrialtest_updateFormspec(context)
end
minetest.close_formspec(player:get_player_name(),formname)
elseif fields.triggerNeighbours then