Package net.minecraft.client.multiplayer
Class ClientCommonPacketListenerImpl
java.lang.Object
net.minecraft.client.multiplayer.ClientCommonPacketListenerImpl
- All Implemented Interfaces:
ClientboundPacketListener
,PacketListener
,ClientCommonPacketListener
,IClientCommonPacketListenerExtension
- Direct Known Subclasses:
ClientConfigurationPacketListenerImpl
,ClientPacketListener
public abstract class ClientCommonPacketListenerImpl
extends Object
implements ClientCommonPacketListener
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static final record
(package private) class
-
Field Summary
Modifier and TypeFieldDescriptionfinal Connection
private final List<ClientCommonPacketListenerImpl.DeferredPacket>
private static final Component
private static final org.slf4j.Logger
protected final Minecraft
protected final Screen
protected String
protected final ServerData
protected final WorldSessionTelemetryManager
-
Constructor Summary
ModifierConstructorDescriptionprotected
ClientCommonPacketListenerImpl
(Minecraft p_295454_, Connection p_294773_, CommonListenerCookie p_294647_) -
Method Summary
Modifier and TypeMethodDescriptionprivate Screen
addOrUpdatePackPrompt
(UUID p_314948_, URL p_315012_, String p_314981_, boolean p_315013_, Component p_314960_) protected Screen
createDisconnectScreen
(Component p_296470_) void
Exposes the raw underlying connection.Returns the minecraft instance.void
protected abstract void
handleCustomPayload
(ClientboundCustomPayloadPacket p_295727_, CustomPacketPayload p_295776_) void
handleDisconnect
(ClientboundDisconnectPacket p_296159_) void
handleKeepAlive
(ClientboundKeepAlivePacket p_295361_) void
handlePing
(ClientboundPingPacket p_295594_) void
void
void
handleUpdateTags
(ClientboundUpdateTagsPacket p_294605_) void
onDisconnect
(Component p_295485_) private static URL
parseResourcePackUrl
(String p_295495_) (package private) static Component
preparePackPrompt
(Component p_296200_, Component p_295584_) protected abstract RegistryAccess.Frozen
void
Sends a packet to the server.protected void
private void
sendWhen
(Packet<? extends ServerboundPacketListener> p_296259_, BooleanSupplier p_296086_, Duration p_294812_) private <T> void
updateTagsForRegistry
(ResourceKey<? extends Registry<? extends T>> p_294128_, TagNetworkSerialization.NetworkPayload p_294666_) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.network.ClientboundPacketListener
flow
Methods inherited from interface net.neoforged.neoforge.common.extensions.IClientCommonPacketListenerExtension
getMainThreadEventLoop, isConnected, isConnected, isVanillaConnection, send
Methods inherited from interface net.minecraft.network.PacketListener
fillCrashReport, isAcceptingMessages, protocol, shouldHandleMessage, shouldPropagateHandlingExceptions
-
Field Details
-
GENERIC_DISCONNECT_MESSAGE
-
LOGGER
private static final org.slf4j.Logger LOGGER -
minecraft
-
connection
-
serverData
-
serverBrand
-
telemetryManager
-
postDisconnectScreen
-
deferredPackets
-
-
Constructor Details
-
ClientCommonPacketListenerImpl
protected ClientCommonPacketListenerImpl(Minecraft p_295454_, Connection p_294773_, CommonListenerCookie p_294647_)
-
-
Method Details
-
handleKeepAlive
- Specified by:
handleKeepAlive
in interfaceClientCommonPacketListener
-
handlePing
- Specified by:
handlePing
in interfaceClientCommonPacketListener
-
handleCustomPayload
- Specified by:
handleCustomPayload
in interfaceClientCommonPacketListener
-
handleCustomPayload
protected abstract void handleCustomPayload(ClientboundCustomPayloadPacket p_295727_, CustomPacketPayload p_295776_) -
registryAccess
-
handleResourcePackPush
- Specified by:
handleResourcePackPush
in interfaceClientCommonPacketListener
-
handleResourcePackPop
- Specified by:
handleResourcePackPop
in interfaceClientCommonPacketListener
-
preparePackPrompt
-
parseResourcePackUrl
-
handleUpdateTags
- Specified by:
handleUpdateTags
in interfaceClientCommonPacketListener
-
updateTagsForRegistry
private <T> void updateTagsForRegistry(ResourceKey<? extends Registry<? extends T>> p_294128_, TagNetworkSerialization.NetworkPayload p_294666_) -
handleDisconnect
- Specified by:
handleDisconnect
in interfaceClientCommonPacketListener
-
sendDeferredPackets
protected void sendDeferredPackets() -
send
Description copied from interface:IClientCommonPacketListenerExtension
Sends a packet to the server.- Specified by:
send
in interfaceIClientCommonPacketListenerExtension
- Parameters:
p_295097_
- The packet to send.
-
onDisconnect
- Specified by:
onDisconnect
in interfacePacketListener
-
fillListenerSpecificCrashDetails
- Specified by:
fillListenerSpecificCrashDetails
in interfacePacketListener
-
createDisconnectScreen
-
serverBrand
-
sendWhen
private void sendWhen(Packet<? extends ServerboundPacketListener> p_296259_, BooleanSupplier p_296086_, Duration p_294812_) -
addOrUpdatePackPrompt
-
getConnection
Description copied from interface:IClientCommonPacketListenerExtension
Exposes the raw underlying connection.- Specified by:
getConnection
in interfaceIClientCommonPacketListenerExtension
- Returns:
- The raw underlying connection.
-
getMinecraft
Description copied from interface:IClientCommonPacketListenerExtension
Returns the minecraft instance.- Specified by:
getMinecraft
in interfaceIClientCommonPacketListenerExtension
- Returns:
- the minecraft instance
-