Class MinecraftChannelIdentifier

  • All Implemented Interfaces:
    ChannelIdentifier

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

      • forDefaultNamespace

        public static MinecraftChannelIdentifier forDefaultNamespace​(java.lang.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​(java.lang.String namespace,
                                                        java.lang.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​(java.lang.String identifier)
        Creates an channel identifier from the specified Minecraft identifier.
        Parameters:
        identifier - the Minecraft identifier
        Returns:
        a new channel identifier
      • getNamespace

        public java.lang.String getNamespace()
      • getName

        public java.lang.String getName()
      • toString

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

        public boolean equals​(@Nullable java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

        public java.lang.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