Fix atlas and palette scripts

This commit is contained in:
Lucas Dower 2022-03-22 22:32:05 +00:00
parent 0fa6be0a7b
commit 3f8cc524ce
2 changed files with 3 additions and 3 deletions

View File

@ -343,14 +343,14 @@ async function buildAtlas() {
log(LogStyle.Info, 'Exporting...');
const atlasDir = path.join(__dirname, `../resources/atlases/${atlasName}.png`);
const atlasDir = path.join(__dirname, `../../resources/atlases/${atlasName}.png`);
outputImage.save(atlasDir);
log(LogStyle.Success, `${atlasName}.png exported to /resources/atlases/`);
const outputJSON = {
atlasSize: atlasSize,
blocks: allModels,
};
fs.writeFileSync(path.join(__dirname, `../resources/atlases/${atlasName}.atlas`), JSON.stringify(outputJSON, null, 4));
fs.writeFileSync(path.join(__dirname, `../../resources/atlases/${atlasName}.atlas`), JSON.stringify(outputJSON, null, 4));
log(LogStyle.Success, `${atlasName}.atlas exported to /resources/atlases/\n`);
/* eslint-disable */

View File

@ -7,7 +7,7 @@ import prompt from 'prompt';
void async function main() {
log(LogStyle.Info, 'Creating a new palette...');
const paletteBlocksDir = path.join(__dirname, './new-palette-blocks.txt');
const paletteBlocksDir = path.join(__dirname, '../../tools/new-palette-blocks.txt');
if (!fs.existsSync(paletteBlocksDir)) {
log(LogStyle.Failure, 'Could not find /tools/new-palette-blocks.txt');
return;