Skip to content

Commit

Permalink
minecraft/protocol: More camera docs & document filtered fields
Browse files Browse the repository at this point in the history
  • Loading branch information
TwistedAsylumMC committed Dec 4, 2024
1 parent 495bf79 commit 5590e86
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions minecraft/protocol/camera.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,10 @@ type CameraPreset struct {
HorizontalRotationLimit Optional[mgl32.Vec2]
// VerticalRotationLimit is the vertical rotation limit of the camera.
VerticalRotationLimit Optional[mgl32.Vec2]
// ContinueTargeting determines whether the camera should continue targeting the entity or not.
// ContinueTargeting determines whether the camera should continue targeting when using aim assist.
ContinueTargeting Optional[bool]
// BlockListeningRadius ...
BlockListeningRadius Optional[float32]
// TrackingRadius is the radius around the camera that the aim assist should track targets.
TrackingRadius Optional[float32]
// ViewOffset is only used in a follow_orbit camera and controls an offset based on a pivot point to the
// player, causing it to be shifted in a certain direction.
ViewOffset Optional[mgl32.Vec2]
Expand Down Expand Up @@ -206,7 +206,7 @@ func (x *CameraPreset) Marshal(r IO) {
OptionalFunc(r, &x.HorizontalRotationLimit, r.Vec2)
OptionalFunc(r, &x.VerticalRotationLimit, r.Vec2)
OptionalFunc(r, &x.ContinueTargeting, r.Bool)
OptionalFunc(r, &x.BlockListeningRadius, r.Float32)
OptionalFunc(r, &x.TrackingRadius, r.Float32)
OptionalFunc(r, &x.ViewOffset, r.Vec2)
OptionalFunc(r, &x.EntityOffset, r.Vec3)
OptionalFunc(r, &x.Radius, r.Float32)
Expand Down
3 changes: 2 additions & 1 deletion minecraft/protocol/item_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ type StackResponseSlotInfo struct {
StackNetworkID int32
// CustomName is the custom name of the item stack. It is used in relation to text filtering.
CustomName string
// FilteredCustomName is always set to empty and the usage is currently unknown.
// FilteredCustomName is a filtered version of CustomName with all the profanity removed. The client will
// use this over CustomName if this field is not empty and they have the "Filter Profanity" setting enabled.
FilteredCustomName string
// DurabilityCorrection is the current durability of the item stack. This durability will be shown
// client-side after the response is sent to the client.
Expand Down
3 changes: 2 additions & 1 deletion minecraft/protocol/packet/disconnect.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ type Disconnect struct {
// Message is an optional message to show when disconnected. This message is only written if the
// HideDisconnectionScreen field is set to true.
Message string
// FilteredMessage is always set to empty and the usage is currently unknown.
// FilteredMessage is a filtered version of Message with all the profanity removed. The client will use
// this over Message if this field is not empty and they have the "Filter Profanity" setting enabled.
FilteredMessage string
}

Expand Down
3 changes: 2 additions & 1 deletion minecraft/protocol/packet/set_title.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ type SetTitle struct {
XUID string
// PlatformOnlineID is either a uint64 or an empty string.
PlatformOnlineID string
// FilteredMessage is always set to empty and the usage is currently unknown.
// FilteredMessage is a filtered version of Message with all the profanity removed. The client will use
// this over Message if this field is not empty and they have the "Filter Profanity" setting enabled.
FilteredMessage string
}

Expand Down
3 changes: 2 additions & 1 deletion minecraft/protocol/packet/text.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ type Text struct {
// Nintendo Switch). It is otherwise an empty string, and is used to decide which players are able to
// chat with each other.
PlatformChatID string
// FilteredMessage is always set to empty and the usage is currently unknown.
// FilteredMessage is a filtered version of Message with all the profanity removed. The client will use
// this over Message if this field is not empty and they have the "Filter Profanity" setting enabled.
FilteredMessage string
}

Expand Down

0 comments on commit 5590e86

Please sign in to comment.