@xiaozhu2007/koishi-plugin-litematic-renderer 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/assets/threeviews/assets/block-assets.js +3 -0
- package/assets/threeviews/assets/block-flags.js +413 -0
- package/assets/threeviews/{/346/210/221/347/232/204/344/270/226/347/225/214-Litematic/346/212/225/345/275/261/344/270/211/350/247/206/345/233/276/351/242/204/350/247/210_files/deepslate-helpers.js./344/270/213/350/275/275 → assets/deepslate-resources.js} +67 -35
- package/assets/threeviews/assets/deepslate.min.js +7558 -0
- package/assets/threeviews/assets/gl-matrix.min.js +4195 -0
- package/assets/threeviews/{/346/210/221/347/232/204/344/270/226/347/225/214-Litematic/346/212/225/345/275/261/344/270/211/350/247/206/345/233/276/351/242/204/350/247/210_files/litematic-utils.js./344/270/213/350/275/275 → assets/litematic.js} +63 -64
- package/assets/threeviews/assets/renderer-api.js +936 -0
- package/assets/threeviews/index.html +1205 -1212
- package/lib/index.d.ts +11 -10
- package/lib/index.js +1 -1
- package/package.json +31 -27
- package/assets/threeviews//346/210/221/347/232/204/344/270/226/347/225/214-Litematic/346/212/225/345/275/261/344/270/211/350/247/206/345/233/276/351/242/204/350/247/210_files/api.js./344/270/213/350/275/275 +0 -917
- package/assets/threeviews//346/210/221/347/232/204/344/270/226/347/225/214-Litematic/346/212/225/345/275/261/344/270/211/350/247/206/345/233/276/351/242/204/350/247/210_files/assets.js./344/270/213/350/275/275 +0 -1
- package/assets/threeviews//346/210/221/347/232/204/344/270/226/347/225/214-Litematic/346/212/225/345/275/261/344/270/211/350/247/206/345/233/276/351/242/204/350/247/210_files/deepslate.js./344/270/213/350/275/275 +0 -2
- package/assets/threeviews//346/210/221/347/232/204/344/270/226/347/225/214-Litematic/346/212/225/345/275/261/344/270/211/350/247/206/345/233/276/351/242/204/350/247/210_files/gl-matrix-min.js./344/270/213/350/275/275 +0 -28
- package/assets/threeviews//346/210/221/347/232/204/344/270/226/347/225/214-Litematic/346/212/225/345/275/261/344/270/211/350/247/206/345/233/276/351/242/204/350/247/210_files/opaque.js./344/270/213/350/275/275 +0 -413
- /package/assets/threeviews/{/346/210/221/347/232/204/344/270/226/347/225/214-Litematic/346/212/225/345/275/261/344/270/211/350/247/206/345/233/276/351/242/204/350/247/210_files/atlas.png" → assets/atlas.png} +0 -0
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
const OPAQUE_BLOCKS = new Set([
|
|
2
|
+
"minecraft:acacia_planks",
|
|
3
|
+
"minecraft:acacia_wood",
|
|
4
|
+
"minecraft:amethyst_block",
|
|
5
|
+
"minecraft:ancient_debris",
|
|
6
|
+
"minecraft:andesite",
|
|
7
|
+
"minecraft:barrel",
|
|
8
|
+
"minecraft:bamboo_block",
|
|
9
|
+
"minecraft:bamboo_mosaic",
|
|
10
|
+
"minecraft:bamboo_planks",
|
|
11
|
+
"minecraft:basalt",
|
|
12
|
+
"minecraft:bedrock",
|
|
13
|
+
"minecraft:bee_nest",
|
|
14
|
+
"minecraft:beehive",
|
|
15
|
+
"minecraft:birch_log",
|
|
16
|
+
"minecraft:birch_planks",
|
|
17
|
+
"minecraft:birch_wood",
|
|
18
|
+
"minecraft:black_concrete",
|
|
19
|
+
"minecraft:black_concrete_powder",
|
|
20
|
+
"minecraft:black_glazed_terracotta",
|
|
21
|
+
"minecraft:black_terracotta",
|
|
22
|
+
"minecraft:blackstone",
|
|
23
|
+
"minecraft:blast_furnace",
|
|
24
|
+
"minecraft:blue_concrete",
|
|
25
|
+
"minecraft:blue_concrete_powder",
|
|
26
|
+
"minecraft:blue_glazed_terracotta",
|
|
27
|
+
"minecraft:blue_ice",
|
|
28
|
+
"minecraft:blue_terracotta",
|
|
29
|
+
"minecraft:blue_wool",
|
|
30
|
+
"minecraft:bone_block",
|
|
31
|
+
"minecraft:bookshelf",
|
|
32
|
+
"minecraft:brain_coral_block",
|
|
33
|
+
"minecraft:bricks",
|
|
34
|
+
"minecraft:brown_concrete",
|
|
35
|
+
"minecraft:brown_concrete_powder",
|
|
36
|
+
"minecraft:brown_glazed_terracotta",
|
|
37
|
+
"minecraft:brown_mushroom_block",
|
|
38
|
+
"minecraft:brown_terracotta",
|
|
39
|
+
"minecraft:brown_wool",
|
|
40
|
+
"minecraft:bubble_coral_block",
|
|
41
|
+
"minecraft:calcite",
|
|
42
|
+
"minecraft:cartography_table",
|
|
43
|
+
"minecraft:carved_pumpkin",
|
|
44
|
+
"minecraft:chain_command_block",
|
|
45
|
+
"minecraft:cherry_log",
|
|
46
|
+
"minecraft:cherry_planks",
|
|
47
|
+
"minecraft:cherry_wood",
|
|
48
|
+
"minecraft:chiseled_bookshelf",
|
|
49
|
+
"minecraft:chiseled_copper",
|
|
50
|
+
"minecraft:chiseled_deepslate",
|
|
51
|
+
"minecraft:chiseled_nether_bricks",
|
|
52
|
+
"minecraft:chiseled_polished_blackstone",
|
|
53
|
+
"minecraft:chiseled_quartz_block",
|
|
54
|
+
"minecraft:chiseled_red_sandstone",
|
|
55
|
+
"minecraft:chiseled_sandstone",
|
|
56
|
+
"minecraft:chiseled_stone_bricks",
|
|
57
|
+
"minecraft:chiseled_tuff",
|
|
58
|
+
"minecraft:chiseled_tuff_bricks",
|
|
59
|
+
"minecraft:clay",
|
|
60
|
+
"minecraft:coal_block",
|
|
61
|
+
"minecraft:coal_ore",
|
|
62
|
+
"minecraft:coarse_dirt",
|
|
63
|
+
"minecraft:cobbled_deepslate",
|
|
64
|
+
"minecraft:cobbled_deepslate_wall",
|
|
65
|
+
"minecraft:cobblestone",
|
|
66
|
+
"minecraft:command_block",
|
|
67
|
+
"minecraft:copper_block",
|
|
68
|
+
"minecraft:copper_bulb",
|
|
69
|
+
"minecraft:copper_ore",
|
|
70
|
+
"minecraft:cracked_deepslate_bricks",
|
|
71
|
+
"minecraft:cracked_deepslate_tiles",
|
|
72
|
+
"minecraft:cracked_nether_bricks",
|
|
73
|
+
"minecraft:cracked_polished_blackstone_bricks",
|
|
74
|
+
"minecraft:cracked_stone_bricks",
|
|
75
|
+
"minecraft:crafting_table",
|
|
76
|
+
"minecraft:crafter",
|
|
77
|
+
"minecraft:crimson_hyphae",
|
|
78
|
+
"minecraft:crimson_nylium",
|
|
79
|
+
"minecraft:crimson_planks",
|
|
80
|
+
"minecraft:crimson_roots",
|
|
81
|
+
"minecraft:crimson_stem",
|
|
82
|
+
"minecraft:crying_obsidian",
|
|
83
|
+
"minecraft:cut_copper",
|
|
84
|
+
"minecraft:cut_red_sandstone",
|
|
85
|
+
"minecraft:cut_sandstone",
|
|
86
|
+
"minecraft:cyan_concrete",
|
|
87
|
+
"minecraft:cyan_concrete_powder",
|
|
88
|
+
"minecraft:cyan_glazed_terracotta",
|
|
89
|
+
"minecraft:cyan_terracotta",
|
|
90
|
+
"minecraft:cyan_wool",
|
|
91
|
+
"minecraft:dark_oak_log",
|
|
92
|
+
"minecraft:dark_oak_planks",
|
|
93
|
+
"minecraft:dark_oak_wood",
|
|
94
|
+
"minecraft:dark_prismarine",
|
|
95
|
+
"minecraft:dead_brain_coral_block",
|
|
96
|
+
"minecraft:dead_bubble_coral_block",
|
|
97
|
+
"minecraft:dead_fire_coral_block",
|
|
98
|
+
"minecraft:dead_horn_coral_block",
|
|
99
|
+
"minecraft:dead_tube_coral_block",
|
|
100
|
+
"minecraft:deepslate",
|
|
101
|
+
"minecraft:deepslate_bricks",
|
|
102
|
+
"minecraft:deepslate_coal_ore",
|
|
103
|
+
"minecraft:deepslate_copper_ore",
|
|
104
|
+
"minecraft:deepslate_diamond_ore",
|
|
105
|
+
"minecraft:deepslate_emerald_ore",
|
|
106
|
+
"minecraft:deepslate_gold_ore",
|
|
107
|
+
"minecraft:deepslate_iron_ore",
|
|
108
|
+
"minecraft:deepslate_lapis_ore",
|
|
109
|
+
"minecraft:deepslate_redstone_ore",
|
|
110
|
+
"minecraft:deepslate_tiles",
|
|
111
|
+
"minecraft:diamond_block",
|
|
112
|
+
"minecraft:diamond_ore",
|
|
113
|
+
"minecraft:diorite",
|
|
114
|
+
"minecraft:dirt",
|
|
115
|
+
"minecraft:dispenser",
|
|
116
|
+
"minecraft:dried_kelp_block",
|
|
117
|
+
"minecraft:dripstone_block",
|
|
118
|
+
"minecraft:dropper",
|
|
119
|
+
"minecraft:emerald_block",
|
|
120
|
+
"minecraft:emerald_ore",
|
|
121
|
+
"minecraft:end_stone",
|
|
122
|
+
"minecraft:end_stone_bricks",
|
|
123
|
+
"minecraft:exposed_chiseled_copper",
|
|
124
|
+
"minecraft:exposed_copper",
|
|
125
|
+
"minecraft:exposed_copper_bulb",
|
|
126
|
+
"minecraft:exposed_cut_copper",
|
|
127
|
+
"minecraft:fire_coral_block",
|
|
128
|
+
"minecraft:fletching_table",
|
|
129
|
+
"minecraft:furnace",
|
|
130
|
+
"minecraft:gilded_blackstone",
|
|
131
|
+
"minecraft:glowstone",
|
|
132
|
+
"minecraft:gold_block",
|
|
133
|
+
"minecraft:gold_ore",
|
|
134
|
+
"minecraft:granite",
|
|
135
|
+
"minecraft:grass_block",
|
|
136
|
+
"minecraft:gravel",
|
|
137
|
+
"minecraft:gray_concrete",
|
|
138
|
+
"minecraft:gray_concrete_powder",
|
|
139
|
+
"minecraft:gray_glazed_terracotta",
|
|
140
|
+
"minecraft:gray_terracotta",
|
|
141
|
+
"minecraft:gray_wool",
|
|
142
|
+
"minecraft:green_concrete",
|
|
143
|
+
"minecraft:green_concrete_powder",
|
|
144
|
+
"minecraft:green_glazed_terracotta",
|
|
145
|
+
"minecraft:green_terracotta",
|
|
146
|
+
"minecraft:green_wool",
|
|
147
|
+
"minecraft:hay_block",
|
|
148
|
+
"minecraft:honeycomb_block",
|
|
149
|
+
"minecraft:horn_coral_block",
|
|
150
|
+
"minecraft:infested_chiseled_stone_bricks",
|
|
151
|
+
"minecraft:infested_cobblestone",
|
|
152
|
+
"minecraft:infested_cracked_stone_bricks",
|
|
153
|
+
"minecraft:infested_deepslate",
|
|
154
|
+
"minecraft:infested_mossy_stone_bricks",
|
|
155
|
+
"minecraft:infested_stone",
|
|
156
|
+
"minecraft:infested_stone_bricks",
|
|
157
|
+
"minecraft:iron_block",
|
|
158
|
+
"minecraft:iron_ore",
|
|
159
|
+
"minecraft:jack_o_lantern",
|
|
160
|
+
"minecraft:jigsaw",
|
|
161
|
+
"minecraft:jukebox",
|
|
162
|
+
"minecraft:jungle_log",
|
|
163
|
+
"minecraft:jungle_planks",
|
|
164
|
+
"minecraft:jungle_wood",
|
|
165
|
+
"minecraft:lapis_block",
|
|
166
|
+
"minecraft:lapis_ore",
|
|
167
|
+
"minecraft:light_blue_concrete",
|
|
168
|
+
"minecraft:light_blue_concrete_powder",
|
|
169
|
+
"minecraft:light_blue_glazed_terracotta",
|
|
170
|
+
"minecraft:light_blue_terracotta",
|
|
171
|
+
"minecraft:light_blue_wool",
|
|
172
|
+
"minecraft:light_gray_concrete",
|
|
173
|
+
"minecraft:light_gray_concrete_powder",
|
|
174
|
+
"minecraft:light_gray_glazed_terracotta",
|
|
175
|
+
"minecraft:light_gray_terracotta",
|
|
176
|
+
"minecraft:light_gray_wool",
|
|
177
|
+
"minecraft:lime_concrete",
|
|
178
|
+
"minecraft:lime_concrete_powder",
|
|
179
|
+
"minecraft:lime_glazed_terracotta",
|
|
180
|
+
"minecraft:lime_terracotta",
|
|
181
|
+
"minecraft:lime_wool",
|
|
182
|
+
"minecraft:lodestone",
|
|
183
|
+
"minecraft:loom",
|
|
184
|
+
"minecraft:magenta_concrete",
|
|
185
|
+
"minecraft:magenta_concrete_powder",
|
|
186
|
+
"minecraft:magenta_glazed_terracotta",
|
|
187
|
+
"minecraft:magenta_terracotta",
|
|
188
|
+
"minecraft:magenta_wool",
|
|
189
|
+
"minecraft:magma_block",
|
|
190
|
+
"minecraft:mangrove_log",
|
|
191
|
+
"minecraft:mangrove_planks",
|
|
192
|
+
"minecraft:mangrove_wood",
|
|
193
|
+
"minecraft:melon",
|
|
194
|
+
"minecraft:moss_block",
|
|
195
|
+
"minecraft:mossy_cobblestone",
|
|
196
|
+
"minecraft:mossy_stone_bricks",
|
|
197
|
+
"minecraft:mud",
|
|
198
|
+
"minecraft:mud_bricks",
|
|
199
|
+
"minecraft:mycelium",
|
|
200
|
+
"minecraft:nether_bricks",
|
|
201
|
+
"minecraft:nether_gold_ore",
|
|
202
|
+
"minecraft:nether_quartz_ore",
|
|
203
|
+
"minecraft:nether_wart_block",
|
|
204
|
+
"minecraft:netherite_block",
|
|
205
|
+
"minecraft:netherrack",
|
|
206
|
+
"minecraft:note_block",
|
|
207
|
+
"minecraft:oak_log",
|
|
208
|
+
"minecraft:oak_planks",
|
|
209
|
+
"minecraft:oak_wood",
|
|
210
|
+
"minecraft:observer",
|
|
211
|
+
"minecraft:obsidian",
|
|
212
|
+
"minecraft:ochre_froglight",
|
|
213
|
+
"minecraft:orange_concrete",
|
|
214
|
+
"minecraft:orange_concrete_powder",
|
|
215
|
+
"minecraft:orange_glazed_terracotta",
|
|
216
|
+
"minecraft:orange_terracotta",
|
|
217
|
+
"minecraft:orange_wool",
|
|
218
|
+
"minecraft:oxidized_chiseled_copper",
|
|
219
|
+
"minecraft:oxidized_copper",
|
|
220
|
+
"minecraft:oxidized_copper_bulb",
|
|
221
|
+
"minecraft:oxidized_cut_copper",
|
|
222
|
+
"minecraft:packed_ice",
|
|
223
|
+
"minecraft:packed_mud",
|
|
224
|
+
"minecraft:pearlescent_froglight",
|
|
225
|
+
"minecraft:pink_concrete",
|
|
226
|
+
"minecraft:pink_concrete_powder",
|
|
227
|
+
"minecraft:pink_glazed_terracotta",
|
|
228
|
+
"minecraft:pink_terracotta",
|
|
229
|
+
"minecraft:pink_wool",
|
|
230
|
+
"minecraft:podzol",
|
|
231
|
+
"minecraft:polished_andesite",
|
|
232
|
+
"minecraft:polished_basalt",
|
|
233
|
+
"minecraft:polished_blackstone",
|
|
234
|
+
"minecraft:polished_blackstone_bricks",
|
|
235
|
+
"minecraft:polished_deepslate",
|
|
236
|
+
"minecraft:polished_diorite",
|
|
237
|
+
"minecraft:polished_granite",
|
|
238
|
+
"minecraft:polished_tuff",
|
|
239
|
+
"minecraft:powder_snow",
|
|
240
|
+
"minecraft:prismarine",
|
|
241
|
+
"minecraft:prismarine_bricks",
|
|
242
|
+
"minecraft:pumpkin",
|
|
243
|
+
"minecraft:purple_concrete",
|
|
244
|
+
"minecraft:purple_concrete_powder",
|
|
245
|
+
"minecraft:purple_glazed_terracotta",
|
|
246
|
+
"minecraft:purple_terracotta",
|
|
247
|
+
"minecraft:purple_wool",
|
|
248
|
+
"minecraft:purpur_block",
|
|
249
|
+
"minecraft:purpur_pillar",
|
|
250
|
+
"minecraft:quartz_block",
|
|
251
|
+
"minecraft:quartz_bricks",
|
|
252
|
+
"minecraft:quartz_pillar",
|
|
253
|
+
"minecraft:raw_copper_block",
|
|
254
|
+
"minecraft:raw_gold_block",
|
|
255
|
+
"minecraft:raw_iron_block",
|
|
256
|
+
"minecraft:red_concrete",
|
|
257
|
+
"minecraft:red_concrete_powder",
|
|
258
|
+
"minecraft:red_glazed_terracotta",
|
|
259
|
+
"minecraft:red_mushroom_block",
|
|
260
|
+
"minecraft:red_nether_bricks",
|
|
261
|
+
"minecraft:red_sand",
|
|
262
|
+
"minecraft:red_sandstone",
|
|
263
|
+
"minecraft:red_terracotta",
|
|
264
|
+
"minecraft:red_wool",
|
|
265
|
+
"minecraft:redstone_block",
|
|
266
|
+
"minecraft:redstone_lamp",
|
|
267
|
+
"minecraft:redstone_ore",
|
|
268
|
+
"minecraft:repeating_command_block",
|
|
269
|
+
"minecraft:respawn_anchor",
|
|
270
|
+
"minecraft:rooted_dirt",
|
|
271
|
+
"minecraft:sand",
|
|
272
|
+
"minecraft:sandstone",
|
|
273
|
+
"minecraft:sculk",
|
|
274
|
+
"minecraft:sculk_catalyst",
|
|
275
|
+
"minecraft:sea_lantern",
|
|
276
|
+
"minecraft:shroomlight",
|
|
277
|
+
"minecraft:smithing_table",
|
|
278
|
+
"minecraft:smoker",
|
|
279
|
+
"minecraft:smooth_basalt",
|
|
280
|
+
"minecraft:smooth_quartz",
|
|
281
|
+
"minecraft:smooth_red_sandstone",
|
|
282
|
+
"minecraft:smooth_sandstone",
|
|
283
|
+
"minecraft:smooth_stone",
|
|
284
|
+
"minecraft:snow_block",
|
|
285
|
+
"minecraft:soul_sand",
|
|
286
|
+
"minecraft:soul_soil",
|
|
287
|
+
"minecraft:sponge",
|
|
288
|
+
"minecraft:spruce_log",
|
|
289
|
+
"minecraft:spruce_planks",
|
|
290
|
+
"minecraft:spruce_wood",
|
|
291
|
+
"minecraft:stone",
|
|
292
|
+
"minecraft:stone_bricks",
|
|
293
|
+
"minecraft:stripped_acacia_log",
|
|
294
|
+
"minecraft:stripped_acacia_wood",
|
|
295
|
+
"minecraft:stripped_bamboo_block",
|
|
296
|
+
"minecraft:stripped_birch_log",
|
|
297
|
+
"minecraft:stripped_birch_wood",
|
|
298
|
+
"minecraft:stripped_cherry_log",
|
|
299
|
+
"minecraft:stripped_cherry_wood",
|
|
300
|
+
"minecraft:stripped_crimson_hyphae",
|
|
301
|
+
"minecraft:stripped_crimson_stem",
|
|
302
|
+
"minecraft:stripped_dark_oak_log",
|
|
303
|
+
"minecraft:stripped_dark_oak_wood",
|
|
304
|
+
"minecraft:stripped_jungle_log",
|
|
305
|
+
"minecraft:stripped_jungle_wood",
|
|
306
|
+
"minecraft:stripped_mangrove_log",
|
|
307
|
+
"minecraft:stripped_mangrove_wood",
|
|
308
|
+
"minecraft:stripped_oak_log",
|
|
309
|
+
"minecraft:stripped_oak_wood",
|
|
310
|
+
"minecraft:stripped_spruce_log",
|
|
311
|
+
"minecraft:stripped_spruce_wood",
|
|
312
|
+
"minecraft:stripped_warped_hyphae",
|
|
313
|
+
"minecraft:stripped_warped_stem",
|
|
314
|
+
"minecraft:structure_block",
|
|
315
|
+
"minecraft:suspicious_gravel",
|
|
316
|
+
"minecraft:suspicious_sand",
|
|
317
|
+
"minecraft:target",
|
|
318
|
+
"minecraft:terracotta",
|
|
319
|
+
"minecraft:tnt",
|
|
320
|
+
"minecraft:tube_coral_block",
|
|
321
|
+
"minecraft:tuff",
|
|
322
|
+
"minecraft:tuff_bricks",
|
|
323
|
+
"minecraft:verdant_froglight",
|
|
324
|
+
"minecraft:warped_hyphae",
|
|
325
|
+
"minecraft:warped_nylium",
|
|
326
|
+
"minecraft:warped_planks",
|
|
327
|
+
"minecraft:warped_stem",
|
|
328
|
+
"minecraft:warped_wart_block",
|
|
329
|
+
"minecraft:waxed_chiseled_copper",
|
|
330
|
+
"minecraft:waxed_copper_block",
|
|
331
|
+
"minecraft:waxed_copper_bulb",
|
|
332
|
+
"minecraft:waxed_cut_copper",
|
|
333
|
+
"minecraft:waxed_exposed_chiseled_copper",
|
|
334
|
+
"minecraft:waxed_exposed_copper",
|
|
335
|
+
"minecraft:waxed_exposed_copper_bulb",
|
|
336
|
+
"minecraft:waxed_exposed_cut_copper",
|
|
337
|
+
"minecraft:waxed_oxidized_chiseled_copper",
|
|
338
|
+
"minecraft:waxed_oxidized_copper",
|
|
339
|
+
"minecraft:waxed_oxidized_copper_bulb",
|
|
340
|
+
"minecraft:waxed_oxidized_cut_copper",
|
|
341
|
+
"minecraft:waxed_weathered_chiseled_copper",
|
|
342
|
+
"minecraft:waxed_weathered_copper",
|
|
343
|
+
"minecraft:waxed_weathered_copper_bulb",
|
|
344
|
+
"minecraft:waxed_weathered_cut_copper",
|
|
345
|
+
"minecraft:weathered_chiseled_copper",
|
|
346
|
+
"minecraft:weathered_copper",
|
|
347
|
+
"minecraft:weathered_copper_bulb",
|
|
348
|
+
"minecraft:weathered_cut_copper",
|
|
349
|
+
"minecraft:wet_sponge",
|
|
350
|
+
"minecraft:white_concrete",
|
|
351
|
+
"minecraft:white_concrete_powder",
|
|
352
|
+
"minecraft:white_glazed_terracotta",
|
|
353
|
+
"minecraft:white_terracotta",
|
|
354
|
+
"minecraft:white_wool",
|
|
355
|
+
"minecraft:yellow_concrete",
|
|
356
|
+
"minecraft:yellow_concrete_powder",
|
|
357
|
+
"minecraft:yellow_glazed_terracotta",
|
|
358
|
+
"minecraft:yellow_terracotta",
|
|
359
|
+
"minecraft:yellow_wool",
|
|
360
|
+
]);
|
|
361
|
+
|
|
362
|
+
const TRANSPARENT_BLOCKS = new Set([
|
|
363
|
+
"minecraft:black_stained_glass",
|
|
364
|
+
"minecraft:black_stained_glass_pane",
|
|
365
|
+
"minecraft:blue_stained_glass",
|
|
366
|
+
"minecraft:blue_stained_glass_pane",
|
|
367
|
+
"minecraft:brown_stained_glass",
|
|
368
|
+
"minecraft:brown_stained_glass_pane",
|
|
369
|
+
"minecraft:cyan_stained_glass",
|
|
370
|
+
"minecraft:cyan_stained_glass_pane",
|
|
371
|
+
"minecraft:frosted_ice",
|
|
372
|
+
"minecraft:gray_stained_glass",
|
|
373
|
+
"minecraft:gray_stained_glass_pane",
|
|
374
|
+
"minecraft:green_stained_glass",
|
|
375
|
+
"minecraft:green_stained_glass_pane",
|
|
376
|
+
"minecraft:honey_block",
|
|
377
|
+
"minecraft:ice",
|
|
378
|
+
"minecraft:light_blue_stained_glass",
|
|
379
|
+
"minecraft:light_blue_stained_glass_pane",
|
|
380
|
+
"minecraft:light_gray_stained_glass",
|
|
381
|
+
"minecraft:light_gray_stained_glass_pane",
|
|
382
|
+
"minecraft:lime_stained_glass",
|
|
383
|
+
"minecraft:lime_stained_glass_pane",
|
|
384
|
+
"minecraft:magenta_stained_glass",
|
|
385
|
+
"minecraft:magenta_stained_glass_pane",
|
|
386
|
+
"minecraft:orange_stained_glass",
|
|
387
|
+
"minecraft:orange_stained_glass_pane",
|
|
388
|
+
"minecraft:pink_stained_glass",
|
|
389
|
+
"minecraft:pink_stained_glass_pane",
|
|
390
|
+
"minecraft:purple_stained_glass",
|
|
391
|
+
"minecraft:purple_stained_glass_pane",
|
|
392
|
+
"minecraft:red_stained_glass",
|
|
393
|
+
"minecraft:red_stained_glass_pane",
|
|
394
|
+
"minecraft:slime_block",
|
|
395
|
+
"minecraft:water",
|
|
396
|
+
"minecraft:white_stained_glass",
|
|
397
|
+
"minecraft:white_stained_glass_pane",
|
|
398
|
+
"minecraft:yellow_stained_glass",
|
|
399
|
+
"minecraft:yellow_stained_glass_pane",
|
|
400
|
+
]);
|
|
401
|
+
|
|
402
|
+
const NON_SELF_CULLING = new Set([
|
|
403
|
+
"minecraft:acacia_leaves",
|
|
404
|
+
"minecraft:azalea_leaves",
|
|
405
|
+
"minecraft:birch_leaves",
|
|
406
|
+
"minecraft:cherry_leaves",
|
|
407
|
+
"minecraft:dark_oak_leaves",
|
|
408
|
+
"minecraft:flowering_azalea_leaves",
|
|
409
|
+
"minecraft:jungle_leaves",
|
|
410
|
+
"minecraft:mangrove_leaves",
|
|
411
|
+
"minecraft:oak_leaves",
|
|
412
|
+
"minecraft:spruce_leaves",
|
|
413
|
+
]);
|
|
@@ -1,56 +1,74 @@
|
|
|
1
1
|
var deepslateResources;
|
|
2
2
|
|
|
3
3
|
function upperPowerOfTwo(x) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
x -= 1;
|
|
5
|
+
x |= x >> 1;
|
|
6
|
+
x |= x >> 2;
|
|
7
|
+
x |= x >> 4;
|
|
8
|
+
x |= x >> 8;
|
|
9
|
+
x |= x >> 18;
|
|
10
|
+
x |= x >> 32;
|
|
11
|
+
return x + 1;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// Load Deepslate resources from texture atlas image
|
|
15
15
|
// Taken from Deepslate examples
|
|
16
16
|
function loadDeepslateResources(textureImage) {
|
|
17
|
-
console.log("loading resources...")
|
|
17
|
+
console.log("loading resources...");
|
|
18
18
|
const blockDefinitions = {};
|
|
19
|
-
Object.keys(assets.blockstates).forEach(id => {
|
|
20
|
-
blockDefinitions[
|
|
21
|
-
|
|
19
|
+
Object.keys(assets.blockstates).forEach((id) => {
|
|
20
|
+
blockDefinitions["minecraft:" + id] = deepslate.BlockDefinition.fromJson(
|
|
21
|
+
id,
|
|
22
|
+
assets.blockstates[id],
|
|
23
|
+
);
|
|
24
|
+
});
|
|
22
25
|
|
|
23
26
|
const blockModels = {};
|
|
24
|
-
Object.keys(assets.models).forEach(id => {
|
|
25
|
-
blockModels[
|
|
26
|
-
})
|
|
27
|
-
Object.values(blockModels).forEach(m => m.flatten({ getBlockModel: id => blockModels[id] }));
|
|
27
|
+
Object.keys(assets.models).forEach((id) => {
|
|
28
|
+
blockModels["minecraft:" + id] = deepslate.BlockModel.fromJson(id, assets.models[id]);
|
|
29
|
+
});
|
|
30
|
+
Object.values(blockModels).forEach((m) => m.flatten({ getBlockModel: (id) => blockModels[id] }));
|
|
28
31
|
|
|
29
|
-
const atlasCanvas = document.createElement(
|
|
30
|
-
const atlasSize = upperPowerOfTwo(
|
|
32
|
+
const atlasCanvas = document.createElement("canvas");
|
|
33
|
+
const atlasSize = upperPowerOfTwo(
|
|
34
|
+
textureImage.width >= textureImage.height ? textureImage.width : textureImage.height,
|
|
35
|
+
);
|
|
31
36
|
atlasCanvas.width = textureImage.width;
|
|
32
37
|
atlasCanvas.height = textureImage.height;
|
|
33
38
|
|
|
34
|
-
const atlasCtx = atlasCanvas.getContext(
|
|
39
|
+
const atlasCtx = atlasCanvas.getContext("2d");
|
|
35
40
|
atlasCtx.drawImage(textureImage, 0, 0);
|
|
36
41
|
|
|
37
42
|
const atlasData = atlasCtx.getImageData(0, 0, atlasSize, atlasSize);
|
|
38
43
|
|
|
39
44
|
const idMap = {};
|
|
40
45
|
|
|
41
|
-
Object.keys(assets.textures).forEach(id => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
Object.keys(assets.textures).forEach((id) => {
|
|
47
|
+
const [u, v, du, dv] = assets.textures[id];
|
|
48
|
+
const dv2 = du !== dv && id.startsWith("block/") ? du : dv;
|
|
49
|
+
idMap["minecraft:" + id] = [
|
|
50
|
+
u / atlasSize,
|
|
51
|
+
v / atlasSize,
|
|
52
|
+
(u + du) / atlasSize,
|
|
53
|
+
(v + dv2) / atlasSize,
|
|
54
|
+
];
|
|
55
|
+
});
|
|
46
56
|
|
|
47
57
|
const textureAtlas = new deepslate.TextureAtlas(atlasData, idMap);
|
|
48
58
|
|
|
49
59
|
deepslateResources = {
|
|
50
|
-
getBlockDefinition(id) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
60
|
+
getBlockDefinition(id) {
|
|
61
|
+
return blockDefinitions[id];
|
|
62
|
+
},
|
|
63
|
+
getBlockModel(id) {
|
|
64
|
+
return blockModels[id];
|
|
65
|
+
},
|
|
66
|
+
getTextureUV(id) {
|
|
67
|
+
return textureAtlas.getTextureUV(id);
|
|
68
|
+
},
|
|
69
|
+
getTextureAtlas() {
|
|
70
|
+
return textureAtlas.getTextureAtlas();
|
|
71
|
+
},
|
|
54
72
|
getBlockFlags(id) {
|
|
55
73
|
return {
|
|
56
74
|
opaque: OPAQUE_BLOCKS.has(id.toString()),
|
|
@@ -58,19 +76,27 @@ function loadDeepslateResources(textureImage) {
|
|
|
58
76
|
semi_transparent: TRANSPARENT_BLOCKS.has(id.toString()),
|
|
59
77
|
};
|
|
60
78
|
},
|
|
61
|
-
getBlockProperties(id) {
|
|
62
|
-
|
|
63
|
-
|
|
79
|
+
getBlockProperties(id) {
|
|
80
|
+
return null;
|
|
81
|
+
},
|
|
82
|
+
getDefaultBlockProperties(id) {
|
|
83
|
+
return null;
|
|
84
|
+
},
|
|
85
|
+
};
|
|
64
86
|
|
|
65
87
|
return deepslateResources;
|
|
66
88
|
}
|
|
67
89
|
|
|
68
|
-
function structureFromLitematic(litematic, y_min=0, y_max
|
|
90
|
+
function structureFromLitematic(litematic, y_min = 0, y_max = -1) {
|
|
69
91
|
const bounds = { min: [Infinity, Infinity, Infinity], max: [-Infinity, -Infinity, -Infinity] };
|
|
70
92
|
for (const region of litematic.regions) {
|
|
71
93
|
const origin = region.position || { x: 0, y: 0, z: 0 };
|
|
72
94
|
const sizes = [Math.abs(region.width), Math.abs(region.height), Math.abs(region.depth)];
|
|
73
|
-
const directions = [
|
|
95
|
+
const directions = [
|
|
96
|
+
region.width < 0 ? -1 : 1,
|
|
97
|
+
region.height < 0 ? -1 : 1,
|
|
98
|
+
region.depth < 0 ? -1 : 1,
|
|
99
|
+
];
|
|
74
100
|
const starts = [origin.x, origin.y, origin.z];
|
|
75
101
|
for (let axis = 0; axis < 3; axis++) {
|
|
76
102
|
const end = starts[axis] + (sizes[axis] - 1) * directions[axis];
|
|
@@ -79,14 +105,20 @@ function structureFromLitematic(litematic, y_min=0, y_max=-1) {
|
|
|
79
105
|
}
|
|
80
106
|
}
|
|
81
107
|
|
|
82
|
-
const structure = new deepslate.Structure(
|
|
108
|
+
const structure = new deepslate.Structure(
|
|
109
|
+
bounds.max.map((value, axis) => value - bounds.min[axis] + 1),
|
|
110
|
+
);
|
|
83
111
|
let blockCount = 0;
|
|
84
112
|
console.log("Building blocks from", litematic.regions.length, "regions...");
|
|
85
113
|
for (const region of litematic.regions) {
|
|
86
114
|
const blocks = region.blocks;
|
|
87
115
|
const blockPalette = region.blockPalette;
|
|
88
116
|
const origin = region.position || { x: 0, y: 0, z: 0 };
|
|
89
|
-
const directions = [
|
|
117
|
+
const directions = [
|
|
118
|
+
region.width < 0 ? -1 : 1,
|
|
119
|
+
region.height < 0 ? -1 : 1,
|
|
120
|
+
region.depth < 0 ? -1 : 1,
|
|
121
|
+
];
|
|
90
122
|
const maxY = y_max === -1 ? blocks[0].length : Math.min(y_max, blocks[0].length);
|
|
91
123
|
for (let x = 0; x < blocks.length; x++) {
|
|
92
124
|
for (let y = Math.max(0, y_min); y < maxY; y++) {
|