4 -- internationalization boilerplate
5 local MP = minetest.get_modpath(minetest.get_current_modname())
6 local S = minetest.get_translator("hopper")
8 hopper.formspec_bg = "background[-0.19,-0.25;9.41,9.49;gui_hb_bg.png]"
10 dofile(MP.."/config.lua")
11 dofile(MP.."/api.lua")
12 dofile(MP.."/utility.lua")
13 dofile(MP.."/doc.lua")
14 dofile(MP.."/nodes/hoppers.lua")
15 dofile(MP.."/nodes/chute.lua")
16 dofile(MP.."/nodes/sorter.lua")
17 dofile(MP.."/crafts.lua")
18 dofile(MP.."/abms.lua")
21 -------------------------------------------------------------------------------------------
24 minetest.register_on_player_receive_fields(function(player, formname, fields)
25 if "hopper_formspec:" == string.sub(formname, 1, 16) then
26 local pos = minetest.string_to_pos(string.sub(formname, 17, -1))
27 local meta = minetest.get_meta(pos)
28 local eject_setting = meta:get_string("eject") == "true"
29 local filter_all_setting = meta:get_string("filter_all") == "true"
32 meta:set_string("eject", nil)
34 meta:set_string("eject", "true")
37 if fields.filter_all then
38 if filter_all_setting then
39 meta:set_string("filter_all", nil)
41 meta:set_string("filter_all", "true")