Package alexiil.mc.lib.net
Class NetKeyMapper<T>
java.lang.Object
alexiil.mc.lib.net.NetKeyMapper<T>
- Direct Known Subclasses:
NetKeyMapper.OfEnum,NetKeyMapper.ToString
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNetKeyMapper.OfEnum<E extends Enum<E>>static class -
Field Summary
FieldsModifier and TypeFieldDescriptionfinal intThe known length in bytes of this key, orLENGTH_DYNAMICif this isn't a constant.static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Tread(NetByteBuf buffer, IMsgReadCtx ctx) Reads the value for the key from the buffer, optionally using the parent keys.abstract voidwrite(NetByteBuf buffer, IMsgWriteCtx ctx, T value)
-
Field Details
-
LENGTH_DYNAMIC
public static final int LENGTH_DYNAMIC- See Also:
-
clazz
-
length
public final int lengthThe known length in bytes of this key, orLENGTH_DYNAMICif this isn't a constant.
-
-
Constructor Details
-
NetKeyMapper
-
NetKeyMapper
-
-
Method Details
-
read
Reads the value for the key from the buffer, optionally using the parent keys.Note that any of the parent keys might be null if they failed to read!
- Returns:
- null if the key couldn't be found in whatever context this requires.
- Throws:
InvalidInputDataException
-
write
-