Skip to content

Commit

Permalink
Fix issues with missing data by putting the generator output in the p…
Browse files Browse the repository at this point in the history
…ublic directory.

Also fix "NaN%" when there is no block data.
  • Loading branch information
AaronAsAChimp committed Oct 26, 2024
1 parent 2d73620 commit 361b6fc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion generator/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ bounds.add(magenta);
const EXIT_CODE_NO_JAR = 1;

const dirPath = `./jars/${ MC_VERSION }/assets/minecraft/textures/block/`;
const extractPath = `./web/data/${ MC_VERSION }/`;
const extractPath = `./web/public/data/${ MC_VERSION }/`;
const extractedTexturesPath = path.join(extractPath, 'textures');
const json = [];
const labels = [
Expand Down
2 changes: 1 addition & 1 deletion web/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
data/**/*
public/data/**/*

# build output
dist/
Expand Down
4 changes: 4 additions & 0 deletions web/src/components/page-data/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ export function Data() {
}

function computePercent(queueLength, blocksLength) {
if (!blocksLength) {
return 0;
}

return Math.floor(((blocksLength - queueLength) / blocksLength) * 100);
}

Expand Down

0 comments on commit 361b6fc

Please sign in to comment.