-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_sprite_row_flipped.lua
72 lines (64 loc) · 4.08 KB
/
generate_sprite_row_flipped.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
local folder = "./CraftBoyDatapack/data/craftboy/functions/ppu/"
local master = io.open(folder .. "sprite_row_flipped.mcfunction", "w")
master:write([[
scoreboard players operation index craftboy = row ppu
function craftboy:read/tile_vram/main
scoreboard players operation in binary = transfer craftboy
function craftboy:util/binary_split0
scoreboard players add index craftboy 1
function craftboy:read/tile_vram/main
scoreboard players operation in binary = transfer craftboy
function craftboy:util/binary_split1
]])
for i = 0, 7 do
master:write([[
execute unless block ~]] .. i .. [[ ~ ~ air if score ]] .. i ..
[[_1 binary matches 0 if score ]] .. i ..
[[_0 binary matches 1 if score 3_3 binary matches 0 if score 2_3 binary matches 0 run setblock ~]] ..
i .. [[ ~ ~ lime_concrete_powder
execute unless block ~]] .. i .. [[ ~ ~ air if score ]] .. i ..
[[_1 binary matches 0 if score ]] .. i ..
[[_0 binary matches 1 if score 3_3 binary matches 0 if score 2_3 binary matches 1 run setblock ~]] ..
i .. [[ ~ ~ lime_concrete
execute unless block ~]] .. i .. [[ ~ ~ air if score ]] .. i ..
[[_1 binary matches 0 if score ]] .. i ..
[[_0 binary matches 1 if score 3_3 binary matches 1 if score 2_3 binary matches 0 run setblock ~]] ..
i .. [[ ~ ~ green_concrete_powder
execute unless block ~]] .. i .. [[ ~ ~ air if score ]] .. i ..
[[_1 binary matches 0 if score ]] .. i ..
[[_0 binary matches 1 if score 3_3 binary matches 1 if score 2_3 binary matches 1 run setblock ~]] ..
i .. [[ ~ ~ green_concrete
execute unless block ~]] .. i .. [[ ~ ~ air if score ]] .. i ..
[[_1 binary matches 1 if score ]] .. i ..
[[_0 binary matches 0 if score 5_3 binary matches 0 if score 4_3 binary matches 0 run setblock ~]] ..
i .. [[ ~ ~ lime_concrete_powder
execute unless block ~]] .. i .. [[ ~ ~ air if score ]] .. i ..
[[_1 binary matches 1 if score ]] .. i ..
[[_0 binary matches 0 if score 5_3 binary matches 0 if score 4_3 binary matches 1 run setblock ~]] ..
i .. [[ ~ ~ lime_concrete
execute unless block ~]] .. i .. [[ ~ ~ air if score ]] .. i ..
[[_1 binary matches 1 if score ]] .. i ..
[[_0 binary matches 0 if score 5_3 binary matches 1 if score 4_3 binary matches 0 run setblock ~]] ..
i .. [[ ~ ~ green_concrete_powder
execute unless block ~]] .. i .. [[ ~ ~ air if score ]] .. i ..
[[_1 binary matches 1 if score ]] .. i ..
[[_0 binary matches 0 if score 5_3 binary matches 1 if score 4_3 binary matches 1 run setblock ~]] ..
i .. [[ ~ ~ green_concrete
execute unless block ~]] .. i .. [[ ~ ~ air if score ]] .. i ..
[[_1 binary matches 1 if score ]] .. i ..
[[_0 binary matches 1 if score 7_3 binary matches 0 if score 6_3 binary matches 0 run setblock ~]] ..
i .. [[ ~ ~ lime_concrete_powder
execute unless block ~]] .. i .. [[ ~ ~ air if score ]] .. i ..
[[_1 binary matches 1 if score ]] .. i ..
[[_0 binary matches 1 if score 7_3 binary matches 0 if score 6_3 binary matches 1 run setblock ~]] ..
i .. [[ ~ ~ lime_concrete
execute unless block ~]] .. i .. [[ ~ ~ air if score ]] .. i ..
[[_1 binary matches 1 if score ]] .. i ..
[[_0 binary matches 1 if score 7_3 binary matches 1 if score 6_3 binary matches 0 run setblock ~]] ..
i .. [[ ~ ~ green_concrete_powder
execute unless block ~]] .. i .. [[ ~ ~ air if score ]] .. i ..
[[_1 binary matches 1 if score ]] .. i ..
[[_0 binary matches 1 if score 7_3 binary matches 1 if score 6_3 binary matches 1 run setblock ~]] ..
i .. [[ ~ ~ green_concrete
]])
end