Interface ViaFabricPlusAPI


public interface ViaFabricPlusAPI
General API point for mods. Get an instance via ViaFabricPlus.api().
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    addChangeProtocolVersionListener(BiConsumer<com.viaversion.viaversion.api.protocol.version.ProtocolVersion, com.viaversion.viaversion.api.protocol.version.ProtocolVersion> listener)
     
    default int
    Returns an internally based API version incremented with meaningful API changes.
    Protocol translation conversions.
    The implementation version of the mod formatted as "git-ViaFabricPlus-version():{commit hash}".
    Version-dependent limitations.
    org.apache.logging.log4j.Logger
    The logger of the mod.
    The root path inside the config folder where configuration files are stored.
    The protocol translation instance.
    Screen handling.
    default void
    setTargetVersion(com.viaversion.viaversion.api.protocol.version.ProtocolVersion targetVersion)
     
    The settings of the mod.
    default com.viaversion.viaversion.api.protocol.version.ProtocolVersion
     
    default com.viaversion.viaversion.api.connection.UserConnection
     
    The version of the mod displayed in ModMenu and other places (e.g., 5.0.0)
  • Method Details

    • apiVersion

      default int apiVersion()
      Returns an internally based API version incremented with meaningful API changes. This includes breaking changes to the existing API and larger additions.
      Returns:
      API version incremented with meaningful API changes
    • version

      String version()
      The version of the mod displayed in ModMenu and other places (e.g., 5.0.0)
      Returns:
      the version of the mod
    • implVersion

      String implVersion()
      The implementation version of the mod formatted as "git-ViaFabricPlus-version():{commit hash}".
      Returns:
      the implementation version of the mod
    • path

      Path path()
      The root path inside the config folder where configuration files are stored.
      Returns:
      The root path of the mod
    • logger

      org.apache.logging.log4j.Logger logger()
      The logger of the mod.
      Returns:
      The logger of the mod
    • settings

      Settings settings()
      The settings of the mod. Allows accessing and registering settings.
      Returns:
      The settings of the mod
    • protocolTranslation

      ProtocolTranslation protocolTranslation()
      The protocol translation instance. Manages the injection of new connections and the translation of packets.
      Returns:
      The protocol translation instance
    • targetVersion

      default com.viaversion.viaversion.api.protocol.version.ProtocolVersion targetVersion()
      See Also:
    • setTargetVersion

      default void setTargetVersion(com.viaversion.viaversion.api.protocol.version.ProtocolVersion targetVersion)
      See Also:
    • addChangeProtocolVersionListener

      default void addChangeProtocolVersionListener(BiConsumer<com.viaversion.viaversion.api.protocol.version.ProtocolVersion, com.viaversion.viaversion.api.protocol.version.ProtocolVersion> listener)
      See Also:
    • userConnection

      default com.viaversion.viaversion.api.connection.UserConnection userConnection()
      See Also:
    • conversions

      Conversions conversions()
      Protocol translation conversions. Can be used to convert Items and other data types between versions and Minecraftinvalid input: '<'->ViaVersion formats.
      Returns:
      Protocol translation conversions
    • limitations

      Limitations limitations()
      Version-dependent limitations. Can be used to check if a certain feature is supported by the current version.
      Returns:
      Version-dependent limitations
    • screens

      Screens screens()
      Screen handling. Allows accessing ViaFabricPlus screens.
      Returns:
      Screen handling