Class ParentNetId


public final class ParentNetId
extends ParentNetIdBase
A parent node that doesn't write any header information for it's children: the static context (given by the IMsgReadCtx or IMsgWriteCtx) should be enough.
  • Constructor Details

    • ParentNetId

      public ParentNetId​(@Nullable ParentNetId parent, java.lang.String name)
      parent - The parent. If this is null then this is a root node, and therefore is managed separately. (In all other cases you probably want to call child(String) instead of using this).
  • Method Details

    • idData

      public NetIdData idData​(java.lang.String name)
      Returns a new NetIdData (with this as it's parent) that can write an arbitrary length of data.
    • idData

      public NetIdData idData​(java.lang.String name, int dataLength)
      Returns a new NetIdData (with this as it's parent) that must write exactly the given "length" bytes of data.
      dataLength - The exact number of bytes that must be written out. (This is so that the exact length isn't written out each time as it's known in advance). There's generally no reason to use this unless this is for a very small (and frequently sent) packet, as otherwise the space gained will be negligible.
    • idSignal

      public NetIdSignal idSignal​(java.lang.String name)
      Returns a new NetIdSignal (with this as it's parent) that won't write any data out: instead the mere presence of this packet should convey all of the information required.
    • child

      public ParentNetId child​(java.lang.String childName)
      Returns a new ParentNetId with this as it's child. This is mostly useful for organising different packets or mods from the root node.