Skip to content

Commit e270c0e

Browse files
authored
Release (#459)
2 parents 105bfe9 + 007782b commit e270c0e

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/controls.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const contro = new ControMax({
9292
toggleMicrophone: ['KeyM'],
9393
},
9494
advanced: {
95-
lockUrl: ['KeyY'],
95+
lockUrl: [null],
9696
},
9797
custom: {} as Record<string, SchemaCommandInput & { type: string, input: any[] }>,
9898
// waila: {

src/customChannels.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default () => {
2121
customEvents.on('mineflayerBotCreated', async () => {
2222
if (!getIsCustomChannelsEnabled()) return
2323
bot.once('login', () => {
24+
registerConnectMetadataChannel()
2425
registerBlockModelsChannel()
2526
registerMediaChannels()
2627
registerSectionAnimationChannels()
@@ -48,6 +49,25 @@ const registerChannel = (channelName: string, packetStructure: any[], handler: (
4849
console.debug(`registered custom channel ${channelName} channel`)
4950
}
5051

52+
const registerConnectMetadataChannel = () => {
53+
const CHANNEL_NAME = 'minecraft-web-client:connect-metadata'
54+
const packetStructure = [
55+
'container',
56+
[
57+
{ name: 'metadata', type: ['pstring', { countType: 'i16' }] }
58+
]
59+
]
60+
61+
bot._client.registerChannel(CHANNEL_NAME, packetStructure, true)
62+
bot._client.writeChannel(CHANNEL_NAME, {
63+
metadata: JSON.stringify({
64+
version: process.env.RELEASE_TAG,
65+
build: process.env.BUILD_VERSION,
66+
...window.serverMetadataConnect,
67+
})
68+
})
69+
}
70+
5171
const registerBlockInteractionsCustomizationChannel = () => {
5272
const CHANNEL_NAME = 'minecraft-web-client:block-interactions-customization'
5373
const packetStructure = [

0 commit comments

Comments
 (0)