forked from PrismarineJS/node-minecraft-assets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
44 lines (42 loc) · 1.84 KB
/
index.js
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
const mcDataToNode = require('./lib/loader')
const cache = {} // prevent reindexing when requiring multiple time the same version
module.exports = function (mcVersion) {
if (cache[mcVersion]) { return cache[mcVersion] }
const mcData = data[mcVersion]
if (mcData == null) { return null }
const nmcData = mcDataToNode(mcData, mcVersion)
cache[mcVersion] = nmcData
return nmcData
}
const data = {
'1.8.8': {
blocksTextures: require('./minecraft-assets/data/1.8.8/blocks_textures'),
itemsTextures: require('./minecraft-assets/data/1.8.8/items_textures'),
textureContent: require('./minecraft-assets/data/1.8.8/texture_content')
},
'1.9': {
blocksTextures: require('./minecraft-assets/data/1.9/blocks_textures'),
itemsTextures: require('./minecraft-assets/data/1.9/items_textures'),
textureContent: require('./minecraft-assets/data/1.9/texture_content')
},
'1.10': {
blocksTextures: require('./minecraft-assets/data/1.10/blocks_textures'),
itemsTextures: require('./minecraft-assets/data/1.10/items_textures'),
textureContent: require('./minecraft-assets/data/1.10/texture_content')
},
'1.11.2': {
blocksTextures: require('./minecraft-assets/data/1.11.2/blocks_textures'),
itemsTextures: require('./minecraft-assets/data/1.11.2/items_textures'),
textureContent: require('./minecraft-assets/data/1.11.2/texture_content')
},
'1.12': {
blocksTextures: require('./minecraft-assets/data/1.12/blocks_textures'),
itemsTextures: require('./minecraft-assets/data/1.12/items_textures'),
textureContent: require('./minecraft-assets/data/1.12/texture_content')
},
'1.13': {
blocksTextures: require('./minecraft-assets/data/1.13/blocks_textures'),
itemsTextures: require('./minecraft-assets/data/1.13/items_textures'),
textureContent: require('./minecraft-assets/data/1.13/texture_content')
}
}