mirror of
https://github.com/mt-mods/pipeworks.git
synced 2025-07-04 01:00:35 +02:00
restructure avoiding excessive indentation
This commit is contained in:
committed by
GitHub
parent
1169cff163
commit
962f3280dc
@ -47,7 +47,9 @@ if minetest.get_modpath("default") then
|
|||||||
-- get the fields from the chest formspec, we can do this bc. newest functions are called first
|
-- get the fields from the chest formspec, we can do this bc. newest functions are called first
|
||||||
-- https://github.com/minetest/minetest/blob/d4b10db998ebeb689b3d27368e30952a42169d03/doc/lua_api.md?plain=1#L5840
|
-- https://github.com/minetest/minetest/blob/d4b10db998ebeb689b3d27368e30952a42169d03/doc/lua_api.md?plain=1#L5840
|
||||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||||
if formname == "default:chest" then
|
if formname ~= "default:chest" then
|
||||||
|
return
|
||||||
|
end
|
||||||
local pn = player:get_player_name()
|
local pn = player:get_player_name()
|
||||||
local pos = default.chest.open_chests[pn].pos
|
local pos = default.chest.open_chests[pn].pos
|
||||||
local chest = pos and minetest.get_node(pos)
|
local chest = pos and minetest.get_node(pos)
|
||||||
@ -61,7 +63,6 @@ if minetest.get_modpath("default") then
|
|||||||
end
|
end
|
||||||
-- Do NOT return true here, the callback from default still needs to run
|
-- Do NOT return true here, the callback from default still needs to run
|
||||||
return false
|
return false
|
||||||
end
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
local connect_sides = {left = 1, right = 1, back = 1, bottom = 1, top = 1}
|
local connect_sides = {left = 1, right = 1, back = 1, bottom = 1, top = 1}
|
||||||
|
Reference in New Issue
Block a user