• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

blockexchange / blockexchange / 13549447711

26 Feb 2025 05:08PM UTC coverage: 51.158% (-1.1%) from 52.251%
13549447711

push

github

web-flow
simple `/bx` command

* bx menu

* profile stub

* ui util / styling

* ui

* wip

* ui nav

* `/bx` info

* bump timeout

---------

Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>

15 of 75 new or added lines in 3 files covered. (20.0%)

16 existing lines in 3 files now uncovered.

994 of 1943 relevant lines covered (51.16%)

1271.47 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

94.06
/init.lua
1
local MP = minetest.get_modpath("blockexchange")
1✔
2

3
-- optional http instance
4
local http = minetest.request_http_api and minetest.request_http_api()
1✔
5

6
-- global namespace
7
blockexchange = {
1✔
8
        -- online flag
9
        is_online = http ~= nil,
1✔
10
        mod_storage = minetest.get_mod_storage(),
2✔
11
        api = {},
1✔
12
        api_version_major = 1,
13
        url = minetest.settings:get("blockexchange.url") or "https://blockexchange.minetest.ch",
1✔
14
        min_delay = 0.1,
15
        pos1 = {}, -- name -> pos
1✔
16
        pos2 = {}, -- name -> pos
1✔
17
        max_size = 1000
×
18
}
1✔
19

20
-- min-delay for async operations
21
local min_delay_setting = tonumber(minetest.settings:get("blockexchange.min_delay"))
1✔
22
if min_delay_setting and min_delay_setting > 0 then
1✔
23
        -- use setting
24
        blockexchange.min_delay = min_delay_setting
×
25
elseif minetest.is_singleplayer() then
1✔
26
        -- default to 0 in singleplayer
UNCOV
27
        blockexchange.min_delay = 0
×
28
end
29

30
assert(mtzip.api_version == 1, "mtzip api compatibility")
1✔
31
assert(Promise.api_version == 1, "Promise api compatibility")
1✔
32

33
if not blockexchange.is_online then
1✔
UNCOV
34
        minetest.log("warning", "[blockexchange] the http api is not enabled, functionality is limited to local operations")
×
35
end
36

37
-- http api
38
if blockexchange.is_online then
1✔
39
        loadfile(MP.."/api/info.lua")(http, blockexchange.url)
1✔
40
        loadfile(MP.."/api/schema.lua")(http, blockexchange.url)
1✔
41
        loadfile(MP.."/api/schemapart.lua")(http, blockexchange.url)
1✔
42
        loadfile(MP.."/api/schemamods.lua")(http, blockexchange.url)
1✔
43
        loadfile(MP.."/api/token.lua")(http, blockexchange.url)
1✔
44
        loadfile(MP.."/api/media.lua")(http, blockexchange.url)
1✔
45
end
46

47
-- internal stuff
48
dofile(MP.."/jobcontext.lua")
1✔
49
dofile(MP.."/privs.lua")
1✔
50
dofile(MP.."/markers.lua")
1✔
51
dofile(MP.."/token.lua")
1✔
52
dofile(MP.."/license.lua")
1✔
53
dofile(MP.."/hud.lua")
1✔
54
dofile(MP.."/areas.lua")
1✔
55
dofile(MP.."/autosave.lua")
1✔
56

57
-- utils
58
dofile(MP.."/util/ui.lua")
1✔
59
dofile(MP.."/util/pointed.lua")
1✔
60
dofile(MP.."/util/placer_tool.lua")
1✔
61
dofile(MP.."/util/placer_entity.lua")
1✔
62
dofile(MP.."/util/placer_preview.lua")
1✔
63
dofile(MP.."/util/remove_nodes.lua")
1✔
64
dofile(MP.."/util/player_area.lua")
1✔
65
dofile(MP.."/util/compare_area.lua")
1✔
66
dofile(MP.."/util/cleanup_area.lua")
1✔
67
dofile(MP.."/util/ignored_content_ids.lua")
1✔
68
dofile(MP.."/util/serialize.lua")
1✔
69
dofile(MP.."/util/deserialize.lua")
1✔
70
dofile(MP.."/util/local_files.lua")
1✔
71
dofile(MP.."/util/check_api_compat.lua")
1✔
72
dofile(MP.."/util/get_schema_size.lua")
1✔
73
dofile(MP.."/util/get_mapblock.lua")
1✔
74
dofile(MP.."/util/sort_pos.lua")
1✔
75
dofile(MP.."/util/get_mapblock_bounds_from_mapblock.lua")
1✔
76
dofile(MP.."/util/schemapart_offset.lua")
1✔
77
dofile(MP.."/util/clip_area.lua")
1✔
78
dofile(MP.."/util/is_area_protected.lua")
1✔
79
dofile(MP.."/util/get_base_pos.lua")
1✔
80
dofile(MP.."/util/iterator.lua")
1✔
81
dofile(MP.."/util/log.lua")
1✔
82
dofile(MP.."/util/collect_node_count.lua")
1✔
83
dofile(MP.."/util/check_size.lua")
1✔
84
dofile(MP.."/util/count_schemaparts.lua")
1✔
85
dofile(MP.."/util/unpack_schemapart.lua")
1✔
86
dofile(MP.."/util/place_schemapart.lua")
1✔
87
dofile(MP.."/util/validate_name.lua")
1✔
88
dofile(MP.."/util/is_player_in_area.lua")
1✔
89
dofile(MP.."/util/create_schemapart.lua")
1✔
90

91
if blockexchange.is_online then
1✔
92
        -- online commands
93
        dofile(MP.."/commands/info.lua")
1✔
94
        dofile(MP.."/commands/license.lua")
1✔
95
        dofile(MP.."/commands/user.lua")
1✔
96
        dofile(MP.."/commands/placer.lua")
1✔
97
        dofile(MP.."/commands/save.lua")
1✔
98
        dofile(MP.."/commands/save_update.lua")
1✔
99
        dofile(MP.."/commands/autosave.lua")
1✔
100
        dofile(MP.."/commands/media.lua")
1✔
101
        dofile(MP.."/commands/load.lua")
1✔
102
        dofile(MP.."/commands/bx.lua")
1✔
103
else
UNCOV
104
        dofile(MP.."/commands/offline_info.lua")
×
105
end
106
-- commands
107
dofile(MP.."/commands/pos.lua")
1✔
108
dofile(MP.."/commands/area.lua")
1✔
109
dofile(MP.."/commands/cancel_chat.lua")
1✔
110
dofile(MP.."/commands/allocate.lua")
1✔
111
dofile(MP.."/commands/load_local.lua")
1✔
112
dofile(MP.."/commands/save_local.lua")
1✔
113
dofile(MP.."/commands/emerge.lua")
1✔
114
dofile(MP.."/commands/protectioncheck.lua")
1✔
115
dofile(MP.."/commands/cleanup.lua")
1✔
116

117
-- compat
118
if minetest.get_modpath("advtrains") then
1✔
UNCOV
119
        dofile(MP.."/compat/advtrains.lua")
×
120
end
121

122
-- testing
123
if minetest.get_modpath("mtt") then
1✔
124
        dofile(MP .. "/mtt/serialize_spec.lua")
1✔
125
        dofile(MP .. "/mtt/token_spec.lua")
1✔
126
        dofile(MP .. "/mtt/areas_spec.lua")
1✔
127
        dofile(MP .. "/mtt/clip_area_spec.lua")
1✔
128
        dofile(MP .. "/mtt/get_base_pos_spec.lua")
1✔
129
        dofile(MP .. "/mtt/iterator_spec.lua")
1✔
130
        dofile(MP .. "/mtt/schemapart_offset_spec.lua")
1✔
131
        dofile(MP .. "/mtt/sort_pos_spec.lua")
1✔
132
        dofile(MP .. "/mtt/validate_name_spec.lua")
1✔
133
        dofile(MP .. "/mtt/load_save.spec.lua")
1✔
134
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc