bedrock-portal 0.2.1 → 0.2.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +4 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bedrock-portal",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Creates a joinable session in Minecraft Bedrock Edition that can route players to their a specified host",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -24,11 +24,11 @@ module.exports = class BedrockPortal extends EventEmitter {
24
24
  this.options = {
25
25
  port: 19132,
26
26
  disableAltCheck: false,
27
- joinability: Joinability.friends_of_friends,
27
+ joinability: 'friends_of_friends',
28
28
  ...options,
29
29
  world: {
30
30
  hostName: `Bedrock Portal v${pkgVersion}`,
31
- worldName: 'By LucienHH',
31
+ name: 'By LucienHH',
32
32
  version: pkgVersion,
33
33
  memberCount: 0,
34
34
  maxMemberCount: 10,
@@ -50,7 +50,7 @@ module.exports = class BedrockPortal extends EventEmitter {
50
50
  validateOptions(options) {
51
51
  if (!options.ip) throw new Error('No IP provided');
52
52
  if (!options.port) throw new Error('No port provided');
53
- if (options.joinability && !Object.keys(Joinability).includes(options.joinability)) throw new Error('Invalid joinability - Expected one of ' + Object.keys(Joinability).join(', '));
53
+ if (!Object.keys(Joinability).includes(options.joinability)) throw new Error('Invalid joinability - Expected one of ' + Object.keys(Joinability).join(', '));
54
54
  }
55
55
 
56
56
  async start() {
@@ -243,7 +243,7 @@ module.exports = class BedrockPortal extends EventEmitter {
243
243
  }
244
244
 
245
245
  #createSessionBody(connectionId) {
246
- const joinability = Joinability[this.options.joinability ?? 'friends_of_friends'];
246
+ const joinability = Joinability[this.options.joinability];
247
247
  return {
248
248
  properties: {
249
249
  system: {