Refactor: Remove VarInt type, replace with int32, and consolidate encoding/decoding logic

This commit is contained in:
adman
2025-12-24 00:29:43 +01:00
parent 2f81976fe8
commit dd41115ca2
10 changed files with 41 additions and 32 deletions
+2 -2
View File
@@ -52,10 +52,10 @@ func (s *LoginClient) OnStart(_ event.OnStart) (err error) {
return
}
err = s.Send(v1_21_8.HandshakingToServerPacketSetProtocol{
ProtocolVersion: proto_base.VarInt(versionData.Version),
ProtocolVersion: int32(versionData.Version),
ServerHost: host,
ServerPort: uint16(port),
NextState: proto_base.VarInt(proto_base.Login),
NextState: int32(proto_base.Login),
})
if err != nil {
return
+2 -2
View File
@@ -34,10 +34,10 @@ func (s *StatusClient) OnStart(_ event.OnStart) (err error) {
return
}
err = s.Send(v1_21_8.HandshakingToServerPacketSetProtocol{
ProtocolVersion: proto_base.VarInt(versionData.Version),
ProtocolVersion: int32(versionData.Version),
ServerHost: parts[0],
ServerPort: uint16(port),
NextState: proto_base.VarInt(proto_base.Status),
NextState: int32(proto_base.Status),
})
if err != nil {
return