Package net.minecraftforge.network
Class Channel<MSG>
java.lang.Object
net.minecraftforge.network.Channel<MSG>
- Direct Known Subclasses:
EventNetworkChannel
,SimpleChannel
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetName()
int
boolean
isRemotePresent
(Connection connection) Returns true if the channel is present in the given connection.void
reply
(MSG msg, CustomPayloadEvent.Context context) void
send
(MSG msg, Connection connection) void
send
(MSG msg, PacketDistributor.PacketTarget target) Send a message to thePacketDistributor.PacketTarget
from aPacketDistributor
instance.protected abstract FriendlyByteBuf
(package private) Packet<?>
toVanillaPacket
(Connection connection, MSG message)
-
Field Details
-
instance
-
-
Constructor Details
-
Channel
-
-
Method Details
-
getName
-
getProtocolVersion
public int getProtocolVersion() -
isRemotePresent
Returns true if the channel is present in the given connection. -
toBuffer
-
toVanillaPacket
-
send
-
send
Send a message to thePacketDistributor.PacketTarget
from aPacketDistributor
instance.channel.send(message, PacketDistributor.PLAYER.with(()->player))
- Type Parameters:
MSG
- The type of the message- Parameters:
target
- The curried target from a PacketDistributormessage
- The message to send
-
reply
-