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

BuckarooBanzay / mapblock_lib / 8748698230

19 Apr 2024 05:08AM UTC coverage: 19.22% (-35.6%) from 54.827%
8748698230

Pull #3

github

BuckarooBanzay
mtt action
Pull Request #3: mtt action

202 of 1051 relevant lines covered (19.22%)

16.77 hits per line

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

3.33
/transform/transform.lua
1
local function get_axis_others(axis)
2
        if axis == "x" then
×
3
                return "y", "z"
×
4
        elseif axis == "y" then
×
5
                return "x", "z"
×
6
        elseif axis == "z" then
×
7
                return "x", "y"
×
8
        else
9
                error("Axis must be x, y, or z!")
×
10
        end
11
end
12

13

14
function mapblock_lib.transform(transform, max, mapblock, metadata)
2✔
15
        if transform.set_param2 then
×
16
                mapblock_lib.set_param2(transform.set_param2, mapblock)
×
17
        end
18

19
        if transform.rotate then
×
20
                local axis = transform.rotate.axis
×
21
                local angle = transform.rotate.angle
×
22
                local disable_orientation = transform.rotate.disable_orientation or {}
×
23

24
                local other1, other2 = get_axis_others(axis)
×
25

26
                if angle == 90 then
×
27
                        mapblock_lib.flip(other1, max, mapblock, metadata)
×
28
                        mapblock_lib.transpose(other1, other2, max, mapblock, metadata)
×
29
                        if axis == "y" then
×
30
                                mapblock_lib.orient(90, max, mapblock, disable_orientation)
×
31
                        end
32
                elseif angle == 180 then
×
33
                        mapblock_lib.flip(other1, max, mapblock, metadata)
×
34
                        mapblock_lib.flip(other2, max, mapblock, metadata)
×
35
                        if axis == "y" then
×
36
                                mapblock_lib.orient(180, max, mapblock, disable_orientation)
×
37
                        end
38
                elseif angle == 270 then
×
39
                        mapblock_lib.flip(other2, max, mapblock, metadata)
×
40
                        mapblock_lib.transpose(other1, other2, max, mapblock, metadata)
×
41
                        if axis == "y" then
×
42
                                mapblock_lib.orient(270, max, mapblock, disable_orientation)
×
43
                        end
44
                end
45
        end
46

47
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

© 2025 Coveralls, Inc