Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Minecraft ¶
type Minecraft struct { WorldManager *world.WorldManager Events *event.EventManager // contains filtered or unexported fields }
This is the main minecraft type. Create one of these, and use it to start the server itself
func New ¶
Constructor for Minecraft type. Set needs-session to true if it should create an AWS session. The max players of the server is used when a proxy or lobby server sends a ReservePlayersRequest. If needs_reserve is set to true, it will deny all players sent to this server that have not been 'reserved'. If needs_reserve is set to false, then it will accept all incoming connections. Basically, if needs_reserve is true, then this is a server that is part of a network. If a player wants to join, they will need to be connected from another server. If it is false, then players can connect directly to this server. The default_world is a string name to the default world. This is where players are sent when they first connect.
func (*Minecraft) AwsSession ¶
Gets the current aws session. Returns nil if false was passed into the constructor for the needs-session value.
func (*Minecraft) FinalizeBlocks ¶
func (m *Minecraft) FinalizeBlocks()
This finalizes all blocks, and allows items to be registered.
func (*Minecraft) FinishLoad ¶
func (m *Minecraft) FinishLoad()
This is the last stage of loading. It will finalize items, and load worlds from disk.
func (*Minecraft) Init ¶
func (m *Minecraft) Init()
This loads all basic event types and vanilla blocks. You must call this before registering anything.
func (*Minecraft) MaxPlayers ¶
This returns the maximum number of players allowed to connect at any time.
func (*Minecraft) On ¶
Use this to register events. The string name of the event should be one from the README. The event itself can take any number of parameters, and return either a bool or nothing. If it returns a bool, then it is treated as an "is_cancelled" flag. The arguments must match the ones listed in the README, otherwise you will get errors when the event is called. This will cause the server to panic, but that is for testing, and will be disabled soon.
func (*Minecraft) StartUpdateLoop ¶
This is a blocking call, which starts the grpc server. The port should look like this:
:8483
type Plugin ¶
type Plugin interface { OnEnable(minecraft *Minecraft) OnDisable() }
This is never used. This will be removed in the near future. This was setup to be like Spigot's plugin system, but in golang, all plugins are statically linked. So it created these massive plugin files, that just made the server huge. Also the core server does nothing, so I thought there was no point in having it load plugins. Since the core server cannot do much, I though it would be best that people write their own main() funcitons, instead of using the server's main.
type PluginManager ¶
type PluginManager struct {
// contains filtered or unexported fields
}
func NewPluginManager ¶
func NewPluginManager(minecraft *Minecraft) *PluginManager
func (*PluginManager) DisablePlugins ¶
func (m *PluginManager) DisablePlugins()
func (*PluginManager) EnablePlugins ¶
func (m *PluginManager) EnablePlugins()
func (*PluginManager) LoadPlugins ¶
func (m *PluginManager) LoadPlugins()