Refactor machines.lua (reduced ~300 lines of code)
This commit is contained in:
parent
dbb83ba6e3
commit
40d0e578c4
2
api.lua
2
api.lua
@ -249,7 +249,7 @@ industrialtest.api.powerFlow=function(pos)
|
|||||||
if def then
|
if def then
|
||||||
local updateFormspec=def._industrialtest_updateFormspec
|
local updateFormspec=def._industrialtest_updateFormspec
|
||||||
if updateFormspec then
|
if updateFormspec then
|
||||||
updateFormspec(value)
|
updateFormspec(neighbourPositions[key])
|
||||||
end
|
end
|
||||||
local onPowerFlow=def._industrialtest_onPowerFlow
|
local onPowerFlow=def._industrialtest_onPowerFlow
|
||||||
if onPowerFlow and transferred then
|
if onPowerFlow and transferred then
|
||||||
|
1119
machines.lua
1119
machines.lua
File diff suppressed because it is too large
Load Diff
@ -75,7 +75,7 @@ minetest.register_on_player_receive_fields(function(player,formname,fields)
|
|||||||
meta:set_string("industrialtest.powerIOConfig",fields.powerIOConfig)
|
meta:set_string("industrialtest.powerIOConfig",fields.powerIOConfig)
|
||||||
local def=minetest.registered_nodes[minetest.get_node(context).name]
|
local def=minetest.registered_nodes[minetest.get_node(context).name]
|
||||||
if def and def._industrialtest_updateFormspec then
|
if def and def._industrialtest_updateFormspec then
|
||||||
def._industrialtest_updateFormspec(meta)
|
def._industrialtest_updateFormspec(context)
|
||||||
end
|
end
|
||||||
minetest.close_formspec(player:get_player_name(),formname)
|
minetest.close_formspec(player:get_player_name(),formname)
|
||||||
elseif fields.triggerNeighbours then
|
elseif fields.triggerNeighbours then
|
||||||
|
Loading…
Reference in New Issue
Block a user