Interface Server

All Superinterfaces:
Audience, ForwardingAudience, Pointered

public interface Server extends ForwardingAudience
The running Fidorial server, entry point to every subsystem a plugin can reach.

A plugin obtains it through PluginContext.server(). Subsystems are grouped by domain: players(), worlds(), registries(), listing()... As a ForwardingAudience, the server forwards anything sent to it to every online player.

Since:
0.1.0
  • Method Details

    • brandName

      @Contract(pure=true) String brandName()
      Gets the server brand name.
      Returns:
      server brand name
      Since:
      0.1.0
    • buildSpecification

      @Contract(pure=true) BuildSpecification buildSpecification()
      Gets the build of this server: Minecraft and protocol versions, API version and build number.
      Returns:
      the build specification
      Since:
      0.1.0
    • isRunning

      boolean isRunning()
      Checks whether the server is running.
      Returns:
      true until shutdown() has been requested
      Since:
      0.1.0
    • shutdown

      void shutdown()
      Stops the server: fires ServerStoppingEvent, kicks every player, disables the plugins and saves the worlds.

      Calling it again once the shutdown has started does nothing.

      Since:
      0.1.0
    • listing

      @Contract(pure=true) ServerListing listing()
      Gets how the server shows up in the multiplayer server list (description, favicon, maximum player count).
      Returns:
      the server listing
      Since:
      0.1.0
    • players

      @Contract(pure=true) PlayerManager players()
      Gets the players: who is online, every known identity, bans and whitelist.
      Returns:
      the players of the server
      Since:
      0.1.0
    • worlds

      @Contract(pure=true) WorldManager worlds()
      Gets the worlds: loading, creating and unloading them, base game rules and structures.
      Returns:
      the worlds of the server
      Since:
      0.1.0
    • maps

      @Contract(pure=true) MapManager maps()
      Gets the maps: the pictures behind filled_map items, terrain maps and canvases for plugins to draw on.
      Returns:
      the maps of the server
      Since:
      0.1.0
    • registries

      @Contract(pure=true) GameRegistries registries()
      Gets the registries plugins can extend: biomes, dimension types, chat types, dialogs, mobs, effects, items and permissions.
      Returns:
      the registries of the server
      Since:
      0.1.0
    • scheduler

      Gets the scheduler running tasks on the region threads.
      Returns:
      the regionized scheduler
      Since:
      0.1.0
    • events

      @Contract(pure=true) EventBus events()
      Gets the server-wide event bus.

      Plugins should prefer PluginContext.events(), whose subscriptions are released automatically when the plugin is disabled.

      Returns:
      the event bus
      Since:
      0.1.0
    • services

      @Contract(pure=true) ServiceRegistry services()
      Gets the registry of services, through which plugins replace the default server behaviour.
      Returns:
      the service registry
      Since:
      0.1.0
    • plugins

      @Contract(pure=true) PluginManager plugins()
      Gets the plugin loader.
      Returns:
      the plugin manager
      Since:
      0.1.0
    • commands

      @Contract(pure=true) CommandRegistry commands()
      Gets the registry of Brigadier commands.
      Returns:
      the command registry
      Since:
      0.1.0
    • translationSource

      @Contract(pure=true) Translator translationSource()
      Gets the source of the server's own translations, registered to the GlobalTranslator.

      In order to remove the server's translations, remove this source from the aforementioned global translator.

      Returns:
      the server's translation source
      Since:
      0.1.0