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 minecraft, Connection connection, CommonListenerCookie commonListenerCookie) -
Method Summary
Modifier and TypeMethodDescriptionprivate ScreenaddOrUpdatePackPrompt(UUID id, URL url, String hash, boolean required, Component prompt) createDisconnectionInfo(Component reason, Throwable error) protected ScreenvoidfillListenerSpecificCrashDetails(CrashReport crashReport, CrashReportCategory category) Returns the connection this listener is attached to.voidprotected abstract voidhandleCustomPayload(CustomPacketPayload payload) voidvoidvoidvoidhandlePing(ClientboundPingPacket packet) voidvoidvoidvoidvoidvoidvoidonDisconnect(DisconnectionDetails details) voidonPacketError(Packet packet, Exception exception) private static URLparseResourcePackUrl(String p_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) 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, 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 minecraft, Connection connection, CommonListenerCookie commonListenerCookie)
-
-
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> 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
-