From 68c9ac8a0525f2f0ba57a3bf553f81671e61d39d Mon Sep 17 00:00:00 2001 From: Liam Date: Sun, 21 Apr 2024 23:40:38 +0100 Subject: [PATCH] add server location --- package.json | 2 +- src/types/server/server.ts | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 22d07d0..613c861 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mcutils-library", - "version": "1.3.0", + "version": "1.3.1", "description": "", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/types/server/server.ts b/src/types/server/server.ts index a82dbdd..f6383b3 100644 --- a/src/types/server/server.ts +++ b/src/types/server/server.ts @@ -28,6 +28,11 @@ export type MinecraftServer = { * The players on the server. */ players: Players; + + /** + * The location of the server, or undefined if the location is unknown. + */ + location?: GeoLocation; }; type Motd = { @@ -75,3 +80,30 @@ type PlayerSample = { */ name: string; }; + +type GeoLocation = { + /** + * The country of the location. + */ + country: string; + + /** + * The region of the location. + */ + region: string; + + /** + * The city of the location. + */ + city: string; + + /** + * The latitude of the location. + */ + latitude: number; + + /** + * The longitude of the location. + */ + longitude: number; +}