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 Connectionprotected ConnectionTypeHolds the current connection type, based on the types of payloads that have been received so far.private final List<ClientCommonPacketListenerImpl.DeferredPacket> private static final Componentprotected booleanprivate static final org.slf4j.Loggerprotected final Minecraftprotected final Screenprotected Stringprotected final Map<ResourceLocation, byte[]> protected final ServerDataprotected ServerLinksprotected final booleanDeprecated, for removal: This API element is subject to removal in a future version.protected final WorldSessionTelemetryManager -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClientCommonPacketListenerImpl(Minecraft pMinecraft, Connection pConnection, CommonListenerCookie pCommonListenerCookie) -
Method Summary
Modifier and TypeMethodDescriptionprivate ScreenaddOrUpdatePackPrompt(UUID pId, URL pUrl, String pHash, boolean pRequired, Component pPrompt) createDisconnectionInfo(Component pReason, Throwable pError) protected ScreencreateDisconnectScreen(DisconnectionDetails pDetails) voidfillListenerSpecificCrashDetails(CrashReport pCrashReport, CrashReportCategory pCategory) Returns the connection this listener is attached to.voidprotected abstract voidhandleCustomPayload(CustomPacketPayload pPayload) voidvoidvoidvoidhandlePing(ClientboundPingPacket pPacket) voidvoidvoidvoidvoidvoidhandleTransfer(ClientboundTransferPacket pPacket) voidonDisconnect(DisconnectionDetails pDetails) voidonPacketError(Packet pPacket, Exception pException) private static URLparseResourcePackUrl(String pUrl) (package private) static ComponentpreparePackPrompt(Component pLine1, Component pLine2) voidSends a packet to the target of this listener.protected voidprivate voidsendWhen(Packet<? extends ServerboundPacketListener> pPacket, BooleanSupplier pSendCondition, Duration pExpirationTime) booleanshouldHandleMessage(Packet<?> pPacket) storeDisconnectionReport(Packet pPacket, Throwable pError) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.network.ClientboundPacketListener
flowMethods inherited from interface net.minecraft.network.protocol.common.ClientCommonPacketListener
handleUpdateTagsMethods inherited from interface net.neoforged.neoforge.common.extensions.IClientCommonPacketListenerExtension
disconnect, getMainThreadEventLoop, sendMethods inherited from interface net.neoforged.neoforge.common.extensions.ICommonPacketListener
getConnectionType, hasChannel, hasChannel, hasChannelMethods 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:
onPacketErrorin interfacePacketListener
-
createDisconnectionInfo
- Specified by:
createDisconnectionInfoin interfacePacketListener
-
storeDisconnectionReport
-
shouldHandleMessage
- Specified by:
shouldHandleMessagein interfacePacketListener
-
handleKeepAlive
- Specified by:
handleKeepAlivein interfaceClientCommonPacketListener
-
handlePing
- Specified by:
handlePingin interfaceClientCommonPacketListener
-
handleCustomPayload
- Specified by:
handleCustomPayloadin interfaceClientCommonPacketListener
-
handleCustomPayload
-
handleResourcePackPush
- Specified by:
handleResourcePackPushin interfaceClientCommonPacketListener
-
handleResourcePackPop
- Specified by:
handleResourcePackPopin interfaceClientCommonPacketListener
-
preparePackPrompt
-
parseResourcePackUrl
-
handleRequestCookie
- Specified by:
handleRequestCookiein interfaceClientCookiePacketListener
-
handleStoreCookie
- Specified by:
handleStoreCookiein interfaceClientCommonPacketListener
-
handleCustomReportDetails
- Specified by:
handleCustomReportDetailsin interfaceClientCommonPacketListener
-
handleServerLinks
- Specified by:
handleServerLinksin interfaceClientCommonPacketListener
-
handleTransfer
- Specified by:
handleTransferin interfaceClientCommonPacketListener
-
handleDisconnect
- Specified by:
handleDisconnectin interfaceClientCommonPacketListener
-
sendDeferredPackets
protected void sendDeferredPackets() -
send
Description copied from interface:ICommonPacketListenerSends a packet to the target of this listener.- Specified by:
sendin interfaceICommonPacketListener
-
onDisconnect
- Specified by:
onDisconnectin interfacePacketListener
-
fillListenerSpecificCrashDetails
public void fillListenerSpecificCrashDetails(CrashReport pCrashReport, CrashReportCategory pCategory) - Specified by:
fillListenerSpecificCrashDetailsin interfacePacketListener
-
createDisconnectScreen
-
serverBrand
-
sendWhen
private void sendWhen(Packet<? extends ServerboundPacketListener> pPacket, BooleanSupplier pSendCondition, Duration pExpirationTime) -
addOrUpdatePackPrompt
-
getConnection
Description copied from interface:ICommonPacketListenerReturns the connection this listener is attached to.- Specified by:
getConnectionin interfaceICommonPacketListener- Returns:
- the connection this listener is attached to
-