Package alexiil.mc.lib.net
Class ParentNetId
java.lang.Object
alexiil.mc.lib.net.TreeNetIdBase
alexiil.mc.lib.net.ParentNetIdBase
alexiil.mc.lib.net.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.-
Field Summary
Fields inherited from class alexiil.mc.lib.net.TreeNetIdBase
DYNAMIC_LENGTH, fullName, length, name, parent, totalLength
-
Constructor Summary
Constructors Constructor Description ParentNetId(ParentNetId parent, java.lang.String name)
-
Method Summary
Modifier and Type Method Description ParentNetId
child(java.lang.String childName)
Returns a newParentNetId
with this as it's child.NetIdData
idData(java.lang.String name)
Returns a newNetIdData
(with this as it's parent) that can write an arbitrary length of data.NetIdData
idData(java.lang.String name, int dataLength)
Returns a newNetIdData
(with this as it's parent) that must write exactly the given "length" bytes of data.NetIdSignal
idSignal(java.lang.String name)
Returns a newNetIdSignal
(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.Methods inherited from class alexiil.mc.lib.net.TreeNetIdBase
equals, getPrintableName, getRealClassName, hasFixedLength, hashCode, toString
-
Constructor Details
-
ParentNetId
- Parameters:
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 callchild(String)
instead of using this).
-
-
Method Details
-
idData
Returns a newNetIdData
(with this as it's parent) that can write an arbitrary length of data. -
idData
Returns a newNetIdData
(with this as it's parent) that must write exactly the given "length" bytes of data.- Parameters:
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
Returns a newNetIdSignal
(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
Returns a newParentNetId
with this as it's child. This is mostly useful for organising different packets or mods from the root node.
-