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

BuckarooBanzay / mapblock_lib / 8991244474

07 May 2024 07:33PM UTC coverage: 54.52% (-0.3%) from 54.827%
8991244474

Pull #4

github

BuckarooBanzay
metadata marker block
Pull Request #4: Metadata marker

8 of 19 new or added lines in 4 files covered. (42.11%)

591 of 1084 relevant lines covered (54.52%)

2671.86 hits per line

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

31.25
/metadata.lua
1

2
local function update_formspec(meta)
NEW
3
    local group = meta:get_string("group")
×
4
    -- TODO
5

NEW
6
    meta:set_string("formspec", [[
×
7
        size[10,8.3]
8
        real_coordinates[true]
NEW
9
        field[0.1,0.4;8.8,0.8;group;Group;]] .. group .. [[]
×
10
        button_exit[9,0.4;0.9,0.8;set;Set]
11
        list[context;main;0.1,1.4;8,1;]
12
        list[current_player;main;0.1,3;8,4;]
13
        listring[]
NEW
14
    ]])
×
15
end
16

17
minetest.register_node("mapblock_lib:metadata", {
2✔
18
        description = "Mapblock-lib metadata marker",
19
        tiles = {"mapblock_lib_metadata.png^[colorize:#23c1cc"},
1✔
20
    drawtype = "allfaces",
21
    use_texture_alpha = "blend",
22
    paramtype = "light",
23
    paramtype2 = "facedir",
24
    sunlight_propagates = true,
25
        groups = {
1✔
NEW
26
                oddly_breakable_by_hand = 3
×
27
        },
1✔
28

29
        on_construct = function(pos)
NEW
30
                local meta = minetest.get_meta(pos)
×
NEW
31
        update_formspec(meta)
×
32
        end,
33

34
    on_receive_fields = function(pos, _, fields)
NEW
35
        if fields.set then
×
NEW
36
            local meta = minetest.get_meta(pos)
×
NEW
37
            meta:set_string("group", fields.group)
×
NEW
38
            update_formspec(meta)
×
39
        end
40
    end
41
})
1✔
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

© 2025 Coveralls, Inc