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 boolean
Deprecated, for removal: This API element is subject to removal in a future version.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 pReason, Throwable pError) protected Screen
createDisconnectScreen
(DisconnectionDetails pDetails) void
fillListenerSpecificCrashDetails
(CrashReport pCrashReport, CrashReportCategory pCategory) Returns the connection this listener is attached to.void
protected abstract void
handleCustomPayload
(CustomPacketPayload pPayload) void
void
void
void
handlePing
(ClientboundPingPacket pPacket) void
void
void
void
void
void
handleTransfer
(ClientboundTransferPacket pPacket) void
onDisconnect
(DisconnectionDetails pDetails) void
onPacketError
(Packet pPacket, Exception pException) 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<?> pPacket) 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, getMainThreadEventLoop, 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 -
strictErrorHandling
Deprecated, for removal: This API element is subject to removal in a future version. -
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
public void fillListenerSpecificCrashDetails(CrashReport pCrashReport, CrashReportCategory pCategory) - 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
-