mcutils-js-api 2.0.34 → 2.0.35
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 +2 -1
- package/dist/index.js +3 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -75,9 +75,10 @@ export declare class McUtilsAPI {
|
|
|
75
75
|
* Fetch a player by UUID or username.
|
|
76
76
|
*
|
|
77
77
|
* @param id the UUID or username of the player (eg: ImFascinated)
|
|
78
|
+
* @param fetchOptifineCape whether to fetch the optifine cape (default: true)
|
|
78
79
|
* @returns the player or the error (if one occurred)
|
|
79
80
|
*/
|
|
80
|
-
fetchPlayer(id: string): Promise<{
|
|
81
|
+
fetchPlayer(id: string, fetchOptifineCape?: boolean): Promise<{
|
|
81
82
|
player?: Player;
|
|
82
83
|
error?: ErrorResponse;
|
|
83
84
|
}>;
|
package/dist/index.js
CHANGED
|
@@ -99,10 +99,11 @@ export class McUtilsAPI {
|
|
|
99
99
|
* Fetch a player by UUID or username.
|
|
100
100
|
*
|
|
101
101
|
* @param id the UUID or username of the player (eg: ImFascinated)
|
|
102
|
+
* @param fetchOptifineCape whether to fetch the optifine cape (default: true)
|
|
102
103
|
* @returns the player or the error (if one occurred)
|
|
103
104
|
*/
|
|
104
|
-
async fetchPlayer(id) {
|
|
105
|
-
const response = await fetch(`${this.endpoint}/players/${id}`);
|
|
105
|
+
async fetchPlayer(id, fetchOptifineCape = true) {
|
|
106
|
+
const response = await fetch(`${this.endpoint}/players/${id}${this.buildParams({ fetchOptifineCape: String(fetchOptifineCape) })}`);
|
|
106
107
|
if (response.ok) {
|
|
107
108
|
return {
|
|
108
109
|
player: (await response.json()),
|