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 ServerDataprivate ServerLinksprotected final WorldSessionTelemetryManager -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClientCommonPacketListenerImpl(Minecraft minecraft, Connection connection, CommonListenerCookie commonListenerCookie) -
Method Summary
Modifier and TypeMethodDescriptionprivate ScreenaddOrUpdatePackPrompt(UUID id, URL url, String hash, boolean required, Component prompt) voidprotected abstract DialogConnectionAccesscreateDisconnectionInfo(Component reason, Throwable error) protected ScreenvoidfillListenerSpecificCrashDetails(CrashReport crashReport, CrashReportCategory category) Returns the connection this listener is attached to.Returns the main thread event loop.voidvoidprotected abstract voidhandleCustomPayload(CustomPacketPayload payload) voidvoidvoidvoidhandlePing(ClientboundPingPacket packet) voidvoidvoidvoidvoidvoidvoidvoidonDisconnect(DisconnectionDetails details) voidonPacketError(Packet packet, Exception exception) private static URL(package private) static ComponentpreparePackPrompt(Component line1, Component line2) voidSends a packet to the target of this listener.protected voidprivate voidsendWhen(Packet<? extends ServerboundPacketListener> packet, BooleanSupplier sendCondition, Duration expirationTime) booleanshouldHandleMessage(Packet<?> packet) protected voidshowDialog(Holder<Dialog> dialog, DialogConnectionAccess connectionAccess, Screen previousScreen) voidshowDialog(Holder<Dialog> dialog, Screen previousScreen) storeDisconnectionReport(Packet packet, Throwable error) 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 minecraft, Connection connection, CommonListenerCookie commonListenerCookie)
-
-
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> dialog, DialogConnectionAccess connectionAccess, @Nullable Screen previousScreen) -
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> packet, BooleanSupplier sendCondition, Duration expirationTime) -
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
-