forked from unimatrix/web
Select shared-pack block item models from recorded origins
This commit is contained in:
parent
4e4ebbdbb3
commit
0ef7cf3bf3
1 changed files with 54 additions and 1 deletions
|
|
@ -7,6 +7,8 @@ import {profiles,textureEntries,zip} from './build-planet-texture-packs.mjs';
|
|||
|
||||
const texturePrefix='assets/minecraft/textures/';
|
||||
const packPrefix='assets/dunerealms/textures/planets/';
|
||||
const cubeItems=['stone','sand','red_sand','cobblestone','dirt','oak_planks'];
|
||||
const json=value=>Buffer.from(JSON.stringify(value));
|
||||
const hash=(algorithm,bytes)=>createHash(algorithm).update(bytes).digest('hex');
|
||||
|
||||
export function centralPackEntries(base){
|
||||
|
|
@ -23,6 +25,14 @@ export function centralPackEntries(base){
|
|||
if(merged.has(target)&&!merged.get(target).equals(bytes))throw Error('Conflicting pack entry: '+target);
|
||||
merged.set(target,bytes);
|
||||
}
|
||||
for(const material of cubeItems){
|
||||
const id=planet+'/'+material;
|
||||
if(!merged.has(packPrefix+planet+'/block/'+material+'.png'))throw Error('Missing planet item texture: '+id);
|
||||
merged.set('assets/dunerealms/items/planets/'+id+'.json',json({model:{type:'minecraft:model',model:'dunerealms:item/planets/'+id}}));
|
||||
merged.set('assets/dunerealms/models/item/planets/'+id+'.json',json({
|
||||
parent:'minecraft:block/cube_all',textures:{all:'dunerealms:planets/'+planet+'/block/'+material}
|
||||
}));
|
||||
}
|
||||
}
|
||||
return merged;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff