diff --git a/minecraft/protocol/packet/boss_event.go b/minecraft/protocol/packet/boss_event.go index bd013b0c..2ed31985 100644 --- a/minecraft/protocol/packet/boss_event.go +++ b/minecraft/protocol/packet/boss_event.go @@ -54,7 +54,7 @@ type BossEvent struct { // BossEntityUniqueID matches the client's entity unique ID. HealthPercentage float32 // ScreenDarkening currently seems not to do anything. - ScreenDarkening int16 + ScreenDarkening uint16 // Colour is the colour of the boss bar that is shown when a player is // subscribed. It is only set if the EventType is BossEventShow, // BossEventAppearanceProperties or BossEventTexture. This is functional as @@ -79,7 +79,7 @@ func (pk *BossEvent) Marshal(io protocol.IO) { case BossEventShow: io.String(&pk.BossBarTitle) io.Float32(&pk.HealthPercentage) - io.Int16(&pk.ScreenDarkening) + io.Uint16(&pk.ScreenDarkening) io.Varuint32(&pk.Colour) io.Varuint32(&pk.Overlay) case BossEventRegisterPlayer, BossEventUnregisterPlayer, BossEventRequest: @@ -91,7 +91,7 @@ func (pk *BossEvent) Marshal(io protocol.IO) { case BossEventTitle: io.String(&pk.BossBarTitle) case BossEventAppearanceProperties: - io.Int16(&pk.ScreenDarkening) + io.Uint16(&pk.ScreenDarkening) io.Varuint32(&pk.Colour) io.Varuint32(&pk.Overlay) case BossEventTexture: diff --git a/minecraft/protocol/packet/client_bound_debug_renderer.go b/minecraft/protocol/packet/client_bound_debug_renderer.go index f017d76f..23e887f7 100644 --- a/minecraft/protocol/packet/client_bound_debug_renderer.go +++ b/minecraft/protocol/packet/client_bound_debug_renderer.go @@ -6,14 +6,14 @@ import ( ) const ( - ClientBoundDebugRendererClear int32 = iota + 1 + ClientBoundDebugRendererClear uint32 = iota + 1 ClientBoundDebugRendererAddCube ) // ClientBoundDebugRenderer is sent by the server to spawn an outlined cube on client-side. type ClientBoundDebugRenderer struct { // Type is the type of action. It is one of the constants above. - Type int32 + Type uint32 // Text is the text that is displayed above the debug. Text string // Position is the position to spawn the debug on. @@ -27,7 +27,7 @@ type ClientBoundDebugRenderer struct { // Alpha is the alpha value from the RGBA colour rendered on the debug. This value is in the range 0-1. Alpha float32 // Duration is how long the debug will last in the world for. It is measured in milliseconds. - Duration int64 + Duration uint64 } // ID ... @@ -36,7 +36,7 @@ func (*ClientBoundDebugRenderer) ID() uint32 { } func (pk *ClientBoundDebugRenderer) Marshal(io protocol.IO) { - io.Int32(&pk.Type) + io.Varuint32(&pk.Type) if pk.Type == ClientBoundDebugRendererAddCube { io.String(&pk.Text) io.Vec3(&pk.Position) @@ -44,6 +44,6 @@ func (pk *ClientBoundDebugRenderer) Marshal(io protocol.IO) { io.Float32(&pk.Green) io.Float32(&pk.Blue) io.Float32(&pk.Alpha) - io.Int64(&pk.Duration) + io.Uint64(&pk.Duration) } } diff --git a/minecraft/protocol/packet/update_client_input_locks.go b/minecraft/protocol/packet/update_client_input_locks.go index 16bf1810..dc0b9a3d 100644 --- a/minecraft/protocol/packet/update_client_input_locks.go +++ b/minecraft/protocol/packet/update_client_input_locks.go @@ -6,18 +6,15 @@ import ( ) const ( - ClientInputLockMove = 1 << (iota + 1) - ClientInputLockJump - ClientInputLockSneak - ClientInputLockMount - ClientInputLockDismount - ClientInputLockRotation + ClientInputLockCamera = 1 << (iota + 1) + ClientInputLockMovement ) -// UpdateClientInputLocks is sent by the server to the client to lock certain inputs the client usually has, such as -// movement, jumping, sneaking, and more. +// UpdateClientInputLocks is sent by the server to the client to lock either the camera or physical movement of the client. type UpdateClientInputLocks struct { - // Locks is an encoded bitset of all locks that are currently active. The locks are defined in the constants above. + // Locks is a bitset that controls which locks are active. It is a combination of the constants above. If the camera + // is locked, then the player cannot change their pitch or yaw. If movement is locked, the player cannot move in any + // direction, they cannot jump, sneak or mount/dismount from any entities. Locks uint32 // Position is the server's position of the client at the time the packet was sent. It is unclear what the exact // purpose of this field is. diff --git a/minecraft/protocol/packet/update_player_game_type.go b/minecraft/protocol/packet/update_player_game_type.go index c70e9b5b..12b2f7ae 100644 --- a/minecraft/protocol/packet/update_player_game_type.go +++ b/minecraft/protocol/packet/update_player_game_type.go @@ -9,7 +9,7 @@ import ( type UpdatePlayerGameType struct { // GameType is the new game type of the player. It is one of the constants that can be found in // set_player_game_type.go. Some of these game types require additional flags to be set in an - // AdventureSettings packet for the game mode to obtain its full functionality. + // UpdateAbilities packet for the game mode to obtain its full functionality. GameType int32 // PlayerUniqueID is the entity unique ID of the player that should have its game mode updated. If this // packet is sent to other clients with the player unique ID of another player, nothing happens.