Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandertv committed Jun 13, 2023
2 parents e95f3ce + 5ddad01 commit 7c5edc3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions minecraft/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,7 @@ func (conn *Conn) startGame() {
DisablePlayerInteractions: data.DisablePlayerInteractions,
BaseGameVersion: data.BaseGameVersion,
GameVersion: protocol.CurrentVersion,
UseBlockNetworkIDHashes: data.UseBlockNetworkIDHashes,
})
_ = conn.Flush()
conn.expect(packet.IDRequestChunkRadius, packet.IDSetLocalPlayerAsInitialised)
Expand Down Expand Up @@ -1231,6 +1232,7 @@ func (conn *Conn) handleStartGame(pk *packet.StartGame) error {
DisablePlayerInteractions: pk.DisablePlayerInteractions,
ClientSideGeneration: pk.ClientSideGeneration,
Experiments: pk.Experiments,
UseBlockNetworkIDHashes: pk.UseBlockNetworkIDHashes,
}
for _, item := range pk.Items {
if item.Name == "minecraft:shield" {
Expand Down
4 changes: 4 additions & 0 deletions minecraft/game_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,8 @@ type GameData struct {
ChatRestrictionLevel uint8
// DisablePlayerInteractions is true if the client should ignore other players when interacting with the world.
DisablePlayerInteractions bool
// 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.
UseBlockNetworkIDHashes bool
}

0 comments on commit 7c5edc3

Please sign in to comment.