mineflayer 4.21.0 → 4.22.0
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/docs/history.md +3 -0
- package/examples/echo.js +6 -2
- package/lib/plugins/game.js +0 -2
- package/package.json +1 -1
package/docs/history.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
## 4.22.0
|
|
2
|
+
* [Remove debug logging (#3478)](https://github.com/PrismarineJS/mineflayer/commit/eb29d350ede0590fce17e04bf21071807a87e3a1) (thanks @extremeheat)
|
|
3
|
+
|
|
1
4
|
## 4.21.0
|
|
2
5
|
* [1.20.6 (#3412)](https://github.com/PrismarineJS/mineflayer/commit/44fad41c18be5024564e24e1cdee624d35d4d387) (thanks @extremeheat)
|
|
3
6
|
* [Update README.md (#3420)](https://github.com/PrismarineJS/mineflayer/commit/1c2a5c0fa78f74a63fabd7edde85c4a74db32dee) (thanks @SilkePilon)
|
package/examples/echo.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
const mineflayer = require('mineflayer')
|
|
10
10
|
|
|
11
11
|
if (process.argv.length < 4 || process.argv.length > 6) {
|
|
12
|
-
console.log('Usage : node echo.js <host> <port> [<name>] [
|
|
12
|
+
console.log('Usage : node echo.js <host> <port> [<name>] [online?]')
|
|
13
13
|
process.exit(1)
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -17,10 +17,14 @@ const bot = mineflayer.createBot({
|
|
|
17
17
|
host: process.argv[2],
|
|
18
18
|
port: parseInt(process.argv[3]),
|
|
19
19
|
username: process.argv[4] ? process.argv[4] : 'echo',
|
|
20
|
-
|
|
20
|
+
auth: process.argv[5] ? 'microsoft' : 'offline'
|
|
21
21
|
})
|
|
22
22
|
|
|
23
23
|
bot.on('chat', (username, message) => {
|
|
24
24
|
if (username === bot.username) return
|
|
25
25
|
bot.chat(message)
|
|
26
26
|
})
|
|
27
|
+
|
|
28
|
+
bot.on('kicked', (reason) => {
|
|
29
|
+
console.log('I was kicked from the server: ' + reason)
|
|
30
|
+
})
|
package/lib/plugins/game.js
CHANGED
|
@@ -55,7 +55,6 @@ function inject (bot, options) {
|
|
|
55
55
|
if (packet.worldType && !bot.game.dimension) {
|
|
56
56
|
bot.game.dimension = packet.worldType.replace('minecraft:', '')
|
|
57
57
|
}
|
|
58
|
-
console.log('*Dimension data', bot.game.dimension, bot.registry.dimensionsByName, packet)
|
|
59
58
|
const dimData = bot.registry.dimensionsByName[bot.game.dimension]
|
|
60
59
|
if (dimData) {
|
|
61
60
|
bot.game.minY = dimData.minY
|
|
@@ -79,7 +78,6 @@ function inject (bot, options) {
|
|
|
79
78
|
|
|
80
79
|
// 1.20.2
|
|
81
80
|
bot._client.on('registry_data', (packet) => {
|
|
82
|
-
console.log('Loading Dimension Codec', JSON.stringify(packet).slice(0, 100))
|
|
83
81
|
bot.registry.loadDimensionCodec(packet.codec || packet)
|
|
84
82
|
})
|
|
85
83
|
|