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 TypeClassDescriptionprotected class(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 booleanprotected final Map<UUID, PlayerInfo> protected Stringprotected final Map<ResourceLocation, byte[]> protected final ServerDataprivate 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) voidprotected abstract DialogConnectionAccesscreateDisconnectionInfo(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 packet processor.voidhandleClearDialog(ClientboundClearDialogPacket p_426184_) voidprotected abstract voidhandleCustomPayload(CustomPacketPayload pPayload) voidvoidhandleDisconnect(ClientboundDisconnectPacket p_296159_) voidhandleKeepAlive(ClientboundKeepAlivePacket p_295361_) voidhandlePing(ClientboundPingPacket p_295594_) voidvoidvoidvoidhandleServerLinks(ClientboundServerLinksPacket p_350990_) voidhandleShowDialog(ClientboundShowDialogPacket p_425904_) 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_) protected voidshowDialog(Holder<Dialog> pDialog, DialogConnectionAccess pConnectionAccess, Screen pPreviousScreen) voidshowDialog(Holder<Dialog> pDialog, Screen pPreviousScreen) 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
-
seenPlayers
-
seenInsecureChatWarning
protected boolean seenInsecureChatWarning -
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
-
serverLinks
-
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
-
handleShowDialog
- Specified by:
handleShowDialogin interfaceClientCommonPacketListener
-
createDialogAccess
-
showDialog
-
showDialog
protected void showDialog(Holder<Dialog> pDialog, DialogConnectionAccess pConnectionAccess, @Nullable Screen pPreviousScreen) -
handleClearDialog
- Specified by:
handleClearDialogin interfaceClientCommonPacketListener
-
clearDialog
public void clearDialog() -
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
-
getPacketProcessor
Description copied from interface:ICommonPacketListenerReturns the main thread packet processor.- Specified by:
getPacketProcessorin interfaceICommonPacketListener- Returns:
- the main thread packet processor
-