Skip to content

Commit

Permalink
further reduce the size of matchers.json
Browse files Browse the repository at this point in the history
  • Loading branch information
mat-1 committed Feb 19, 2022
1 parent 3ec8de7 commit 53b8ec6
Show file tree
Hide file tree
Showing 2,004 changed files with 16 additions and 13 deletions.
10 changes: 6 additions & 4 deletions build/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,20 +127,22 @@ function getTextures(options) {
}
function getTextureDir(options) {
const textures = getTextures(options) ?? {};
const textureDir = textures.texture ?? textures.layer0 ?? textures.fishing_rod ?? textures.leather_boots_overlay ?? textures.leather_chestplate_overlay ?? textures.leather_helmet_overlay ?? textures.leather_leggings_overlay ?? textures.leather_layer_1 ?? textures.leather_layer_2;
if (!textureDir && options.pack !== "vanilla") {
const shortTextureDir = textures.texture ?? textures.layer0 ?? textures.fishing_rod ?? textures.leather_boots_overlay ?? textures.leather_chestplate_overlay ?? textures.leather_helmet_overlay ?? textures.leather_leggings_overlay ?? textures.leather_layer_1 ?? textures.leather_layer_2;
if (!shortTextureDir && options.pack !== "vanilla") {
return getTextureDir({
...options,
pack: "vanilla"
});
}
if (!textureDir)
if (!shortTextureDir)
if (options.noNullTexture)
return null;
else
return "renders/vanilla/error.png";
else
else {
const textureDir = `t/${options.pack}/${shortTextureDir}.png`;
return textureDir.replace(/\\/g, "/");
}
}
function getTextureUrl(options) {
const textureDir = getTextureDir(options);
Expand Down
2 changes: 1 addition & 1 deletion build/matchers.json

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions generator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,13 @@ async function addPack(packName: string) {
const newTextures = matcherTextures.t
for (let [textureName, textureDirectory] of Object.entries(matcherTextures.t)) {
const thisItemIndex = itemIndex ++
const newDirectory = path.join(texturesDir, `${integerToId(thisItemIndex)}.png`)
try {
await fs.copyFile(textureDirectory, newDirectory)
await fs.copyFile(textureDirectory, path.join(texturesDir, `${integerToId(thisItemIndex)}.png`))
} catch (e) {
// console.warn('Missing texture:', textureDirectory, matcherTextures)
delete newTextures[textureName]
}
newTextures[textureName] = newDirectory
newTextures[textureName] = integerToId(thisItemIndex)
}

let newItems = matcherTextures.m.i
Expand Down
Binary file modified packs/ectoplasm/mcpatcher/cit/bows/ender_bow_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packs/ectoplasm/optifine/cit/bows/ender_bow_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packs/furfsky/mcpatcher/cit/gui/general/empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified packs/furfsky/optifine/cit/gui/general/empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 53b8ec6

Please sign in to comment.