Documentation
¶
Index ¶
Constants ¶
View Source
const ( ChunkWidth = 16 ChunkHeight = 256 SectionWidth = ChunkWidth SectionHeight = 16 ChunkSections = ChunkHeight / SectionHeight SectionVolume = SectionWidth * SectionHeight * SectionWidth MinBitsPerBlock = 4 MaxBitsPerBlock = 8 GlobalBitsPerBlock = 14 )
Variables ¶
View Source
var ( OnPacketReadEvent = "onPacketRead" OnPacketWriteEvent = "onPacketWrite" )
View Source
var ( ErrServerRunning = errors.New("server already running") ErrServerStopped = errors.New("server already stopped") )
Functions ¶
This section is empty.
Types ¶
type Chunk ¶
type Chunk interface { GetX() int GetZ() int GetSection(y int) ChunkSection GetSections() [ChunkSections]ChunkSection SetBlock(x, y, z int, block string) GetBlock(x, y, z int) string }
type ChunkSection ¶
type ChunkSection interface { IsEmpty() bool GetPalette() SectionPalette SetBlock(x, y, z int, block string) GetBlock(x, y, z int) string GetBlocks() bytes.PackedArray }
type CompressionConf ¶
type Config ¶
type Config struct { Host string Port int World WorldConf Compression CompressionConf }
type Connection ¶
type Connection interface { RemoteAddr() net.Addr GetServer() Server SetUniqueID(uniqueID uuid.UUID) GetUniqueID() uuid.UUID SetUsername(username string) GetUsername() string SetProtocol(protocol protocol.Protocol) GetProtocol() protocol.Protocol SetState(state protocol.State) GetState() protocol.State UseCompression() bool GetCompressionThreshold() int SetCompressionLevel(level int) GetCompressionLevel() int Close() error DelayedClose(delay time.Duration) error ReadPacket() error WritePacket(packet protocol.Packet) error // contains filtered or unexported methods }
type PacketEvent ¶
type PacketEvent interface { GetConnection() Connection GetPlayer() Player GetPacket() protocol.Packet SetCancelled(cancelled bool) IsCancelled() bool }
func NewPacketEvent ¶
func NewPacketEvent(connection Connection, player Player, packet protocol.Packet) PacketEvent
type Player ¶
type Player interface { GetServer() Server GetUniqueID() uuid.UUID GetUsername() string GetProtocol() protocol.Protocol GetState() protocol.State GetLatency() time.Duration IsKeepAlivePending() bool GetLastKeepAliveTime() time.Time GetLastKeepAliveID() int32 SendPacket(packet protocol.Packet) error Kick(reason []chat.Component) error // contains filtered or unexported methods }
type SectionPalette ¶
type Server ¶
type Server interface { Start() error Stop() error GetConfig() Config GetWorld() World GetPlayerCount() int GetPlayers() []Player GetPlayer(uniqueID uuid.UUID) Player ForEachPlayer(fn func(player Player) bool) FireEvent(event string, args ...interface{}) On(event string, fn interface{}, priority ...eventbus.Priority) error OnAsync(event string, fn interface{}) error // contains filtered or unexported methods }
Click to show internal directories.
Click to hide internal directories.