forked from Sandertv/gophertunnel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
structure_template_data_request.go
39 lines (34 loc) · 1.34 KB
/
structure_template_data_request.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
package packet
import (
"github.com/Adrian8115/gophertunnel-Amethyst-Protocol/minecraft/protocol"
)
const (
StructureTemplateRequestExportFromSave = iota + 1
StructureTemplateRequestExportFromLoad
StructureTemplateRequestQuerySavedStructure
StructureTemplateRequestImportFromSave
)
// StructureTemplateDataRequest is sent by the client to request data of a structure.
type StructureTemplateDataRequest struct {
// StructureName is the name of the structure that was set in the structure block's UI. This is the name
// used to export the structure to a file.
StructureName string
// Position is the position of the structure block that has its template data requested.
Position protocol.BlockPos
// Settings is a struct of settings that should be used for exporting the structure. These settings are
// identical to the last sent in the StructureBlockUpdate packet by the client.
Settings protocol.StructureSettings
// RequestType specifies the type of template data request that the player sent. It is one of the
// constants found above.
RequestType byte
}
// ID ...
func (pk *StructureTemplateDataRequest) ID() uint32 {
return IDStructureTemplateDataRequest
}
func (pk *StructureTemplateDataRequest) Marshal(io protocol.IO) {
io.String(&pk.StructureName)
io.UBlockPos(&pk.Position)
protocol.Single(io, &pk.Settings)
io.Uint8(&pk.RequestType)
}