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 Sep 5, 2023
2 parents daa1201 + 719c18b commit d0e79fe
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
6 changes: 3 additions & 3 deletions minecraft/protocol/packet/boss_event.go
Expand Up @@ -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
Expand All @@ -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:
Expand All @@ -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:
Expand Down
10 changes: 5 additions & 5 deletions minecraft/protocol/packet/client_bound_debug_renderer.go
Expand Up @@ -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.
Expand All @@ -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 ...
Expand All @@ -36,14 +36,14 @@ 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)
io.Float32(&pk.Red)
io.Float32(&pk.Green)
io.Float32(&pk.Blue)
io.Float32(&pk.Alpha)
io.Int64(&pk.Duration)
io.Uint64(&pk.Duration)
}
}
15 changes: 6 additions & 9 deletions minecraft/protocol/packet/update_client_input_locks.go
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion minecraft/protocol/packet/update_player_game_type.go
Expand Up @@ -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.
Expand Down

0 comments on commit d0e79fe

Please sign in to comment.