forked from Sandertv/gophertunnel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
camera_shake.go
41 lines (35 loc) · 1.13 KB
/
camera_shake.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
package packet
import "github.com/Adrian8115/gophertunnel-Amethyst-Protocol/minecraft/protocol"
const (
CameraShakeTypePositional uint8 = iota
CameraShakeTypeRotational
)
const (
CameraShakeActionAdd = iota
CameraShakeActionStop
)
// CameraShake is sent by the server to make the camera shake client-side. This feature was added for map-
// making partners.
type CameraShake struct {
// Intensity is the intensity of the shaking. The client limits this value to 4, so anything higher may
// not work.
Intensity float32
// Duration is the number of seconds the camera will shake for.
Duration float32
// Type is the type of shake, and is one of the constants listed above. The different type affects how
// the shake looks in game.
Type uint8
// Action is the action to be performed, and is one of the constants listed above. Currently the
// different actions will either add or stop shaking the client.
Action uint8
}
// ID ...
func (*CameraShake) ID() uint32 {
return IDCameraShake
}
func (pk *CameraShake) Marshal(io protocol.IO) {
io.Float32(&pk.Intensity)
io.Float32(&pk.Duration)
io.Uint8(&pk.Type)
io.Uint8(&pk.Action)
}