Skip to content

Commit

Permalink
fix: fix texture in ItemsRenderer and WorldBlockProvider parsing for …
Browse files Browse the repository at this point in the history
…some old versions
  • Loading branch information
zardoy committed Jul 25, 2024
1 parent 6267ed0 commit df54064
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/consumer/itemsRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class ItemsRenderer {
resolveTexture(texture: string) {
const atlasParser = texture.startsWith('block/') ? this.blocksAtlasParser! : this.itemsAtlasParser
const type = texture.startsWith('block/') ? 'blocks' : 'items'
const textureInfo = atlasParser.getTextureInfo(texture.replace('block/', '').replace('item/', ''), this.version)!
const textureInfo = atlasParser.getTextureInfo(texture.replace('block/', '').replace('blocks/', '').replace('item/', ''), this.version)!
const atlas = atlasParser.atlas[textureInfo.imageType]!
return {
slice: [
Expand Down
2 changes: 1 addition & 1 deletion src/consumer/worldBlockProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default function worldBlockProvider(blockstatesModels: any, blocksAtlas:
})
},
getTextureInfo(textureName: string) {
return atlasParser.getTextureInfo(textureName.replace('block/', ''), version)
return atlasParser.getTextureInfo(textureName.replace('block/', '').replace('blocks/', ''), version)
}
}
}
Expand Down

0 comments on commit df54064

Please sign in to comment.