Documentation ¶
Overview ¶
Netherrack is a minecraft server framework for Go (http://golang.org).
This is still a work in progress and there is still a lot of features that are currently missing. The api for this will mostly likely change a lot whilst i'm developing this and minecraft changes.
Index ¶
- Constants
- type Ping
- type PingPlayer
- type PingPlayers
- type PingVersion
- type Server
- func (server *Server) Addr() net.Addr
- func (server *Server) DefaultWorld() *world.World
- func (server *Server) LoadWorld(name string, system world.System, gen world.Generator, ...) *world.World
- func (server *Server) QueuePacket(packet protocol.Packet)
- func (server *Server) SendMessage(msg *message.Message)
- func (server *Server) SetAuthenticator(auth protocol.Authenticator)
- func (server *Server) SetDefaultWorld(def string)
- func (server *Server) SetPing(ping Ping)
- func (server *Server) Start(address string) error
- func (server *Server) World(name string) *world.World
- type ServerHandler
Constants ¶
const ( //The currently supported protocol verison ProtocolVersion = protocol.Version //The currently supported Minecraft version MinecraftVersion = "1.7.2" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ping ¶
type Ping struct { Version PingVersion `json:"version"` Players PingPlayers `json:"players"` Description message.Message `json:"description"` Favicon string `json:"favicon,omitempty"` }
Ping is json encoded before being sent to the the client. Version and Players.Online will automaticly be replaced with the correct details
type PingPlayer ¶
PingPlayer is a player to be displayed on the sample player list in the minecraft client
type PingPlayers ¶
type PingPlayers struct { Max int `json:"max"` Online int `json:"online"` Sample []PingPlayer `json:"sample,omitempty"` }
PingPlayers contains the number of currently online players and the max number of players. It can optionally contain a sample list of players. Online will automatically be replaced with the number of online players
type PingVersion ¶
PingVersion is the version section of minecraft's server list ping
type Server ¶
type Server struct { Handler ServerHandler // contains filtered or unexported fields }
Server is the contains loaded worlds and handles network connections from players. The Handler must be set before use
func NewServer ¶
func NewServer() *Server
NewServer creates a server which has its internals setup. This must be used to create a Server
func (*Server) DefaultWorld ¶
DefaultWorld returns the default world for the server
func (*Server) LoadWorld ¶
func (server *Server) LoadWorld(name string, system world.System, gen world.Generator, dimension world.Dimension) *world.World
LoadWorld gets the world by name. If the world isn't loaded but it exists then it is loaded. If it doesn't exist then it is created using the passed system.
func (*Server) QueuePacket ¶
QueuePacket queues the packet to be send to every player on the server
func (*Server) SendMessage ¶
SendMessage sends the message to every player on the server
func (*Server) SetAuthenticator ¶
func (server *Server) SetAuthenticator(auth protocol.Authenticator)
SetAuthenticator changes the authenticator usered by the server. This panics if the server is started.
func (*Server) SetDefaultWorld ¶
SetDefaultWorld sets the default world for the server. This panics if the server is started.
Directories ¶
Path | Synopsis |
---|---|
Package blocks contains basic infomation on minecraft blocks
|
Package blocks contains basic infomation on minecraft blocks |
Package command provides methods to execute commands from strings Copyright 2013 Matthew Collins (purggames@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
Package command provides methods to execute commands from strings Copyright 2013 Matthew Collins (purggames@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. |
format
|
|
flat
Package flat is designed to replicate vanilla's superflat worlds.
|
Package flat is designed to replicate vanilla's superflat worlds. |