-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
651 additions
and
257 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ node_modules | |
package-lock.json | ||
dist | ||
worlds/** | ||
nmp-cache/** | ||
nmp-cache/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,39 @@ | ||
const { InspectorProxy } = require('../') | ||
|
||
const readline = require('readline') | ||
const rl = readline.createInterface({ | ||
input: process.stdin, | ||
output: process.stdout | ||
}) | ||
|
||
rl.on('line', (line) => { | ||
line = line.trim().toLowerCase() | ||
if (line === 'stopserver') { | ||
proxy.stopServer() | ||
} else if (line === 'startserver') { | ||
proxy.startServer() | ||
} else if (line === 'stopbot') { | ||
proxy.stopBot() | ||
} else if (line === 'startbot') { | ||
proxy.startBot() | ||
} | ||
}) | ||
const { Vec3 } = require('vec3') | ||
|
||
const proxy = new InspectorProxy({ | ||
host: 'localhost', | ||
username: 'proxyBot', | ||
version: '1.12.2' | ||
auth: 'offline', | ||
profilesFolder: './nmp-cache', | ||
version: '1.12.2', | ||
checkTimeoutInterval: 90_000, | ||
// port: 25567 | ||
}, { | ||
linkOnConnect: true, | ||
// linkOnConnect: true, | ||
botAutoStart: false, // start the bot when the proxy starts | ||
botStopOnLogoff: false, // Stop the bot when the last person leaves the proxy | ||
botStopOnLogoff: true, // Stop the bot when the last person leaves the proxy | ||
serverAutoStart: true, // start the server when the proxy starts | ||
serverStopOnBotStop: false, // Stop the server when the bot stops | ||
autoStartBotOnServerLogin: false | ||
autoStartBotOnServerLogin: true, | ||
// positionOffset: new Vec3(5000, 0, 0), | ||
worldCaching: false | ||
}) | ||
|
||
proxy.on('clientDisconnect', () => { | ||
console.info('Client disconnected') | ||
}) | ||
|
||
proxy.on('serverStart', () => console.info('Server started')) | ||
proxy.on('serverClose', () => console.info('Server closed')) | ||
proxy.on('botEnd', () => console.info('Bot disconnected')) | ||
|
||
proxy.on('botStart', (conn) => { | ||
conn.bot.on('spawn', () => { | ||
console.info('Bot spawned') | ||
}) | ||
|
||
console.info('Bot spawned') | ||
|
||
proxy.on('clientChat', (client, line) => { | ||
if (line === 'test') { | ||
console.info(proxy.conn.receivingClients) | ||
} | ||
}) | ||
|
||
conn.bot._client.on('packet', (data, packetMeta) => { | ||
if (packetMeta.name === 'unlock_recipes') { // This packet is blocked because it is causing issues on 2beeetwoteee | ||
console.info(data) | ||
} | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const writeLevel = require('prismarine-provider-anvil').level.writeLevel | ||
|
||
if (process.argv.length !== 3) { | ||
console.log('Usage : node example_write_level.js <level.dat>') | ||
process.exit(1) | ||
} | ||
|
||
writeLevel(process.argv[2], { RandomSeed: [123, 0] }) | ||
.catch(function (err) { console.log(err.stack) }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.