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.
- package/package.json +1 -1
- package/src/index.js +4 -4
package/package.json
CHANGED
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:
|
|
27
|
+
joinability: 'friends_of_friends',
|
|
28
28
|
...options,
|
|
29
29
|
world: {
|
|
30
30
|
hostName: `Bedrock Portal v${pkgVersion}`,
|
|
31
|
-
|
|
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 (
|
|
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
|
|
246
|
+
const joinability = Joinability[this.options.joinability];
|
|
247
247
|
return {
|
|
248
248
|
properties: {
|
|
249
249
|
system: {
|