Package net.minecraft.client.multiplayer
Class ClientCommonPacketListenerImpl
java.lang.Object
net.minecraft.client.multiplayer.ClientCommonPacketListenerImpl
- All Implemented Interfaces:
ClientboundPacketListener
,PacketListener
,ClientCommonPacketListener
,ClientCookiePacketListener
,IClientCommonPacketListenerExtension
,ICommonPacketListener
- Direct Known Subclasses:
ClientConfigurationPacketListenerImpl
,ClientPacketListener
public abstract class ClientCommonPacketListenerImpl
extends Object
implements ClientCommonPacketListener
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final record
(package private) class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Connection
protected ConnectionType
Holds the current connection type, based on the types of payloads that have been received so far.private final List
<ClientCommonPacketListenerImpl.DeferredPacket> private static final Component
protected boolean
private static final org.slf4j.Logger
protected final Minecraft
protected final Screen
protected String
protected final Map
<ResourceLocation, byte[]> protected final ServerData
protected ServerLinks
protected final WorldSessionTelemetryManager
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ClientCommonPacketListenerImpl
(Minecraft pMinecraft, Connection pConnection, CommonListenerCookie pCommonListenerCookie) -
Method Summary
Modifier and TypeMethodDescriptionprivate Screen
addOrUpdatePackPrompt
(UUID pId, URL pUrl, String pHash, boolean pRequired, Component pPrompt) createDisconnectionInfo
(Component p_350683_, Throwable p_350813_) protected Screen
createDisconnectScreen
(DisconnectionDetails pDetails) void
fillListenerSpecificCrashDetails
(CrashReport p_350364_, CrashReportCategory p_315011_) Returns the connection this listener is attached to.Returns the main thread event loop.void
protected abstract void
handleCustomPayload
(CustomPacketPayload pPayload) void
void
handleDisconnect
(ClientboundDisconnectPacket p_296159_) void
handleKeepAlive
(ClientboundKeepAlivePacket p_295361_) void
handlePing
(ClientboundPingPacket p_295594_) void
void
void
void
handleServerLinks
(ClientboundServerLinksPacket p_350990_) void
handleStoreCookie
(ClientboundStoreCookiePacket p_320008_) void
handleTransfer
(ClientboundTransferPacket p_320739_) void
onDisconnect
(DisconnectionDetails p_350760_) void
onPacketError
(Packet p_341624_, Exception p_341639_) private static URL
parseResourcePackUrl
(String pUrl) (package private) static Component
preparePackPrompt
(Component pLine1, Component pLine2) void
Sends a packet to the target of this listener.protected void
private void
sendWhen
(Packet<? extends ServerboundPacketListener> pPacket, BooleanSupplier pSendCondition, Duration pExpirationTime) boolean
shouldHandleMessage
(Packet<?> p_341905_) storeDisconnectionReport
(Packet pPacket, Throwable pError) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.network.ClientboundPacketListener
flow
Methods inherited from interface net.minecraft.network.protocol.common.ClientCommonPacketListener
handleUpdateTags
Methods inherited from interface net.neoforged.neoforge.common.extensions.IClientCommonPacketListenerExtension
disconnect, send
Methods inherited from interface net.neoforged.neoforge.common.extensions.ICommonPacketListener
getConnectionType, hasChannel, hasChannel, hasChannel
Methods inherited from interface net.minecraft.network.PacketListener
fillCrashReport, isAcceptingMessages, protocol
-
Field Details
-
GENERIC_DISCONNECT_MESSAGE
-
LOGGER
private static final org.slf4j.Logger LOGGER -
minecraft
-
connection
-
serverData
-
serverBrand
-
telemetryManager
-
postDisconnectScreen
-
isTransferring
protected boolean isTransferring -
deferredPackets
-
serverCookies
-
customReportDetails
-
serverLinks
-
connectionType
Holds the current connection type, based on the types of payloads that have been received so far.
-
-
Constructor Details
-
ClientCommonPacketListenerImpl
protected ClientCommonPacketListenerImpl(Minecraft pMinecraft, Connection pConnection, CommonListenerCookie pCommonListenerCookie)
-
-
Method Details
-
onPacketError
- Specified by:
onPacketError
in interfacePacketListener
-
createDisconnectionInfo
- Specified by:
createDisconnectionInfo
in interfacePacketListener
-
storeDisconnectionReport
-
shouldHandleMessage
- Specified by:
shouldHandleMessage
in interfacePacketListener
-
handleKeepAlive
- Specified by:
handleKeepAlive
in interfaceClientCommonPacketListener
-
handlePing
- Specified by:
handlePing
in interfaceClientCommonPacketListener
-
handleCustomPayload
- Specified by:
handleCustomPayload
in interfaceClientCommonPacketListener
-
handleCustomPayload
-
handleResourcePackPush
- Specified by:
handleResourcePackPush
in interfaceClientCommonPacketListener
-
handleResourcePackPop
- Specified by:
handleResourcePackPop
in interfaceClientCommonPacketListener
-
preparePackPrompt
-
parseResourcePackUrl
-
handleRequestCookie
- Specified by:
handleRequestCookie
in interfaceClientCookiePacketListener
-
handleStoreCookie
- Specified by:
handleStoreCookie
in interfaceClientCommonPacketListener
-
handleCustomReportDetails
- Specified by:
handleCustomReportDetails
in interfaceClientCommonPacketListener
-
handleServerLinks
- Specified by:
handleServerLinks
in interfaceClientCommonPacketListener
-
handleTransfer
- Specified by:
handleTransfer
in interfaceClientCommonPacketListener
-
handleDisconnect
- Specified by:
handleDisconnect
in interfaceClientCommonPacketListener
-
sendDeferredPackets
protected void sendDeferredPackets() -
send
Description copied from interface:ICommonPacketListener
Sends a packet to the target of this listener.- Specified by:
send
in interfaceICommonPacketListener
-
onDisconnect
- Specified by:
onDisconnect
in interfacePacketListener
-
fillListenerSpecificCrashDetails
- Specified by:
fillListenerSpecificCrashDetails
in interfacePacketListener
-
createDisconnectScreen
-
serverBrand
-
sendWhen
private void sendWhen(Packet<? extends ServerboundPacketListener> pPacket, BooleanSupplier pSendCondition, Duration pExpirationTime) -
addOrUpdatePackPrompt
-
getConnection
Description copied from interface:ICommonPacketListener
Returns the connection this listener is attached to.- Specified by:
getConnection
in interfaceICommonPacketListener
- Returns:
- the connection this listener is attached to
-
getMainThreadEventLoop
Description copied from interface:ICommonPacketListener
Returns the main thread event loop.- Specified by:
getMainThreadEventLoop
in interfaceICommonPacketListener
- Returns:
- the main thread event loop
-