Class TreeNetIdBase

java.lang.Object
alexiil.mc.lib.net.TreeNetIdBase
Direct Known Subclasses:
NetIdBase, ParentNetIdBase

public abstract class TreeNetIdBase extends Object
The base class for all networking ID's. Most of the time you should use one of the subclasses: either the parent node ParentNetIdBase, or the leaf node NetIdBase.
  • Field Details

    • DYNAMIC_LENGTH

      public static final int DYNAMIC_LENGTH
      See Also:
      Constant Field Values
    • name

      public final String name
      The name - must be unique to the parent that uses it, so for top level mod packets this MUST include the modid.
    • fullName

      public final String fullName
      Used for logging and display purposes only.
    • length

      public final int length
      The length of this ID alone. Might not be a sensible number even if totalLength is.
    • totalLength

      public final int totalLength
      Full length including all parents.
    • parent

      public final ParentNetIdBase parent
  • Constructor Details

  • Method Details

    • toString

      public final String toString()
      Overrides:
      toString in class Object
    • getPrintableName

      protected String getPrintableName()
    • getRealClassName

      protected final String getRealClassName()
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • hasFixedLength

      public final boolean hasFixedLength()
      Returns:
      True if the total length of this NetId (the entire path, including it's header) is a fixed length (and so the length doesn't need to be written out each time it is sent), or false otherwise.