Package net.minecraftforge.network
Class PayloadChannel
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static final class
private static final record
PayloadChannel.Message<MSG extends CustomPacketPayload,
BUF extends FriendlyByteBuf> Nested classes/interfaces inherited from class net.minecraftforge.network.Channel
Channel.VersionTest
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final org.apache.logging.log4j.Logger
private static final org.apache.logging.log4j.Marker
private final Map
<ResourceLocation, PayloadChannel.Message<?, ?>> -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription(package private) static PayloadConnection
<CustomPacketPayload> builder
(NetworkInstance instance) void
encode
(FriendlyByteBuf out, CustomPacketPayload message) private void
get
(ResourceLocation type, boolean send) (package private) ResourceLocation
getName
(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 void
protected 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:
toVanillaPacket
in classChannel<CustomPacketPayload>
-
getName
Description copied from class:Channel
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. If your channel haschildren
- Overrides:
getName
in classChannel<CustomPacketPayload>
-
encode
- Specified by:
encode
in classChannel<CustomPacketPayload>
-