mc-assets 0.2.40 → 0.2.41
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/assetsParser.js +2 -2
- package/dist/atlasParser.d.ts +1 -10
- package/dist/blockStatesModels.json +74 -0
- package/dist/blocksAtlasLatest.png +0 -0
- package/dist/blocksAtlases.json +1486 -1479
- package/dist/versionedStore.d.ts +1 -1
- package/dist/versionedStore.js +6 -5
- package/dist/worldBlockProvider.d.ts +7 -16
- package/package.json +1 -1
package/dist/versionedStore.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare class VersionedStore<T = string> {
|
|
|
11
11
|
get versionsSorted(): string[];
|
|
12
12
|
/** The order is important: from newest to oldest */
|
|
13
13
|
push(version: string, key: string, data: T): void;
|
|
14
|
-
get(version: string, key: string, inclusive?: boolean):
|
|
14
|
+
get(version: string, key: string, inclusive?: boolean): any;
|
|
15
15
|
semverToNumber(version: string): number;
|
|
16
16
|
loadData(data: typeof this.data): void;
|
|
17
17
|
}
|
package/dist/versionedStore.js
CHANGED
|
@@ -55,16 +55,17 @@ export class VersionedStore {
|
|
|
55
55
|
break;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
+
let result;
|
|
58
59
|
if (this.strictVersioned) {
|
|
59
|
-
|
|
60
|
+
result = this.data[firstNextVersion]?.[key];
|
|
60
61
|
}
|
|
61
62
|
else {
|
|
62
63
|
if (this.data[firstNextVersion]?.[key])
|
|
63
|
-
|
|
64
|
-
if (this.data.latest[key])
|
|
65
|
-
|
|
64
|
+
result = this.data[firstNextVersion][key];
|
|
65
|
+
else if (this.data.latest[key])
|
|
66
|
+
result = this.data.latest[key];
|
|
66
67
|
}
|
|
67
|
-
return;
|
|
68
|
+
return result && typeof result === 'object' ? structuredClone(result) : result;
|
|
68
69
|
}
|
|
69
70
|
semverToNumber(version) {
|
|
70
71
|
const [x, y = '0', z = '0'] = version.split('.');
|
|
@@ -6,11 +6,11 @@ export default function worldBlockProvider(blockstatesModels: any, blocksAtlas:
|
|
|
6
6
|
faces: {
|
|
7
7
|
[k: string]: {
|
|
8
8
|
texture: {
|
|
9
|
-
u:
|
|
10
|
-
v:
|
|
9
|
+
u: any;
|
|
10
|
+
v: any;
|
|
11
11
|
su: number;
|
|
12
12
|
sv: number;
|
|
13
|
-
tileIndex:
|
|
13
|
+
tileIndex: any;
|
|
14
14
|
debugName: string;
|
|
15
15
|
};
|
|
16
16
|
uv?: number[];
|
|
@@ -46,11 +46,11 @@ export default function worldBlockProvider(blockstatesModels: any, blocksAtlas:
|
|
|
46
46
|
faces: {
|
|
47
47
|
[k: string]: {
|
|
48
48
|
texture: {
|
|
49
|
-
u:
|
|
50
|
-
v:
|
|
49
|
+
u: any;
|
|
50
|
+
v: any;
|
|
51
51
|
su: number;
|
|
52
52
|
sv: number;
|
|
53
|
-
tileIndex:
|
|
53
|
+
tileIndex: any;
|
|
54
54
|
debugName: string;
|
|
55
55
|
};
|
|
56
56
|
uv?: number[];
|
|
@@ -69,15 +69,6 @@ export default function worldBlockProvider(blockstatesModels: any, blocksAtlas:
|
|
|
69
69
|
};
|
|
70
70
|
}[];
|
|
71
71
|
} & Omit<T, "textures" | "elements">;
|
|
72
|
-
getTextureInfo: (textureName: string) =>
|
|
73
|
-
su: number;
|
|
74
|
-
sv: number;
|
|
75
|
-
getLoadedImage: () => Promise<HTMLImageElement>;
|
|
76
|
-
u: number;
|
|
77
|
-
v: number;
|
|
78
|
-
tileIndex: number;
|
|
79
|
-
imageType: "latest" | "legacy";
|
|
80
|
-
version: string;
|
|
81
|
-
} | undefined;
|
|
72
|
+
getTextureInfo: (textureName: string) => any;
|
|
82
73
|
};
|
|
83
74
|
export type WorldBlockProvider = ReturnType<typeof worldBlockProvider>;
|