diff --git a/package.json b/package.json index 3700f25..95dd6b8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sanctumterra/client", - "version": "2.1.3", + "version": "2.1.5", "minecraft": "1.21.30", "description": "We'll be singing Baraye.", "main": "./dist/index.js", diff --git a/src/client/Auth.ts b/src/client/Auth.ts index 07b689f..ecf6c4a 100644 --- a/src/client/Auth.ts +++ b/src/client/Auth.ts @@ -2,7 +2,7 @@ import { Authflow, Titles } from "prismarine-auth"; import { v3 } from "uuid-1345"; import { Logger } from "../vendor/Logger"; import type { Connection } from "../Connection"; -import { measureExecutionTimeForFunction } from "src/vendor/debug-tools"; +import { measureExecutionTimeForFunction } from "../vendor/debug-tools"; interface Profile { name: string; diff --git a/src/client/ClientData.ts b/src/client/ClientData.ts index 2db31de..db54f34 100644 --- a/src/client/ClientData.ts +++ b/src/client/ClientData.ts @@ -164,7 +164,7 @@ class ClientData { DefaultInputMode: 1, DeviceId: this.nextUUID(), DeviceModel: "Helicopter", - DeviceOS: 7, + DeviceOS: this.client.options.deviceOS, GameVersion: this.client.options.version, GuiScale: 0, IsEditorMode: false, diff --git a/src/client/ClientOptions.ts b/src/client/ClientOptions.ts index 104d0db..95b177f 100644 --- a/src/client/ClientOptions.ts +++ b/src/client/ClientOptions.ts @@ -5,6 +5,24 @@ enum ProtocolList { "1.21.30" = 729, } +enum DeviceOS { + Undefined = 0, + Android = 1, + IOS = 2, + OSX = 3, + FireOS = 4, + GearVR = 5, + Hololens = 6, + Win10 = 7, + Win32 = 8, + Dedicated = 9, + TVOS = 10, + Orbis = 11, + NintendoSwitch = 12, + Xbox = 13, + WindowsPhone = 14, +} + type RealmOptions = { realmInvite: string; }; @@ -20,6 +38,7 @@ type ClientOptions = { tokensFolder: string; viewDistance: number; loadPlugins: boolean; + deviceOS: DeviceOS; }; const defaultOptions: ClientOptions = { @@ -33,6 +52,13 @@ const defaultOptions: ClientOptions = { tokensFolder: `${process.cwd()}/tokens`, viewDistance: 10, loadPlugins: false, + deviceOS: DeviceOS.Win10, }; -export { type ClientOptions, type RealmOptions, defaultOptions, ProtocolList }; +export { + type ClientOptions, + type RealmOptions, + defaultOptions, + ProtocolList, + DeviceOS, +}; diff --git a/src/index.ts b/src/index.ts index 33b19e4..270e05e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,11 @@ import { Client } from "./Client"; import { Logger } from "./vendor/Logger"; import { Connection } from "./Connection"; +import { DeviceOS } from "./client/ClientOptions"; declare global { var shieldID: number; } -export { Client, Logger, Connection }; +export * from "./vendor/debug-tools"; +export { Client, Logger, Connection, DeviceOS }; diff --git a/src/tools/offline.ts b/src/tools/offline.ts index 83a7ab4..295ce6f 100644 --- a/src/tools/offline.ts +++ b/src/tools/offline.ts @@ -3,7 +3,7 @@ import { type TextPacket, type UpdateBlockPacket, } from "@serenityjs/protocol"; -import { Client, Logger } from "../index"; +import { Client, DeviceOS, Logger } from "../index"; const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); @@ -15,6 +15,7 @@ const client = new Client({ offline: true, loadPlugins: false, debug: false, + deviceOS: DeviceOS.Android, }); client.raknet.socket.on("error", (error) => Logger.error(error));