Class MinecraftChannelIdentifier
java.lang.Object
com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier
- All Implemented Interfaces:
ChannelIdentifier
Represents a Minecraft 1.13+ channel identifier. This class is immutable and safe for
multi-threaded use.
-
Method Summary
Modifier and TypeMethodDescriptionasKey()Converts this channel identifier to aKeyobject.static MinecraftChannelIdentifierCreates an identifier in the specified namespace.booleanstatic MinecraftChannelIdentifierforDefaultNamespace(String name) Creates an identifier in the default namespace (minecraft).static MinecraftChannelIdentifierCreates an channel identifier from the specified Minecraft identifier.static MinecraftChannelIdentifierCreates an channel identifier from the specified Minecraft identifier.getId()Returns the textual representation of this identifier.getName()Returns the name of the channel within its namespace.Returns the namespace of this channel identifier.inthashCode()toString()
-
Method Details
-
forDefaultNamespace
Creates an identifier in the default namespace (minecraft). Plugins are strongly encouraged to provide their own namespace.- Parameters:
name- the name in the default namespace to use- Returns:
- a new channel identifier
-
create
Creates an identifier in the specified namespace.- Parameters:
namespace- the namespace to usename- the channel name inside the specified namespace- Returns:
- a new channel identifier
-
from
Creates an channel identifier from the specified Minecraft identifier.- Parameters:
identifier- the Minecraft identifier- Returns:
- a new channel identifier
-
from
Creates an channel identifier from the specified Minecraft identifier.- Parameters:
key- the Minecraft key to use- Returns:
- a new channel identifier
-
getNamespace
Returns the namespace of this channel identifier.- Returns:
- the namespace string (e.g.,
minecraft)
-
getName
Returns the name of the channel within its namespace.- Returns:
- the channel name string
-
asKey
Converts this channel identifier to aKeyobject.- Returns:
- a
Keyrepresenting this identifier
-
toString
-
equals
-
hashCode
public int hashCode() -
getId
Description copied from interface:ChannelIdentifierReturns the textual representation of this identifier.- Specified by:
getIdin interfaceChannelIdentifier- Returns:
- the textual representation of the identifier
-