Add support for protocol version 800 (1.21.80)

Introduced support for protocol 800, including biome definitions, camera presets, and player list updates. Upgraded dependencies, adjusted mappings, and enhanced the README to reflect recent changes.
This commit is contained in:
AkmalFairuz
2025-05-11 21:32:37 +07:00
parent bcb3e990d3
commit 8a209b75bf
14 changed files with 9454 additions and 14 deletions

View File

@@ -120,6 +120,10 @@ func convertPacketFunc(pid uint32, cur func() packet.Packet) func() packet.Packe
return func() packet.Packet { return &legacypacket.UpdatePlayerGameType{} }
case packet.IDSetActorMotion:
return func() packet.Packet { return &legacypacket.SetActorMotion{} }
case packet.IDBiomeDefinitionList:
return func() packet.Packet { return &legacypacket.BiomeDefinitionList{} }
case packet.IDPlayerList:
return func() packet.Packet { return &legacypacket.PlayerList{} }
default:
return cur
}
@@ -708,6 +712,20 @@ func (p *Protocol) downgradePackets(pks []packet.Packet, conn *minecraft.Conn) [
Elements: pk.Elements,
Visibility: pk.Visibility,
}
case *packet.BiomeDefinitionList:
pks[pkIndex] = &legacypacket.BiomeDefinitionList{
BiomeDefinitions: pk.BiomeDefinitions,
StringList: pk.StringList,
}
case *packet.PlayerList:
entries := make([]proto.PlayerListEntry, len(pk.Entries))
for i, e := range pk.Entries {
entries[i] = (&proto.PlayerListEntry{}).FromLatest(e)
}
pks[pkIndex] = &legacypacket.PlayerList{
ActionType: pk.ActionType,
Entries: entries,
}
}
}
@@ -1213,6 +1231,20 @@ func (p *Protocol) upgradePackets(pks []packet.Packet, conn *minecraft.Conn) []p
Elements: pk.Elements,
Visibility: pk.Visibility,
}
case *legacypacket.BiomeDefinitionList:
pks[pkIndex] = &packet.BiomeDefinitionList{
BiomeDefinitions: pk.BiomeDefinitions,
StringList: pk.StringList,
}
case *legacypacket.PlayerList:
entries := make([]protocol.PlayerListEntry, len(pk.Entries))
for i, e := range pk.Entries {
entries[i] = e.ToLatest()
}
pks[pkIndex] = &packet.PlayerList{
ActionType: pk.ActionType,
Entries: entries,
}
}
}
return pks