Class IndexedMessageCodec
java.lang.Object
net.minecraftforge.fml.network.simple.IndexedMessageCodec
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.shorts.Short2ObjectArrayMap<IndexedMessageCodec.MessageHandler<?>>
private static final org.apache.logging.log4j.Logger
private final NetworkInstance
private static final org.apache.logging.log4j.Marker
private final it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap<Class<?>,
IndexedMessageCodec.MessageHandler<?>> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) <MSG> IndexedMessageCodec.MessageHandler<MSG>
addCodecIndex
(int index, Class<MSG> messageType, BiConsumer<MSG, PacketBuffer> encoder, Function<PacketBuffer, MSG> decoder, BiConsumer<MSG, Supplier<NetworkEvent.Context>> messageConsumer, Optional<NetworkDirection> networkDirection) <MSG> int
build
(MSG message, PacketBuffer target) (package private) void
consume
(PacketBuffer payload, int payloadIndex, Supplier<NetworkEvent.Context> context) (package private) <MSG> IndexedMessageCodec.MessageHandler<MSG>
findIndex
(short i) <MSG> IndexedMessageCodec.MessageHandler<MSG>
findMessageType
(MSG msgToReply) private static <M> void
tryDecode
(PacketBuffer payload, Supplier<NetworkEvent.Context> context, int payloadIndex, IndexedMessageCodec.MessageHandler<M> codec) private static <M> int
tryEncode
(PacketBuffer target, M message, IndexedMessageCodec.MessageHandler<M> codec)
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
SIMPLENET
private static final org.apache.logging.log4j.Marker SIMPLENET -
indicies
private final it.unimi.dsi.fastutil.shorts.Short2ObjectArrayMap<IndexedMessageCodec.MessageHandler<?>> indicies -
types
private final it.unimi.dsi.fastutil.objects.Object2ObjectArrayMap<Class<?>,IndexedMessageCodec.MessageHandler<?>> types -
networkInstance
-
-
Constructor Details
-
IndexedMessageCodec
public IndexedMessageCodec() -
IndexedMessageCodec
-
-
Method Details
-
findMessageType
-
findIndex
-
tryDecode
private static <M> void tryDecode(PacketBuffer payload, Supplier<NetworkEvent.Context> context, int payloadIndex, IndexedMessageCodec.MessageHandler<M> codec) -
tryEncode
private static <M> int tryEncode(PacketBuffer target, M message, IndexedMessageCodec.MessageHandler<M> codec) -
build
-
consume
-
addCodecIndex
<MSG> IndexedMessageCodec.MessageHandler<MSG> addCodecIndex(int index, Class<MSG> messageType, BiConsumer<MSG, PacketBuffer> encoder, Function<PacketBuffer, MSG> decoder, BiConsumer<MSG, Supplier<NetworkEvent.Context>> messageConsumer, Optional<NetworkDirection> networkDirection)
-