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 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 p_350683_, Throwable p_350813_) protected ScreencreateDisconnectScreen(DisconnectionDetails pDetails) voidfillListenerSpecificCrashDetails(CrashReport p_350364_, CrashReportCategory p_315011_) Returns the connection this listener is attached to.Returns the main thread event loop.voidprotected abstract voidhandleCustomPayload(CustomPacketPayload pPayload) voidvoidhandleDisconnect(ClientboundDisconnectPacket p_296159_) voidhandleKeepAlive(ClientboundKeepAlivePacket p_295361_) voidhandlePing(ClientboundPingPacket p_295594_) voidvoidvoidvoidhandleServerLinks(ClientboundServerLinksPacket p_350990_) voidhandleStoreCookie(ClientboundStoreCookiePacket p_320008_) voidhandleTransfer(ClientboundTransferPacket p_320739_) voidonDisconnect(DisconnectionDetails p_350760_) voidonPacketError(Packet p_341624_, Exception p_341639_) 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<?> p_341905_) 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, 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 -
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
- 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
-
getMainThreadEventLoop
Description copied from interface:ICommonPacketListenerReturns the main thread event loop.- Specified by:
getMainThreadEventLoopin interfaceICommonPacketListener- Returns:
- the main thread event loop
-