baltica 0.1.13 → 0.1.15

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/README.md CHANGED
@@ -30,6 +30,8 @@ Complete rewrite, from the ground up! Here's what makes it awesome:
30
30
 
31
31
  `0.1.8` → Minecraft Bedrock `1.21.100` & `1.21.101`
32
32
 
33
+ `0.1.13` → Minecraft Bedrock `1.21.113`
34
+
33
35
 
34
36
  *Note: We dropped multi-version support because honestly, it was more trouble than it was worth. One version, done right.*
35
37
 
@@ -62,6 +62,7 @@ class Client extends shared_1.Emitter {
62
62
  this.send(request);
63
63
  return new Promise((resolve, rejevt) => {
64
64
  this.once("SetLocalPlayerAsInitializedPacket", (packet) => {
65
+ this.emit("connect");
65
66
  resolve([this.startGameData]);
66
67
  });
67
68
  });
@@ -116,11 +116,11 @@ class ClientData {
116
116
  ...customPayload,
117
117
  ServerAddress: `${this.client.options.address}:${this.client.options.port}`,
118
118
  ClientRandomId: Date.now(),
119
- DeviceId: ClientData.nextUUID(this.client.profile?.name),
120
- PlayFabId: ClientData.nextUUID(this.client.profile?.name)
119
+ DeviceId: ClientData.nextUUID(this.client.profile.name),
120
+ PlayFabId: ClientData.nextUUID(this.client.profile.name)
121
121
  .replace(/-/g, "")
122
122
  .slice(0, 16),
123
- SelfSignedId: ClientData.nextUUID(this.client.profile?.name),
123
+ SelfSignedId: ClientData.nextUUID(this.client.profile.name),
124
124
  };
125
125
  const josePrivateKey = await jose.importPKCS8(privateKey.export({ format: "pem", type: "pkcs8" }), algorithm);
126
126
  return new jose.SignJWT(payload)
@@ -1,4 +1,3 @@
1
- import type { Advertisement } from "@sanctumterra/raknet";
2
1
  import type * as Protocol from "@serenityjs/protocol";
3
2
  import type { PacketNames } from "../../shared/types";
4
3
  type ClientEvents = {
@@ -7,7 +6,7 @@ type ClientEvents = {
7
6
  session: [];
8
7
  } & {
9
8
  packet: [packet: InstanceType<(typeof Protocol)[PacketNames]>];
10
- connect: [packet: Advertisement];
9
+ connect: [];
11
10
  } & {
12
11
  [K in `${number}`]: [buffer: Buffer];
13
12
  };
@@ -65,11 +65,17 @@ const createDefaultPayload = (client) => {
65
65
  PersonaPieces: skin.skinData.PersonaPieces,
66
66
  PersonaSkin: skin.skinData.PersonaSkin,
67
67
  PieceTintColors: skin.skinData.PieceTintColors,
68
- PlatformOfflineId: client_data_1.ClientData.nextUUID(username).replace(/-/g, ""),
69
- PlatformOnlineId: client_data_1.ClientData.OnlineId(),
68
+ // IF set while in offline mode BDS will act its a new player each time.
69
+ PlatformOfflineId: client.options.offline === true
70
+ ? ""
71
+ : client_data_1.ClientData.nextUUID(username).replace(/-/g, ""),
72
+ PlatformOnlineId: client.options.offline === true ? "" : client_data_1.ClientData.OnlineId(),
70
73
  PlatformType: client.options.loginOptions.platformType,
71
74
  // PlatformUserId: "",
72
- PlayFabId: client_data_1.ClientData.nextUUID(username).replace(/-/g, "").slice(0, 16),
75
+ PlayFabId: client_data_1.ClientData.nextUUID(username)
76
+ .replace(/-/g, "")
77
+ .slice(0, 16)
78
+ .toLowerCase(),
73
79
  PremiumSkin: skin.skinData.PremiumSkin,
74
80
  SelfSignedId: client_data_1.ClientData.nextUUID(username),
75
81
  ServerAddress: `${client.options.address}:${client.options.port}`,
@@ -7,7 +7,8 @@ export declare enum ProtocolList {
7
7
  "1.21.90" = 818,
8
8
  "1.21.93" = 819,
9
9
  "1.21.100" = 827,
10
- "1.21.113" = 844
10
+ "1.21.113" = 844,
11
+ "1.21.120" = 859
11
12
  }
12
13
  export type PacketNames = {
13
14
  [K in keyof typeof Protocol]: K extends `${string}Packet` ? K extends "Packet" | "DataPacket" ? never : K : never;
@@ -15,7 +16,7 @@ export type PacketNames = {
15
16
  /**
16
17
  * We do not have multi protocol as of now (Not yet planned either).
17
18
  */
18
- export type CurrentVersion = "1.21.113";
19
+ export type CurrentVersion = "1.21.120";
19
20
  export declare const CurrentVersionConst: CurrentVersion;
20
21
  /**
21
22
  * Checks if client version is higher than the specified version
@@ -13,8 +13,9 @@ var ProtocolList;
13
13
  ProtocolList[ProtocolList["1.21.93"] = 819] = "1.21.93";
14
14
  ProtocolList[ProtocolList["1.21.100"] = 827] = "1.21.100";
15
15
  ProtocolList[ProtocolList["1.21.113"] = 844] = "1.21.113";
16
+ ProtocolList[ProtocolList["1.21.120"] = 859] = "1.21.120";
16
17
  })(ProtocolList || (exports.ProtocolList = ProtocolList = {}));
17
- exports.CurrentVersionConst = "1.21.113";
18
+ exports.CurrentVersionConst = "1.21.120";
18
19
  /**
19
20
  * Checks if client version is higher than the specified version
20
21
  * @param version The client version to check
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "baltica",
3
3
  "description": "Library for Minecraft Bedrock Edition community developers.",
4
- "version": "0.1.13",
5
- "minecraft": "1.21.113",
4
+ "version": "0.1.15",
5
+ "minecraft": "1.21.120",
6
6
  "main": "dist/index.js",
7
7
  "license": "MIT",
8
8
  "types": "dist/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "dependencies": {
24
24
  "@sanctumterra/raknet": "^1.4.0",
25
25
  "@serenityjs/binarystream": "^3.0.10",
26
- "@serenityjs/protocol": "^0.8.7",
26
+ "@serenityjs/protocol": "^0.8.14",
27
27
  "jose": "^5.10.0",
28
28
  "prismarine-auth": "^2.7.0",
29
29
  "uuid-1345": "^1.0.2"