Class PacketContext
java.lang.Object
my.celium.org.network.PacketContext
Context for a received packet. Handlers always run on the game thread:
the loader wiring schedules them there - so handlers may touch game state.
-
Constructor Summary
ConstructorsConstructorDescriptionPacketContext(PacketDirection direction, net.minecraft.server.MinecraftServer server, net.minecraft.server.level.ServerPlayer sender) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.server.level.ServerPlayersender()The player who sent aPacketDirection.TO_SERVERpacket, ornullforPacketDirection.TO_CLIENTpackets.net.minecraft.server.MinecraftServerserver()The server, ornullon the client.
-
Constructor Details
-
PacketContext
public PacketContext(PacketDirection direction, net.minecraft.server.MinecraftServer server, net.minecraft.server.level.ServerPlayer sender)
-
-
Method Details
-
direction
-
server
public net.minecraft.server.MinecraftServer server()The server, ornullon the client. -
sender
public net.minecraft.server.level.ServerPlayer sender()The player who sent aPacketDirection.TO_SERVERpacket, ornullforPacketDirection.TO_CLIENTpackets.
-