Skip to content

Commit 357ab35

Browse files
committed
Add config.json
1 parent 093afb2 commit 357ab35

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

config.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"defaultHost": "95.111.249.143:10000",
3+
"defaultProxy": ""
4+
}

index.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
/* global THREE, prompt */
22
const net = require('net')
3+
const config = require('./config.json')
34

45
// Workaround for process.versions.node not existing in the browser
56
process.versions.node = '14.0.0'
67

78
const mineflayer = require('mineflayer')
89
const { WorldView, Viewer } = require('prismarine-viewer/viewer')
9-
const Vec3 = require('vec3').Vec3
10+
const { Vec3 } = require('vec3').Vec3
1011
global.THREE = require('three')
1112
const Chat = require('./lib/chat')
13+
1214
let status = 'Waiting for user'
1315

1416
const maxPitch = 0.5 * Math.PI
@@ -32,8 +34,8 @@ async function statusRunner () {
3234
async function main () {
3335
statusRunner()
3436
const viewDistance = 6
35-
const hostprompt = prompt('Host:port', '95.111.249.143:10000')
36-
const proxyprompt = prompt('Proxy:port (blank for default)', '')
37+
const hostprompt = prompt('Host:port', config.defaultHost)
38+
const proxyprompt = prompt('Proxy:port (blank for default)', config.defaultProxy)
3739
const username = prompt('Username', 'pviewer' + (Math.floor(Math.random() * 1000)))
3840
let password = prompt('Password (blank for offline)', '')
3941
password = password === '' ? undefined : password

0 commit comments

Comments
 (0)