mc-assets 0.2.25 → 0.2.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/itemsRenderer.js
CHANGED
|
@@ -16,7 +16,7 @@ export class ItemsRenderer {
|
|
|
16
16
|
this.assetsParser = new AssetsParser(version, this.blockStatesStore, this.modelsStore);
|
|
17
17
|
}
|
|
18
18
|
resolveTexture(texture) {
|
|
19
|
-
const type = texture.includes('items/') ? 'items' : texture.
|
|
19
|
+
const type = texture.includes('items/') ? 'items' : (texture.includes('block/') || texture.includes('blocks/')) ? 'blocks' : 'items';
|
|
20
20
|
const atlasParser = type === 'blocks' ? this.blocksAtlasParser : this.itemsAtlasParser;
|
|
21
21
|
const textureInfo = atlasParser.getTextureInfo(texture.replace('block/', '').replace('blocks/', '').replace('item/', '').replace('items/', ''), this.version);
|
|
22
22
|
const atlas = atlasParser.atlas[textureInfo.imageType];
|
|
@@ -64,13 +64,13 @@ export class ItemsRenderer {
|
|
|
64
64
|
}
|
|
65
65
|
else {
|
|
66
66
|
model = this.modelsStore.get(this.version, `item/${itemName}`);
|
|
67
|
-
if (!model || model.parent?.
|
|
67
|
+
if (!model || model.parent?.includes('block/') || this.modelsStore.get(this.version, `block/${itemName}`)) {
|
|
68
68
|
return this.tryGetFullBlock(itemName, properties);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
if (!model)
|
|
72
72
|
return;
|
|
73
|
-
const texture = itemName.
|
|
73
|
+
const texture = itemName.includes('block/') ?
|
|
74
74
|
// first defined block texture
|
|
75
75
|
Object.values(model.textures ?? {})[0] :
|
|
76
76
|
model.textures?.layer0; // classic item texture
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
import chestNormal from '../other-textures/latest/entity/chest/christmas.png';
|
|
3
|
+
import chestDoubleLeft from '../other-textures/latest/entity/chest/christmas_left.png';
|
|
4
|
+
import chestDoubleRight from '../other-textures/latest/entity/chest/christmas_right.png';
|
|
5
|
+
export default {
|
|
6
|
+
'entity/chest/normal': chestNormal,
|
|
7
|
+
'entity/chest/normal_left': chestDoubleLeft,
|
|
8
|
+
'entity/chest/normal_right': chestDoubleRight,
|
|
9
|
+
};
|