This repository has been archived by the owner on Oct 22, 2023. It is now read-only.
forked from ZeppelinMC/Zeppelin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstructs.go
216 lines (188 loc) · 5.55 KB
/
structs.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
package main
import (
"dynamite/logger"
"errors"
"sync"
"github.com/Tnze/go-mc/level"
"github.com/Tnze/go-mc/net"
"github.com/Tnze/go-mc/net/packet"
"github.com/Tnze/go-mc/save"
"github.com/Tnze/go-mc/yggdrasil/user"
)
var ErrChunkNotExist = errors.New("ErrChunkNotExist")
type Playerlist struct{}
type World struct {
TickLock *sync.Mutex
Name string
Chunks map[[2]int32]*LoadedChunk
}
type Enchantment struct {
ID string `nbt:"id"`
Level int32 `nbt:"lvl"`
}
type InventorySlotTag struct {
Damage int32 `nbt:"Damage"`
RepairCost int32 `nbt:"RepairCost"`
Enchantments []Enchantment `nbt:"Enchantments"`
}
type InventorySlot struct {
Count int `nbt:"Count"`
Slot int `nbt:"Slot"`
ID string `nbt:"id"`
Tag InventorySlotTag `nbt:"tag"`
}
type Inventory []InventorySlot
type PlayerDataRecipeBook struct {
IsBlastingFurnaceFilteringCraftable int32 `nbt:"isBlastingFurnaceFilteringCraftable"`
IsBlastingFurnaceGuiOpen int32 `nbt:"isBlastingFurnaceGuiOpen"`
IsFilteringCraftable int32 `nbt:"isFilteringCraftable"`
IsFurnaceFilteringCraftable int32 `nbt:"isFurnaceFilteringCraftable"`
IsFurnaceGuiOpen int32 `nbt:"isFurnaceGuiOpen"`
IsGuiOpen int32 `nbt:"isGuiOpen"`
IsSmokerFilteringCraftables int32 `nbt:"isSmokerFilteringCraftables"`
IsSmokerGuiOpen int32 `nbt:"isSmokerGuiOpen"`
Recipes []interface{} `nbt:"recipes"`
ToBeDisplayed []interface{} `nbt:"toBeDisplayed"`
}
type PlayerData struct {
Attributes []interface{} `nbt:"Attributes"`
OnGround int32 `nbt:"OnGround"`
Health float32 `nbt:"Health"`
Dimension string `nbt:"Dimension"`
Fire int32 `nbt:"Fire"`
Score int32 `nbt:"Score"`
SelectedItemSlot int32 `nbt:"SelectedItemSlot"`
EnderItems []interface{} `nbt:"EnderItems"`
Inventory Inventory `nbt:"Inventory"`
Pos []float64 `nbt:"Pos"`
Motion []interface{} `nbt:"Motion"`
Rotation []float32 `nbt:"Rotation"`
XpLevel int32 `nbt:"XpLevel"`
XpTotal int32 `nbt:"XpTotal"`
XpP float32 `nbt:"XpP"`
DeathTime int32 `nbt:"DeathTime"`
HurtTime int32 `nbt:"HurtTime"`
SleepTimer int32 `nbt:"SleepTimer"`
SeenCredits int32 `nbt:"seenCredits"`
PlayerGameType int32 `nbt:"playerGameType"`
FoodLevel int32 `nbt:"foodLevel"`
FoodExhaustionLevel float32 `nbt:"foodExhaustionLevel"`
FoodSaturationLevel float32 `nbt:"foodSaturationLevel"`
FoodTickTimer int32 `nbt:"foodTickTimer"`
RecipeBook PlayerDataRecipeBook `nbt:"recipeBook"`
}
type Player struct {
sync.Mutex
Name string
UUID UUID
Connection *net.Conn
Properties []user.Property
Client ClientData
IP string
Position [3]int32
OldPosition [3]int32
Rotation [2]float32
ChunkPos [3]int32
LoadedChunks map[[2]int32]struct{}
LoadQueue [][2]int32
UnloadQueue [][2]int32
Data PlayerData
LastTick uint
EntityID int
}
const (
CHAT_ENABLED = iota
CHAT_COMMANDS_ONLY
CHAT_HIDDEN
)
const (
LEFT_HAND = iota
RIGHT_HAND
)
const (
FAVICON_NOTFOUND = iota
FAVICON_INVALID_FORMAT
FAVICON_INVALID_DIMENSIONS
)
const (
PLUGINCODE_INFO = iota
PLUGINCODE_LOG
)
type Events struct {
_Events map[string][]func(...interface{})
}
type ClientData struct {
Locale packet.String
ViewDistance packet.Byte
ChatMode packet.VarInt
ChatColors packet.Boolean
DisplayedSkinParts packet.UnsignedByte
MainHand packet.VarInt
EnableTextFiltering packet.Boolean
AllowServerListings packet.Boolean
Brand packet.String
}
type PlayersC struct {
*sync.Mutex
Players map[string]*Player
PlayerNames map[string]string
PlayerIDs []string
Whitelist []PlayerBase
OPs []PlayerBase
BannedPlayers []PlayerBase
BannedIPs []string
}
type Server struct {
Commands map[string]Command
Players PlayersC
Events Events
Config *Config
Logger *logger.Logger
Playerlist Playerlist
StartTime int64
Favicon []byte
Level save.Level
Listener *net.Listener
EntityCounter int
TeleportCounter int
Mojang MojangAPI
Worlds map[string]World
}
type Node struct {
Parent int
Children []int
Data interface{}
EntryIndex int
}
type CommandGraph struct {
PlayerID string
}
type Parser struct {
ID int
Name string
Properties packet.FieldEncoder
}
type Argument struct {
Name string
Redirect int
RequiredPermissions []string
SuggestionsType string
Parser Parser
Optional bool
}
type Command struct {
Name string
Redirect int
RequiredPermissions []string
Arguments []Argument
Aliases []string
}
type UUID struct {
String string
Binary packet.UUID
}
type LoadedChunk struct {
sync.Mutex
Viewers []string
*level.Chunk
}