Package net.minecraftforge.network
Class PayloadChannel
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate static final recordPayloadChannel.Message<MSG extends CustomPacketPayload,BUF extends FriendlyByteBuf> Nested classes/interfaces inherited from class net.minecraftforge.network.Channel
Channel.VersionTest -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.apache.logging.log4j.Loggerprivate static final org.apache.logging.log4j.Markerprivate final Map<ResourceLocation, PayloadChannel.Message<?, ?>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static PayloadConnection<CustomPacketPayload> builder(NetworkInstance instance) voidencode(FriendlyByteBuf out, CustomPacketPayload message) private voidget(ResourceLocation type, boolean send) (package private) ResourceLocationgetName(CustomPacketPayload packet) Retrieves the channel name to use for the specified packet This typically is the main channel's name, but in some cases you want to specify a custom one.private voidprotected Packet<?> toVanillaPacket(Connection con, CustomPacketPayload message) Methods inherited from class net.minecraftforge.network.Channel
getName, getProtocolVersion, isRemotePresent, reply, send, send, validate
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
MARKER
private static final org.apache.logging.log4j.Marker MARKER -
payloads
-
-
Constructor Details
-
PayloadChannel
-
-
Method Details
-
builder
-
get
private PayloadChannel.Message<CustomPacketPayload,FriendlyByteBuf> get(ResourceLocation type, boolean send) -
error
-
onPacketReceived
-
toVanillaPacket
- Overrides:
toVanillaPacketin classChannel<CustomPacketPayload>
-
getName
Description copied from class:ChannelRetrieves the channel name to use for the specified packet This typically is the main channel's name, but in some cases you want to specify a custom one. If your channel haschildren- Overrides:
getNamein classChannel<CustomPacketPayload>
-
encode
- Specified by:
encodein classChannel<CustomPacketPayload>
-