mcutils-js-api 2.0.13 → 2.0.15
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/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/types/server/server.d.ts +0 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -102,7 +102,7 @@ export declare class McUtilsAPI {
|
|
|
102
102
|
* @param id the UUID or username of the player (eg: ImFascinated)
|
|
103
103
|
* @returns the skin PNG image or the error (if one occurred)
|
|
104
104
|
*/
|
|
105
|
-
|
|
105
|
+
fetchPlayerSkinTexture(id: string): Promise<{
|
|
106
106
|
image?: ArrayBuffer;
|
|
107
107
|
error?: ErrorResponse;
|
|
108
108
|
}>;
|
|
@@ -115,7 +115,7 @@ export declare class McUtilsAPI {
|
|
|
115
115
|
* @param overlays whether to render skin overlay layers (default: true)
|
|
116
116
|
* @returns the skin part PNG image or the error (if one occurred)
|
|
117
117
|
*/
|
|
118
|
-
|
|
118
|
+
fetchPlayerSkin(id: string, part: string, size?: number, overlays?: boolean): Promise<{
|
|
119
119
|
image?: ArrayBuffer;
|
|
120
120
|
error?: ErrorResponse;
|
|
121
121
|
}>;
|
|
@@ -125,7 +125,7 @@ export declare class McUtilsAPI {
|
|
|
125
125
|
* @param id the cape texture id (eg: from player.cape or a texture hash)
|
|
126
126
|
* @returns the cape PNG image or the error (if one occurred)
|
|
127
127
|
*/
|
|
128
|
-
|
|
128
|
+
fetchPlayerCapeTexture(id: string): Promise<{
|
|
129
129
|
image?: ArrayBuffer;
|
|
130
130
|
error?: ErrorResponse;
|
|
131
131
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -149,7 +149,7 @@ export class McUtilsAPI {
|
|
|
149
149
|
* @param id the UUID or username of the player (eg: ImFascinated)
|
|
150
150
|
* @returns the skin PNG image or the error (if one occurred)
|
|
151
151
|
*/
|
|
152
|
-
async
|
|
152
|
+
async fetchPlayerSkinTexture(id) {
|
|
153
153
|
const response = await fetch(`${this.endpoint}/skin/${id}/texture.png`);
|
|
154
154
|
if (response.ok) {
|
|
155
155
|
return { image: await response.arrayBuffer() };
|
|
@@ -167,7 +167,7 @@ export class McUtilsAPI {
|
|
|
167
167
|
* @param overlays whether to render skin overlay layers (default: true)
|
|
168
168
|
* @returns the skin part PNG image or the error (if one occurred)
|
|
169
169
|
*/
|
|
170
|
-
async
|
|
170
|
+
async fetchPlayerSkin(id, part, size = 768, overlays = true) {
|
|
171
171
|
const response = await fetch(`${this.endpoint}/skin/${id}/${part}.png${this.buildParams({ size: String(size), overlays: String(overlays) })}`);
|
|
172
172
|
if (response.ok) {
|
|
173
173
|
return { image: await response.arrayBuffer() };
|
|
@@ -182,7 +182,7 @@ export class McUtilsAPI {
|
|
|
182
182
|
* @param id the cape texture id (eg: from player.cape or a texture hash)
|
|
183
183
|
* @returns the cape PNG image or the error (if one occurred)
|
|
184
184
|
*/
|
|
185
|
-
async
|
|
185
|
+
async fetchPlayerCapeTexture(id) {
|
|
186
186
|
const response = await fetch(`${this.endpoint}/cape/${id}/texture.png`);
|
|
187
187
|
if (response.ok) {
|
|
188
188
|
return { image: await response.arrayBuffer() };
|