Interface ViaPlatform<T>

  • Type Parameters:
    T - - The player type for the platform, used for API related methods

    public interface ViaPlatform<T>
    ViaPlatform represents a platform ViaVersion runs on
    • Method Detail

      • getLogger

        java.util.logging.Logger getLogger()
        Get the logger for this platform
        Returns:
        Java Logger (may be a wrapper)
      • getPlatformName

        java.lang.String getPlatformName()
        Get the platform name
        Returns:
        Platform Name (simply its name)
      • getPlatformVersion

        java.lang.String getPlatformVersion()
        Get the platform version
        Returns:
        Platform version
      • isProxy

        default boolean isProxy()
        Returns true if the server Via is running on is a proxy server.
        Returns:
        true if the platform is a proxy
      • getPluginVersion

        java.lang.String getPluginVersion()
        Get the plugin version
        Returns:
        Plugin version as a semver string
      • runAsync

        PlatformTask runAsync​(java.lang.Runnable runnable)
        Run a task Async
        Parameters:
        runnable - The task to run
        Returns:
        The Task ID
      • runSync

        PlatformTask runSync​(java.lang.Runnable runnable)
        Run a task Sync
        Parameters:
        runnable - The task to run
        Returns:
        The Task ID
      • runSync

        PlatformTask runSync​(java.lang.Runnable runnable,
                             long ticks)
        Run a task Sync after a interval This must be only used after plugin enable.
        Parameters:
        runnable - The task to run
        ticks - The interval to run it after
        Returns:
        The Task ID
      • runRepeatingSync

        PlatformTask runRepeatingSync​(java.lang.Runnable runnable,
                                      long ticks)
        Run a task at a repeating interval. Initial interval is the same as repeat.
        Parameters:
        runnable - The task to run
        ticks - The interval to run it at
        Returns:
        The Task ID
      • getOnlinePlayers

        ViaCommandSender[] getOnlinePlayers()
        Get the online players
        Returns:
        Array of ViaCommandSender
      • sendMessage

        void sendMessage​(java.util.UUID uuid,
                         java.lang.String message)
        Send a message to a player
        Parameters:
        uuid - The player's UUID
        message - The message to send
      • kickPlayer

        boolean kickPlayer​(java.util.UUID uuid,
                           java.lang.String message)
        Kick a player for a reason
        Parameters:
        uuid - The player's UUID
        message - The message to kick them with
        Returns:
        True if it was successful
      • disconnect

        default boolean disconnect​(UserConnection connection,
                                   java.lang.String message)
        Disconnects an UserConnection for a reason
        Parameters:
        connection - The UserConnection
        message - The message to kick them with
        Returns:
        True if it was successful
      • isPluginEnabled

        boolean isPluginEnabled()
        Check if the plugin is enabled.
        Returns:
        True if it is enabled
      • getApi

        ViaAPI<T> getApi()
        Get the API for this platform
        Returns:
        The API for the platform
      • getConf

        ViaVersionConfig getConf()
        Get the config API for this platform
        Returns:
        The config API
      • getConfigurationProvider

        ConfigurationProvider getConfigurationProvider()
        Get the backend configuration provider for this platform. (On some platforms this returns the same as getConf())
        Returns:
        The configuration provider
      • getDataFolder

        java.io.File getDataFolder()
        Get ViaVersions's data folder.
        Returns:
        data folder
      • onReload

        void onReload()
        Called when a reload happens
      • getDump

        com.google.gson.JsonObject getDump()
        Get the JSON data required for /viaversion dump
        Returns:
        The json data
      • isOldClientsAllowed

        boolean isOldClientsAllowed()
        Get if older clients are allowed to be used using ViaVersion. (Only 1.9 on 1.9.2 server is supported by ViaVersion alone)
        Returns:
        True if allowed
      • getUnsupportedSoftwareClasses

        default java.util.Collection<UnsupportedSoftware> getUnsupportedSoftwareClasses()
        Returns an immutable collection of classes to be checked as unsupported software with their software name. If any of the classes exist at runtime, a warning about their potential instability will be given to the console.
        Returns:
        immutable collection of unsupported software to be checked