public class MultiConnectAPI
extends java.lang.Object
| Constructor and Description |
|---|
MultiConnectAPI() |
| Modifier and Type | Method and Description |
|---|---|
void |
addIdentifierCustomPayloadListener(IIdentifierCustomPayloadListener listener)
Adds an
IIdentifierCustomPayloadListener. |
void |
addStringCustomPayloadListener(IStringCustomPayloadListener listener)
Adds an
IStringCustomPayloadListener. |
IProtocol |
byProtocolVersion(int version)
Gets a supported
IProtocol object by its protocol version, or null if the protocol is not supported |
int |
getProtocolVersion()
Gets the protocol version of the server currently connected to,
or the current game version if not connected to a server
|
java.util.List<IProtocol> |
getSupportedProtocols()
Returns a list of supported protocols, from newest to oldest
|
static MultiConnectAPI |
instance()
Returns the singleton instance of this API
|
void |
removeIdentifierCustomPayloadListener(IIdentifierCustomPayloadListener listener)
Removes an
IIdentifierCustomPayloadListener. |
void |
removeStringCustomPayloadListener(IStringCustomPayloadListener listener)
Removes an
IStringCustomPayloadListener. |
public static MultiConnectAPI instance()
public int getProtocolVersion()
public IProtocol byProtocolVersion(int version)
IProtocol object by its protocol version, or null if the protocol is not supportedpublic java.util.List<IProtocol> getSupportedProtocols()
public void addIdentifierCustomPayloadListener(IIdentifierCustomPayloadListener listener)
IIdentifierCustomPayloadListener. Adding one of these listeners allows for mods to listen to
non-vanilla CustomPayloadS2CPackets sent
by servers on older versions. Such packets are blocked by multiconnect from normal handling.
This listener is not called for custom payloads from servers on the current version, as multiconnect does not
block those. This listener is only called for servers on 1.13 and above; use
addStringCustomPayloadListener(IStringCustomPayloadListener) if you want to listen to custom payloads
from older servers.
public void removeIdentifierCustomPayloadListener(IIdentifierCustomPayloadListener listener)
IIdentifierCustomPayloadListener.public void addStringCustomPayloadListener(IStringCustomPayloadListener listener)
IStringCustomPayloadListener. Adding one of these listeners allows for mods to listen to
non-vanilla CustomPayloadS2CPackets sent
by servers on 1.12.2 or below. Such packets are blocked by multiconnect from normal handling.
This listener is not called for custom payloads from servers on 1.13 or above. To listen for these custom
payloads, use addIdentifierCustomPayloadListener(IIdentifierCustomPayloadListener), or if the server is
on the current Minecraft version, simply do it the normal way.
public void removeStringCustomPayloadListener(IStringCustomPayloadListener listener)
IStringCustomPayloadListener.