bedrocktool/ui/messages/messages.go

75 lines
1006 B
Go
Raw Normal View History

2023-03-18 11:12:54 +00:00
package messages
2023-03-08 11:46:16 +00:00
import (
"image"
"github.com/sandertv/gophertunnel/minecraft/protocol"
)
2023-03-18 11:12:54 +00:00
type MessageResponse struct {
Ok bool
Data interface{}
}
2023-03-14 01:07:39 +00:00
type UIState = int
const (
UIStateConnect = iota
UIStateConnecting
UIStateMain
)
type HandlerFunc = func(name string, data interface{}) MessageResponse
2023-03-18 11:12:54 +00:00
//
const SetUIState = "set_ui_state"
2023-03-08 11:46:16 +00:00
2023-03-18 11:12:54 +00:00
type SetUIStatePayload = UIState
//
const SetVoidGen = "set_void_gen"
2023-03-08 11:46:16 +00:00
type SetVoidGenPayload struct {
Value bool
}
2023-03-18 11:12:54 +00:00
//
const SetWorldName = "set_world_name"
2023-03-08 11:46:16 +00:00
type SetWorldNamePayload struct {
WorldName string
}
2023-03-18 11:12:54 +00:00
//
var Init = "init"
2023-03-08 11:46:16 +00:00
type InitPayload struct {
Handler HandlerFunc
}
2023-03-18 11:12:54 +00:00
//
var UpdateMap = "update_map"
2023-03-08 11:46:16 +00:00
type UpdateMapPayload struct {
2023-03-14 01:07:39 +00:00
ChunkCount int
2023-03-14 15:32:18 +00:00
Rotation float32
2023-03-14 01:07:39 +00:00
UpdatedTiles []protocol.ChunkPos
Tiles map[protocol.ChunkPos]*image.RGBA
BoundsMin protocol.ChunkPos
BoundsMax protocol.ChunkPos
2023-03-11 15:05:26 +00:00
}
2023-03-18 11:12:54 +00:00
//
var NewSkin = "new_skin"
type NewSkinPayload struct {
PlayerName string
Skin *protocol.Skin
}