fix methods
All checks were successful
Publish Package / build (push) Successful in 20s

This commit is contained in:
Lee 2024-04-19 18:39:25 +01:00
parent 2f666a9cfa
commit 9eaf6125b7
4 changed files with 9 additions and 9 deletions

@ -1,6 +1,6 @@
{
"name": "mcutils-library",
"version": "1.2.3",
"version": "1.2.4",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",

@ -9,6 +9,6 @@ const endpointStatusEndpoint = API_ENDPOINT + "/mojang/status";
*
* @returns the Mojang API status
*/
export function getMojangEndpointStatus(): Promise<CachedEndpointStatus> {
return WebRequest.get(endpointStatusEndpoint);
export async function getMojangEndpointStatus(): Promise<CachedEndpointStatus> {
return WebRequest.get<CachedEndpointStatus>(endpointStatusEndpoint);
}

@ -11,7 +11,7 @@ const playerSkinPartEndpoint = API_ENDPOINT + "/player/{part}/{id}";
* @param id the id of the player
* @returns the player information, or null if the player does not exist
*/
export function getPlayer(id: string): Promise<CachedPlayer> {
export async function getPlayer(id: string): Promise<CachedPlayer> {
return WebRequest.get<CachedPlayer>(playerEndpoint.replace("{id}", id));
}
@ -21,7 +21,7 @@ export function getPlayer(id: string): Promise<CachedPlayer> {
* @param id the id of the player
* @returns the player's UUID, or null if the player does not exist
*/
export function getPlayerUuid(id: string): Promise<CachedUsernameToUuid> {
export async function getPlayerUuid(id: string): Promise<CachedUsernameToUuid> {
return WebRequest.get<CachedUsernameToUuid>(playerUsernameToUuidEndpoint.replace("{id}", id));
}
@ -32,6 +32,6 @@ export function getPlayerUuid(id: string): Promise<CachedUsernameToUuid> {
* @param id the id of the player
* @returns the player's skin part, or null if the player does not exist
*/
export function getPlayerSkinPart(part: string, id: string): Promise<Buffer> {
export async function getPlayerSkinPart(part: string, id: string): Promise<Buffer> {
return WebRequest.get<Buffer>(playerSkinPartEndpoint.replace("{part}", part).replace("{id}", id));
}

@ -15,7 +15,7 @@ const blockedServerEndpoint = API_ENDPOINT + "/server/blocked/{hostname}";
* @param port the port of the server
* @returns the server information, or null if the server does not exist
*/
export function getServer(
export async function getServer(
platform: ServerPlatform,
hostname: string,
port?: 25565
@ -33,7 +33,7 @@ export function getServer(
* @param port the port of the server
* @returns the server icon, or null if the server does not have an icon
*/
export function getServerIcon(hostname: string, port?: 25565): Promise<Buffer> {
export async function getServerIcon(hostname: string, port?: 25565): Promise<Buffer> {
const ip = port ? `${hostname}:${port}` : hostname;
return WebRequest.get<Buffer>(serverIconEndpoint.replace("{hostname}", ip));
}
@ -44,6 +44,6 @@ export function getServerIcon(hostname: string, port?: 25565): Promise<Buffer> {
* @param hostname the hostname of the server
* @returns true if the server is blocked, false otherwise
*/
export function getBlockedStatus(hostname: string): Promise<BlockedStatus> {
export async function getBlockedStatus(hostname: string): Promise<BlockedStatus> {
return WebRequest.get<BlockedStatus>(blockedServerEndpoint.replace("{hostname}", hostname));
}