Select shared-pack block item models from recorded origins

This commit is contained in:
unimatrixgit 2026-11-28 01:34:08 +01:00
commit 0ef7cf3bf3

View file

@ -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;
}