Class MinecraftChannelIdentifier

java.lang.Object
com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier
All Implemented Interfaces:
ChannelIdentifier

public final class MinecraftChannelIdentifier extends Object implements ChannelIdentifier
Represents a Minecraft 1.13+ channel identifier. This class is immutable and safe for multi-threaded use.
  • Method Details

    • forDefaultNamespace

      public static MinecraftChannelIdentifier forDefaultNamespace(String name)
      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

      public static MinecraftChannelIdentifier create(String namespace, String name)
      Creates an identifier in the specified namespace.
      Parameters:
      namespace - the namespace to use
      name - the channel name inside the specified namespace
      Returns:
      a new channel identifier
    • from

      public static MinecraftChannelIdentifier from(String identifier)
      Creates an channel identifier from the specified Minecraft identifier.
      Parameters:
      identifier - the Minecraft identifier
      Returns:
      a new channel identifier
    • from

      public static MinecraftChannelIdentifier from(net.kyori.adventure.key.Key key)
      Creates an channel identifier from the specified Minecraft identifier.
      Parameters:
      key - the Minecraft key to use
      Returns:
      a new channel identifier
    • getNamespace

      public String getNamespace()
    • getName

      public String getName()
    • asKey

      public net.kyori.adventure.key.Key asKey()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      Description copied from interface: ChannelIdentifier
      Returns the textual representation of this identifier.
      Specified by:
      getId in interface ChannelIdentifier
      Returns:
      the textual representation of the identifier