Interface ViaFabricPlusAPI
public interface ViaFabricPlusAPI
General API point for mods. Get an instance via
ViaFabricPlus.api().-
Method Summary
Modifier and TypeMethodDescriptiondefault voidaddChangeProtocolVersionListener(BiConsumer<com.viaversion.viaversion.api.protocol.version.ProtocolVersion, com.viaversion.viaversion.api.protocol.version.ProtocolVersion> listener) default intReturns 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.Loggerlogger()The logger of the mod.path()The root path inside the config folder where configuration files are stored.The protocol translation instance.screens()Screen handling.default voidsetTargetVersion(com.viaversion.viaversion.api.protocol.version.ProtocolVersion targetVersion) settings()The settings of the mod.default com.viaversion.viaversion.api.protocol.version.ProtocolVersiondefault com.viaversion.viaversion.api.connection.UserConnectionversion()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
-
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
-