Update legacy protocol support to v1.21.90

This commit is contained in:
AkmalFairuz
2025-06-18 23:54:54 +07:00
parent 8a209b75bf
commit fd5e43eea7
13 changed files with 9376 additions and 9 deletions

View File

@@ -232,6 +232,8 @@ type StartGame struct {
WorldID string
// ScenarioID is always empty in vanilla and its usage is currently unknown.
ScenarioID string
// OwnerID is always empty in vanilla and its usage is currently unknown.
OwnerID string
// UseBlockNetworkIDHashes is true if the client should use the hash of a block's name as its network ID rather than
// its index in the expected block palette. This is useful for servers that wish to support multiple protocol versions
// and custom blocks, but it will result in extra bytes being written for every block in a sub chunk palette.
@@ -309,6 +311,9 @@ func (pk *StartGame) Marshal(io protocol.IO) {
io.String(&pk.ServerID)
io.String(&pk.WorldID)
io.String(&pk.ScenarioID)
if proto.IsProtoGTE(io, proto.ID818) {
io.String(&pk.OwnerID)
}
}
io.String(&pk.LevelID)
io.String(&pk.WorldName)