Package alexiil.mc.lib.net.impl
Class ActiveServerConnection
java.lang.Object
alexiil.mc.lib.net.ActiveConnection
alexiil.mc.lib.net.BufferedConnection
alexiil.mc.lib.net.impl.ActiveMinecraftConnection
alexiil.mc.lib.net.impl.ActiveServerConnection
A connection on the server side to a specific
ServerPlayerEntity.-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal net.minecraft.server.network.ServerPlayNetworkHandlerFields inherited from class alexiil.mc.lib.net.impl.ActiveMinecraftConnection
PACKET_IDFields inherited from class alexiil.mc.lib.net.BufferedConnection
ENABLE_QUEUE -
Constructor Summary
ConstructorsConstructorDescriptionActiveServerConnection(net.minecraft.server.network.ServerPlayNetworkHandler netHandler) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.entity.player.PlayerEntitylongprotected voidsendPacket(net.minecraft.network.Packet<?> packet) protected voidOptional method for subclasses to send additional packet before the queue is flushed.protected net.minecraft.network.Packet<?>toCompactPacket(int receiverId, NetByteBuf data) protected net.minecraft.network.Packet<?>toNormalPacket(NetByteBuf data) toString()Methods inherited from class alexiil.mc.lib.net.impl.ActiveMinecraftConnection
sendRawData0, tickMethods inherited from class alexiil.mc.lib.net.BufferedConnection
hasPackets, maximumPacketSize, onReceiveRawData, sendPacket, setMaxBandwidthMethods inherited from class alexiil.mc.lib.net.ActiveConnection
allocBuffer, allocBuffer, isDebuggingConnection, postConstruct
-
Field Details
-
netHandler
public final net.minecraft.server.network.ServerPlayNetworkHandler netHandler
-
-
Constructor Details
-
ActiveServerConnection
public ActiveServerConnection(net.minecraft.server.network.ServerPlayNetworkHandler netHandler)
-
-
Method Details
-
toNormalPacket
- Specified by:
toNormalPacketin classActiveMinecraftConnection
-
toCompactPacket
- Specified by:
toCompactPacketin classActiveMinecraftConnection
-
sendPacket
protected void sendPacket(net.minecraft.network.Packet<?> packet) - Specified by:
sendPacketin classActiveMinecraftConnection
-
getPlayer
public net.minecraft.entity.player.PlayerEntity getPlayer()- Specified by:
getPlayerin classActiveMinecraftConnection- Returns:
- The Minecraft
PlayerEntityfor this connection. Throws an error if this is not aActiveMinecraftConnection.
-
getNetSide
- Specified by:
getNetSidein classActiveMinecraftConnection- Returns:
- The "side" of this connection. This will be
EnumNetSide.CLIENTboth when writing client to server packets, and when reading packets sent from the server. (AndEnumNetSide.SERVERboth when writing server to client packets, and when reading client to server packets).
-
toString
-
getServerTick
public long getServerTick()- Returns:
- The value that the client will use to identify the current server tick.
-
sendTickPacket
protected void sendTickPacket()Description copied from class:BufferedConnectionOptional method for subclasses to send additional packet before the queue is flushed.- Overrides:
sendTickPacketin classBufferedConnection
-