-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathblock.c
185 lines (182 loc) · 6.56 KB
/
block.c
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#include <glib.h>
#include "block.h"
struct block_info block_info[256] = {
[0x00] = {"air", AIR, NO_TRAIT},
[0x01] = {"stone", SOLID, NO_TRAIT},
[0x02] = {"grass", SOLID, NO_TRAIT},
[0x03] = {"dirt", SOLID, NO_TRAIT},
[0x04] = {"cobblestone", SOLID, NO_TRAIT},
[0x05] = {"wood", SOLID, NO_TRAIT},
[0x06] = {"sapling", SOLID, NO_TRAIT},
[0x07] = {"bedrock", SOLID, NO_TRAIT},
[0x08] = {"water", LIQUID, WATER_TRAIT},
[0x09] = {"water", LIQUID, WATER_TRAIT},
[0x0a] = {"lava", LIQUID, LAVA_TRAIT},
[0x0b] = {"lava", LIQUID, LAVA_TRAIT},
[0x0c] = {"sand", SOLID, NO_TRAIT},
[0x0d] = {"gravel", SOLID, NO_TRAIT},
[0x0e] = {"gold ore", SOLID, NO_TRAIT},
[0x0f] = {"iron ore", SOLID, NO_TRAIT},
[0x10] = {"coal ore", SOLID, NO_TRAIT},
[0x11] = {"wood", SOLID, NO_TRAIT},
[0x12] = {"leaves", SOLID, NO_TRAIT},
[0x13] = {"sponge", SOLID, NO_TRAIT},
[0x14] = {"glass", SOLID, NO_TRAIT},
[0x15] = {"lapis lazuli ore", SOLID, NO_TRAIT},
[0x16] = {"lapis lazuli block", SOLID, NO_TRAIT},
[0x17] = {"dispenser", SOLID, NO_TRAIT},
[0x18] = {"sandstone", SOLID, NO_TRAIT},
[0x19] = {"note block", SOLID, NO_TRAIT},
[0x1a] = {"bed", SOLID, NO_TRAIT},
[0x1b] = {"powered rail", SOLID, NO_TRAIT},
[0x1c] = {"detector rail", SOLID, NO_TRAIT},
[0x1d] = {"sticky piston", SOLID, NO_TRAIT},
[0x1e] = {"cobweb", SOLID, NO_TRAIT},
[0x1f] = {"tall grass", SOLID, NO_TRAIT},
[0x20] = {"dead bush", SOLID, NO_TRAIT},
[0x21] = {"piston", SOLID, NO_TRAIT},
[0x22] = {"piston extension", SOLID, NO_TRAIT},
[0x23] = {"wool", SOLID, NO_TRAIT},
[0x24] = {"block moved by piston", SOLID, NO_TRAIT},
[0x25] = {"dandelion", SOLID, NO_TRAIT},
[0x26] = {"rose", SOLID, NO_TRAIT},
[0x27] = {"brown mushroom", SOLID, NO_TRAIT},
[0x28] = {"red mushroom", SOLID, NO_TRAIT},
[0x29] = {"gold block", SOLID, NO_TRAIT},
[0x2a] = {"iron block", SOLID, NO_TRAIT},
[0x2b] = {"double slabs", SOLID, NO_TRAIT},
[0x2c] = {"slabs", SOLID, NO_TRAIT},
[0x2d] = {"bricks", SOLID, NO_TRAIT},
[0x2e] = {"tnt", SOLID, NO_TRAIT},
[0x2f] = {"bookshelf", SOLID, NO_TRAIT},
[0x30] = {"moss stone", SOLID, NO_TRAIT},
[0x31] = {"obsidian", SOLID, NO_TRAIT},
[0x32] = {"torch", SOLID, NO_TRAIT},
[0x33] = {"fire", SOLID, NO_TRAIT},
[0x34] = {"monster spawner", SOLID, NO_TRAIT},
[0x35] = {"wooden stairs", SOLID, NO_TRAIT},
[0x36] = {"chest", SOLID, NO_TRAIT},
[0x37] = {"redstone wire", SOLID, NO_TRAIT},
[0x38] = {"diamond ore", SOLID, NO_TRAIT},
[0x39] = {"diamond block", SOLID, NO_TRAIT},
[0x3a] = {"crafting table", SOLID, NO_TRAIT},
[0x3b] = {"wheat seeds", SOLID, NO_TRAIT},
[0x3c] = {"farmland", SOLID, NO_TRAIT},
[0x3d] = {"furnace", SOLID, NO_TRAIT},
[0x3e] = {"burning furnace", SOLID, NO_TRAIT},
[0x3f] = {"sign post", SOLID, NO_TRAIT},
[0x40] = {"wooden door", SOLID, NO_TRAIT},
[0x41] = {"ladders", SOLID, NO_TRAIT},
[0x42] = {"rails", SOLID, NO_TRAIT},
[0x43] = {"cobblestone stairs", SOLID, NO_TRAIT},
[0x44] = {"sign", SOLID, NO_TRAIT},
[0x45] = {"lever", SOLID, NO_TRAIT},
[0x46] = {"stone pressure plate", SOLID, NO_TRAIT},
[0x47] = {"iron door", SOLID, NO_TRAIT},
[0x48] = {"wooden pressure plate", SOLID, NO_TRAIT},
[0x49] = {"redstone ore", SOLID, NO_TRAIT},
[0x4a] = {"redstone ore", SOLID, NO_TRAIT},
[0x4b] = {"redstone torch (off)", SOLID, NO_TRAIT},
[0x4c] = {"redstone torch (on)", SOLID, NO_TRAIT},
[0x4d] = {"stone button", SOLID, NO_TRAIT},
[0x4e] = {"snow", SOLID, NO_TRAIT},
[0x4f] = {"ice", SOLID, NO_TRAIT},
[0x50] = {"snow block", SOLID, NO_TRAIT},
[0x51] = {"cactus", SOLID, NO_TRAIT},
[0x52] = {"clay block", SOLID, NO_TRAIT},
[0x53] = {"sugar cane", SOLID, NO_TRAIT},
[0x54] = {"jukebox", SOLID, NO_TRAIT},
[0x55] = {"fence", SOLID, NO_TRAIT},
[0x56] = {"pumpkin", SOLID, NO_TRAIT},
[0x57] = {"netherrack", SOLID, NO_TRAIT},
[0x58] = {"soul sand", SOLID, NO_TRAIT},
[0x59] = {"glowstone block", SOLID, NO_TRAIT},
[0x5a] = {"portal", SOLID, NO_TRAIT},
[0x5b] = {"jack-o-lantern", SOLID, NO_TRAIT},
[0x5c] = {"cake block", SOLID, NO_TRAIT},
[0x5d] = {"redstone repeater (off)", SOLID, NO_TRAIT},
[0x5e] = {"redstone repeater (on)", SOLID, NO_TRAIT},
[0x5f] = {"locked chest", SOLID, NO_TRAIT},
[0x60] = {"trapdoor", SOLID, NO_TRAIT},
[0x61] = {"hidden silverfish", SOLID, NO_TRAIT},
[0x62] = {"stone bricks", SOLID, NO_TRAIT},
[0x63] = {"huge brown mushroom", SOLID, NO_TRAIT},
[0x64] = {"huge red mushroom", SOLID, NO_TRAIT},
[0x65] = {"iron bars", SOLID, NO_TRAIT},
[0x66] = {"glass pane", SOLID, NO_TRAIT},
[0x67] = {"melon", SOLID, NO_TRAIT},
[0x68] = {"pumpkin stem", SOLID, NO_TRAIT},
[0x69] = {"melon stem", SOLID, NO_TRAIT},
[0x6a] = {"vines", SOLID, NO_TRAIT},
[0x6b] = {"fence gate", SOLID, NO_TRAIT},
[0x6c] = {"brick stairs", SOLID, NO_TRAIT},
[0x6d] = {"stone brick stairs", SOLID, NO_TRAIT},
[0x6e] = {"mycelium", SOLID, NO_TRAIT},
[0x6f] = {"lily pad", SOLID, NO_TRAIT},
[0x70] = {"nether brick", SOLID, NO_TRAIT},
[0x71] = {"nether brick fence", SOLID, NO_TRAIT},
[0x72] = {"nether brick stairs", SOLID, NO_TRAIT},
[0x73] = {"nether wart", SOLID, NO_TRAIT},
[0x74] = {"enchantment table", SOLID, NO_TRAIT},
[0x75] = {"brewing stand", SOLID, NO_TRAIT},
[0x76] = {"cauldron", SOLID, NO_TRAIT},
[0x77] = {"end portal", SOLID, NO_TRAIT},
[0x78] = {"end portal frame", SOLID, NO_TRAIT},
[0x79] = {"end stone", SOLID, NO_TRAIT},
[0x7a] = {"dragon egg", SOLID, NO_TRAIT},
};
char *default_colors[] = {
"air: 135 206 235",
"stone: 180 180 180",
"grass: 34 180 0",
"dirt: 158 123 18",
"cobblestone: 128 128 128",
"wood: 133 78 0",
"sapling: 0 132 0",
"water: 39 161 225",
"lava: 255 81 0",
"sand: 245 245 69",
"gravel: 222 190 160",
"gold ore: 255 180 0",
"iron ore: 92 92 92",
"coal ore: 51 51 51",
"wood: 95 55 0",
"leaves: 0 132 0",
"glass: 185 234 231 170",
"lapis lazuli ore: 65 102 245",
"lapis lazuli block: 65 102 245",
"sandstone: 245 245 69",
"tall grass: 34 180 0",
"wool: 240 240 240",
"dandelion: 137 180 0",
"rose: 122 130 0",
"gold block: 255 180 0",
"iron block: 92 92 92",
"double slabs: 180 180 180",
"slabs: 180 180 180",
"bricks: 160 0 0",
"moss stone: 0 255 0",
"obsidian: 61 0 61",
"torch: 255 255 0",
"fire: 255 108 0",
"wooden stairs: 133 78 0",
"redstone wire: 160 0 0",
"diamond ore: 0 255 255",
"diamond block: 0 255 255",
"farmland: 114 76 9",
"cobblestone stairs: 128 128 128",
"redstone ore: 160 0 0",
"redstone torch (off): 160 0 0",
"redstone torch (on): 160 0 0",
"snow: 238 238 255 127",
"ice: 211 255 255 127",
"snow block: 238 255 255",
"clay block: 165 42 42",
"sugar cane: 0 255 0",
"pumpkin: 246 156 0",
"netherrack: 121 17 0",
"soul sand: 107 43 15",
"glowstone block: 186 157 0",
"jack-o-lantern: 246 156 0",
0
};