Package net.minecraftforge.network
Class SimpleChannel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordstatic classNested classes/interfaces inherited from class net.minecraftforge.network.Channel
Channel.VersionTest -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate it.unimi.dsi.fastutil.ints.Int2ObjectMap<SimpleChannel.Message<?>>private it.unimi.dsi.fastutil.objects.Object2ObjectMap<Class<?>,SimpleChannel.Message<?>> private intprivate static final org.apache.logging.log4j.Loggerprivate static final org.apache.logging.log4j.Marker -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <MSG> voiddecodeAndDispatch(FriendlyByteBuf data, CustomPayloadEvent.Context ctx, SimpleChannel.Message<MSG> msg) <M> SimpleChannel.MessageBuilder<M>messageBuilder(Class<M> type) Build a new MessageBuilder, using the next available discriminator.<M> SimpleChannel.MessageBuilder<M>messageBuilder(Class<M> type, int discriminator) Build a new MessageBuilder.<M> SimpleChannel.MessageBuilder<M>messageBuilder(Class<M> type, int discriminator, NetworkDirection direction) Build a new MessageBuilder.<M> SimpleChannel.MessageBuilder<M>messageBuilder(Class<M> type, NetworkDirection direction) Build a new MessageBuilder, using the next available discriminator.private voidprivate intMethods inherited from class net.minecraftforge.network.Channel
getName, getProtocolVersion, isRemotePresent, reply, send, send, toVanillaPacket
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
MARKER
private static final org.apache.logging.log4j.Marker MARKER -
lastIndex
private int lastIndex -
byId
-
byType
-
-
Constructor Details
-
SimpleChannel
-
-
Method Details
-
messageBuilder
Build a new MessageBuilder, using the next available discriminator.- Type Parameters:
M- Type of type- Parameters:
type- Type of message
-
messageBuilder
Build a new MessageBuilder.- Type Parameters:
M- Type of type- Parameters:
type- Type of messagediscriminator- Manually configured discriminator, Must be a positive number.
-
messageBuilder
public <M> SimpleChannel.MessageBuilder<M> messageBuilder(Class<M> type, NetworkDirection direction) Build a new MessageBuilder, using the next available discriminator.- Type Parameters:
M- Type of type- Parameters:
type- Type of messagedirection- a impl direction which will be asserted before any processing of this message occurs. Use to enforce strict sided handling to prevent spoofing.
-
messageBuilder
public <M> SimpleChannel.MessageBuilder<M> messageBuilder(Class<M> type, int discriminator, NetworkDirection direction) Build a new MessageBuilder.- Type Parameters:
M- Type of type- Parameters:
type- Type of messagediscriminator- Manually configured discriminator, Must be a positive number.direction- a impl direction which will be asserted before any processing of this message occurs. Use to enforce strict sided handling to prevent spoofing.
-
nextIndex
private int nextIndex() -
networkEventListener
-
decodeAndDispatch
private static <MSG> void decodeAndDispatch(FriendlyByteBuf data, CustomPayloadEvent.Context ctx, SimpleChannel.Message<MSG> msg) -
toBuffer
-