/
io.go
51 lines (48 loc) · 1.3 KB
/
io.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
42
43
44
45
46
47
48
49
50
51
package protocol
import (
"github.com/go-gl/mathgl/mgl32"
"github.com/google/uuid"
"github.com/sandertv/gophertunnel/minecraft/nbt"
"image/color"
)
// IO represents a packet IO direction. Implementations of this interface are Reader and Writer. Reader reads
// data from the input stream into the pointers passed, whereas Writer writes the values the pointers point to
// to the output stream.
type IO interface {
Uint16(x *uint16)
Int16(x *int16)
Uint32(x *uint32)
Int32(x *int32)
BEInt32(x *int32)
Uint64(x *uint64)
Int64(x *int64)
Float32(x *float32)
Uint8(x *uint8)
Int8(x *int8)
Bool(x *bool)
Varint64(x *int64)
Varuint64(x *uint64)
Varint32(x *int32)
Varuint32(x *uint32)
String(x *string)
StringUTF(x *string)
ByteSlice(x *[]byte)
Vec3(x *mgl32.Vec3)
Vec2(x *mgl32.Vec2)
BlockPos(x *BlockPos)
UBlockPos(x *BlockPos)
ChunkPos(x *ChunkPos)
SubChunkPos(x *SubChunkPos)
ByteFloat(x *float32)
Bytes(p *[]byte)
NBT(m *map[string]interface{}, encoding nbt.Encoding)
NBTList(m *[]interface{}, encoding nbt.Encoding)
UUID(x *uuid.UUID)
VarRGBA(x *color.RGBA)
EntityMetadata(x *map[uint32]interface{})
Item(x *ItemStack)
ItemInstance(i *ItemInstance)
MaterialReducer(x *MaterialReducer)
UnknownEnumOption(value interface{}, enum string)
InvalidValue(value interface{}, forField, reason string)
}