Skip to content

Commit 996f5c7

Browse files
committed
Fix 1.20.2 login, enable 1.20.2 support, edit TODO
1.20.2 still seems to have an odd issue with BungeeCord where ServerConnectedEvent is not called?...
1 parent f7b41f1 commit 996f5c7

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Disclaimer: This app is NOT an official Minecraft product. It is not associated
99
## Features (still being worked on)
1010

1111
- Fully open-source with no ads! Easily report issues through GitHub and get a direct response.
12-
- Supports connecting to Minecraft 1.16.4 through Minecraft 1.20.1 servers. (Older versions planned.)
12+
- Supports connecting to Minecraft 1.16.4 through Minecraft 1.20.2 servers. (Older versions planned.)
1313
- Supports all Minecraft chat features, which sometimes trip up other chat apps.
1414
- Send join messages and commands on connecting to a server.
1515
- Health change indicator and respawn on death support.

src/components/servers/EditServerDialog.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ const EditServerDialog = ({
106106
dropdownIconColor={darkMode ? '#ffffff' : '#000000'}
107107
>
108108
<Picker.Item label='Auto' value='auto' />
109+
<Picker.Item label='1.20.2 (WIP)' value='1.20.2' />
109110
<Picker.Item label='1.20/1.20.1 (WIP)' value='1.20.1' />
110111
<Picker.Item label='1.19.4 (WIP)' value='1.19.4' />
111112
<Picker.Item label='1.19.3 (WIP)' value='1.19.3' />

src/minecraft/connection/shared.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,16 @@ export const getLoginPacket = (opts: ConnectionOptions): Buffer => {
5656
} */
5757
}
5858
if (opts.protocolVersion >= protocolMap['1.19.1']) {
59+
if (opts.protocolVersion < protocolMap['1.20.2']) {
60+
data.push(concatPacketData([!!opts.selectedProfile]))
61+
}
5962
if (opts.selectedProfile) {
6063
const msb = Buffer.from(opts.selectedProfile.substring(0, 16), 'hex')
6164
const lsb = Buffer.from(opts.selectedProfile.substring(16), 'hex')
62-
data.push(concatPacketData([true, msb, lsb]))
63-
} else data.push(concatPacketData([false]))
65+
data.push(concatPacketData([msb, lsb]))
66+
} else if (opts.protocolVersion >= protocolMap['1.20.2']) {
67+
data.push(concatPacketData([Buffer.alloc(8), Buffer.alloc(8)]))
68+
}
6469
}
6570
return concatPacketData(data)
6671
}

src/minecraft/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const protocolMap = {
1818
'1.20': 763,
1919
'1.20.1': 763,
2020
'1.20.2': 764,
21-
latest: 763,
21+
latest: 764,
2222
auto: -1
2323
}
2424

src/utilities/connection/packetHandler.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export const packetHandler =
105105
const is118 = version >= protocolMap[1.18]
106106
const is1191 = version >= protocolMap['1.19.1']
107107

108-
// FIXME: 1.20.2 also has a second Client Information in configuration state.
108+
// LOW-TODO: 1.20.2 also has a second Client Information in configuration state, do we send it?
109109
if (connection.state === ConnectionState.PLAY) {
110110
if (
111111
packet.id === packetIds.CLIENTBOUND_LOGIN_SUCCESS(version) ||
@@ -120,7 +120,7 @@ export const packetHandler =
120120
viewDistance.writeInt8(2)
121121
const skinParts = Buffer.alloc(1)
122122
skinParts.writeUInt8(0b11111111)
123-
// TODO: Intl in future? And other setting changes too.
123+
// LOW-TODO: Intl in future? And other setting changes too.
124124
const packetData: PacketDataTypes[] = [
125125
'en_US',
126126
viewDistance,
@@ -152,8 +152,7 @@ export const packetHandler =
152152
}
153153
} else if (packet.id === packetIds.CLIENTBOUND_RESPAWN(version)) {
154154
// Send spawn command when switching worlds.
155-
// FIXME: This packet is not recv when switching worlds on Velocity...
156-
// Perhaps we track dimension ID or something and equate the two or something?
155+
// TODO: Velocity doesn't send this, only Login on switching worlds. Track dimension?
157156
if (sendSpawnCommand) {
158157
connection
159158
.writePacket(...makeChatMessagePacket('/spawn', version))

0 commit comments

Comments
 (0)