This commit is contained in:
parent
2f666a9cfa
commit
9eaf6125b7
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mcutils-library",
|
"name": "mcutils-library",
|
||||||
"version": "1.2.3",
|
"version": "1.2.4",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
|
@ -9,6 +9,6 @@ const endpointStatusEndpoint = API_ENDPOINT + "/mojang/status";
|
|||||||
*
|
*
|
||||||
* @returns the Mojang API status
|
* @returns the Mojang API status
|
||||||
*/
|
*/
|
||||||
export function getMojangEndpointStatus(): Promise<CachedEndpointStatus> {
|
export async function getMojangEndpointStatus(): Promise<CachedEndpointStatus> {
|
||||||
return WebRequest.get(endpointStatusEndpoint);
|
return WebRequest.get<CachedEndpointStatus>(endpointStatusEndpoint);
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ const playerSkinPartEndpoint = API_ENDPOINT + "/player/{part}/{id}";
|
|||||||
* @param id the id of the player
|
* @param id the id of the player
|
||||||
* @returns the player information, or null if the player does not exist
|
* @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));
|
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
|
* @param id the id of the player
|
||||||
* @returns the player's UUID, or null if the player does not exist
|
* @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));
|
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
|
* @param id the id of the player
|
||||||
* @returns the player's skin part, or null if the player does not exist
|
* @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));
|
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
|
* @param port the port of the server
|
||||||
* @returns the server information, or null if the server does not exist
|
* @returns the server information, or null if the server does not exist
|
||||||
*/
|
*/
|
||||||
export function getServer(
|
export async function getServer(
|
||||||
platform: ServerPlatform,
|
platform: ServerPlatform,
|
||||||
hostname: string,
|
hostname: string,
|
||||||
port?: 25565
|
port?: 25565
|
||||||
@ -33,7 +33,7 @@ export function getServer(
|
|||||||
* @param port the port of the server
|
* @param port the port of the server
|
||||||
* @returns the server icon, or null if the server does not have an icon
|
* @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;
|
const ip = port ? `${hostname}:${port}` : hostname;
|
||||||
return WebRequest.get<Buffer>(serverIconEndpoint.replace("{hostname}", ip));
|
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
|
* @param hostname the hostname of the server
|
||||||
* @returns true if the server is blocked, false otherwise
|
* @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));
|
return WebRequest.get<BlockedStatus>(blockedServerEndpoint.replace("{hostname}", hostname));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user