Package net.minecraft.client.multiplayer
Class ClientPacketListener
java.lang.Object
net.minecraft.client.multiplayer.ClientCommonPacketListenerImpl
net.minecraft.client.multiplayer.ClientPacketListener
- All Implemented Interfaces:
ClientboundPacketListener
,ClientPongPacketListener
,PacketListener
,ClientCommonPacketListener
,ClientGamePacketListener
,TickablePacketListener
public class ClientPacketListener
extends ClientCommonPacketListenerImpl
implements TickablePacketListener, ClientGamePacketListener
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.multiplayer.ClientCommonPacketListenerImpl
ClientCommonPacketListenerImpl.DeferredPacket
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ClientAdvancements
private static final Component
private LocalChatSession
private final ChunkBatchSizeCalculator
private boolean
com.mojang.brigadier.CommandDispatcher<SharedSuggestionProvider>
private final DebugQueryHandler
private final FeatureFlagSet
private final UUID
private static final Component
private LastSeenMessagesTracker
private ClientLevel
private ClientLevel.ClientLevelData
private Set<ResourceKey<Level>>
private final Set<PlayerInfo>
private final com.mojang.authlib.GameProfile
private static final org.slf4j.Logger
private MessageSignatureCache
private static final int
private final PingDebugMonitor
private final Map<UUID,
PlayerInfo> private final RandomSource
private final RecipeManager
private static final Component
private final RegistryAccess.Frozen
private boolean
private int
private int
private SignedMessageChain.Encoder
private final ClientSuggestionProvider
private static final Component
private static final Component
Fields inherited from class net.minecraft.client.multiplayer.ClientCommonPacketListenerImpl
connection, minecraft, postDisconnectScreen, serverBrand, serverData, telemetryManager
-
Constructor Summary
ConstructorDescriptionClientPacketListener
(Minecraft p_253924_, Connection p_253614_, CommonListenerCookie p_295121_) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
applyLightData
(int p_194249_, int p_194250_, ClientboundLightUpdatePacketData p_194251_) private void
applyPlayerInfoUpdate
(ClientboundPlayerInfoUpdatePacket.Action p_248954_, ClientboundPlayerInfoUpdatePacket.Entry p_251310_, PlayerInfo p_251146_) void
close()
private Entity
createEntityFromPacket
(ClientboundAddEntityPacket p_302232_) private void
enableChunkLight
(LevelChunk p_194213_, int p_194214_, int p_194215_) private boolean
private static ItemStack
com.mojang.brigadier.CommandDispatcher<SharedSuggestionProvider>
getId()
getLevel()
com.mojang.authlib.GameProfile
getPlayerInfo
(String p_104939_) getPlayerInfo
(UUID p_104950_) void
handleAddEntity
(ClientboundAddEntityPacket p_104958_) void
void
handleAddObjective
(ClientboundSetObjectivePacket p_105100_) void
handleAddOrRemoveRecipes
(ClientboundRecipePacket p_105058_) void
handleAnimate
(ClientboundAnimatePacket p_104968_) void
handleAwardStats
(ClientboundAwardStatsPacket p_104970_) void
void
void
void
handleBlockEvent
(ClientboundBlockEventPacket p_104978_) void
handleBlockUpdate
(ClientboundBlockUpdatePacket p_104980_) void
handleBossUpdate
(ClientboundBossEventPacket p_104982_) void
handleBundlePacket
(ClientboundBundlePacket p_265195_) void
void
void
void
void
handleChunksBiomes
(ClientboundChunksBiomesPacket p_275437_) void
handleCommands
(ClientboundCommandsPacket p_104990_) void
void
void
void
void
void
void
void
handleCustomPayload
(ClientboundCustomPayloadPacket p_295727_, CustomPacketPayload p_295851_) void
handleDamageEvent
(ClientboundDamageEventPacket p_270800_) void
handleDeleteChat
(ClientboundDeleteChatPacket p_241325_) void
void
handleEntityEvent
(ClientboundEntityEventPacket p_105010_) void
void
handleExplosion
(ClientboundExplodePacket p_105012_) void
void
handleGameEvent
(ClientboundGameEventPacket p_105016_) void
void
void
void
handleItemCooldown
(ClientboundCooldownPacket p_105002_) void
void
handleLevelEvent
(ClientboundLevelEventPacket p_105024_) void
void
handleLogin
(ClientboundLoginPacket p_105030_) void
handleLookAt
(ClientboundPlayerLookAtPacket p_105054_) void
handleMapItemData
(ClientboundMapItemDataPacket p_105032_) void
void
handleMoveEntity
(ClientboundMoveEntityPacket p_105036_) void
handleMovePlayer
(ClientboundPlayerPositionPacket p_105056_) void
handleMoveVehicle
(ClientboundMoveVehiclePacket p_105038_) void
handleOpenBook
(ClientboundOpenBookPacket p_105040_) void
handleOpenScreen
(ClientboundOpenScreenPacket p_105042_) void
void
void
void
void
handlePlayerChat
(ClientboundPlayerChatPacket p_233702_) void
void
void
void
void
void
handlePongResponse
(ClientboundPongResponsePacket p_298645_) void
void
void
handleRespawn
(ClientboundRespawnPacket p_105066_) void
handleRotateMob
(ClientboundRotateHeadPacket p_105068_) void
void
handleServerData
(ClientboundServerDataPacket p_233704_) void
void
void
void
void
void
handleSetCamera
(ClientboundSetCameraPacket p_105076_) void
void
void
void
void
void
void
void
handleSetEquipment
(ClientboundSetEquipmentPacket p_105094_) void
void
handleSetHealth
(ClientboundSetHealthPacket p_105098_) void
void
handleSetScore
(ClientboundSetScorePacket p_105106_) void
void
void
handleSetTime
(ClientboundSetTimePacket p_105108_) void
void
handleSoundEvent
(ClientboundSoundPacket p_105114_) void
handleStopSoundEvent
(ClientboundStopSoundPacket p_105116_) void
handleSystemChat
(ClientboundSystemChatPacket p_233708_) void
void
handleTagQueryPacket
(ClientboundTagQueryPacket p_105120_) void
void
void
handleTitlesClear
(ClientboundClearTitlesPacket p_171765_) private void
handleUnknownCustomPayload
(ClientboundCustomPayloadPacket p_295727_, CustomPacketPayload p_294389_) void
void
void
void
void
handleUpdateTags
(ClientboundUpdateTagsPacket p_294888_) private void
initializeChatSession
(ClientboundPlayerInfoUpdatePacket.Entry p_248806_, PlayerInfo p_251136_) boolean
boolean
isFeatureEnabled
(FeatureFlagSet p_250605_) levels()
void
markMessageAsProcessed
(PlayerChatMessage p_242356_, boolean p_242455_) private com.mojang.brigadier.ParseResults<SharedSuggestionProvider>
parseCommand
(String p_249982_) private void
postAddEntitySoundInstance
(Entity p_233664_) private void
private void
readSectionList
(int p_171735_, int p_171736_, LevelLightEngine p_171737_, LightLayer p_171738_, BitSet p_171739_, BitSet p_171740_, Iterator<byte[]> p_171741_) private void
void
private void
void
sendCommand
(String p_250092_) boolean
sendUnsignedCommand
(String p_251509_) void
void
setKeyPair
(ProfileKeyPair p_261475_) void
setSubtitleText
(ClientboundSetSubtitleTextPacket p_171791_) void
void
setTitleText
(ClientboundSetTitleTextPacket p_171793_) void
tick()
private void
updateLevelChunk
(int p_194199_, int p_194200_, ClientboundLevelChunkPacketData p_194201_) Methods inherited from class net.minecraft.client.multiplayer.ClientCommonPacketListenerImpl
createDisconnectScreen, handleCustomPayload, handleDisconnect, handleKeepAlive, handlePing, handleResourcePack, onDisconnect, send, sendDeferredPackets, serverBrand
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.minecraft.network.protocol.common.ClientCommonPacketListener
handleCustomPayload, handleDisconnect, handleKeepAlive, handlePing, handleResourcePack
Methods inherited from interface net.minecraft.network.protocol.game.ClientGamePacketListener
protocol
Methods inherited from interface net.minecraft.network.PacketListener
onDisconnect, shouldHandleMessage, shouldPropagateHandlingExceptions
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
UNSECURE_SERVER_TOAST_TITLE
-
UNSERURE_SERVER_TOAST
-
INVALID_PACKET
-
CHAT_VALIDATION_FAILED_ERROR
-
RECONFIGURE_SCREEN_MESSAGE
-
PENDING_OFFSET_THRESHOLD
private static final int PENDING_OFFSET_THRESHOLD- See Also:
-
localGameProfile
private final com.mojang.authlib.GameProfile localGameProfile -
level
-
levelData
-
playerInfoMap
-
listedPlayers
-
advancements
-
suggestionsProvider
-
debugQueryHandler
-
serverChunkRadius
private int serverChunkRadius -
serverSimulationDistance
private int serverSimulationDistance -
random
-
commands
-
recipeManager
-
id
-
levels
-
registryAccess
-
enabledFeatures
-
chatSession
-
signedMessageEncoder
-
lastSeenMessages
-
messageSignatureCache
-
chunkBatchSizeCalculator
-
pingDebugMonitor
-
seenInsecureChatWarning
private boolean seenInsecureChatWarning -
closed
private volatile boolean closed
-
-
Constructor Details
-
ClientPacketListener
public ClientPacketListener(Minecraft p_253924_, Connection p_253614_, CommonListenerCookie p_295121_)
-
-
Method Details
-
getSuggestionsProvider
-
close
public void close() -
getRecipeManager
-
handleLogin
- Specified by:
handleLogin
in interfaceClientGamePacketListener
-
handleAddEntity
- Specified by:
handleAddEntity
in interfaceClientGamePacketListener
-
createEntityFromPacket
-
postAddEntitySoundInstance
-
handleAddExperienceOrb
- Specified by:
handleAddExperienceOrb
in interfaceClientGamePacketListener
-
handleSetEntityMotion
- Specified by:
handleSetEntityMotion
in interfaceClientGamePacketListener
-
handleSetEntityData
- Specified by:
handleSetEntityData
in interfaceClientGamePacketListener
-
handleTeleportEntity
- Specified by:
handleTeleportEntity
in interfaceClientGamePacketListener
-
handleSetCarriedItem
- Specified by:
handleSetCarriedItem
in interfaceClientGamePacketListener
-
handleMoveEntity
- Specified by:
handleMoveEntity
in interfaceClientGamePacketListener
-
handleRotateMob
- Specified by:
handleRotateMob
in interfaceClientGamePacketListener
-
handleRemoveEntities
- Specified by:
handleRemoveEntities
in interfaceClientGamePacketListener
-
handleMovePlayer
- Specified by:
handleMovePlayer
in interfaceClientGamePacketListener
-
handleChunkBlocksUpdate
- Specified by:
handleChunkBlocksUpdate
in interfaceClientGamePacketListener
-
handleLevelChunkWithLight
- Specified by:
handleLevelChunkWithLight
in interfaceClientGamePacketListener
-
handleChunksBiomes
- Specified by:
handleChunksBiomes
in interfaceClientGamePacketListener
-
updateLevelChunk
private void updateLevelChunk(int p_194199_, int p_194200_, ClientboundLevelChunkPacketData p_194201_) -
enableChunkLight
-
handleForgetLevelChunk
- Specified by:
handleForgetLevelChunk
in interfaceClientGamePacketListener
-
queueLightRemoval
-
handleBlockUpdate
- Specified by:
handleBlockUpdate
in interfaceClientGamePacketListener
-
handleConfigurationStart
- Specified by:
handleConfigurationStart
in interfaceClientGamePacketListener
-
handleTakeItemEntity
- Specified by:
handleTakeItemEntity
in interfaceClientGamePacketListener
-
handleSystemChat
- Specified by:
handleSystemChat
in interfaceClientGamePacketListener
-
handlePlayerChat
- Specified by:
handlePlayerChat
in interfaceClientGamePacketListener
-
handleDisguisedChat
- Specified by:
handleDisguisedChat
in interfaceClientGamePacketListener
-
handleDeleteChat
- Specified by:
handleDeleteChat
in interfaceClientGamePacketListener
-
handleAnimate
- Specified by:
handleAnimate
in interfaceClientGamePacketListener
-
handleHurtAnimation
- Specified by:
handleHurtAnimation
in interfaceClientGamePacketListener
-
handleSetTime
- Specified by:
handleSetTime
in interfaceClientGamePacketListener
-
handleSetSpawn
- Specified by:
handleSetSpawn
in interfaceClientGamePacketListener
-
handleSetEntityPassengersPacket
- Specified by:
handleSetEntityPassengersPacket
in interfaceClientGamePacketListener
-
handleEntityLinkPacket
- Specified by:
handleEntityLinkPacket
in interfaceClientGamePacketListener
-
findTotem
-
handleEntityEvent
- Specified by:
handleEntityEvent
in interfaceClientGamePacketListener
-
handleDamageEvent
- Specified by:
handleDamageEvent
in interfaceClientGamePacketListener
-
handleSetHealth
- Specified by:
handleSetHealth
in interfaceClientGamePacketListener
-
handleSetExperience
- Specified by:
handleSetExperience
in interfaceClientGamePacketListener
-
handleRespawn
- Specified by:
handleRespawn
in interfaceClientGamePacketListener
-
handleExplosion
- Specified by:
handleExplosion
in interfaceClientGamePacketListener
-
handleHorseScreenOpen
- Specified by:
handleHorseScreenOpen
in interfaceClientGamePacketListener
-
handleOpenScreen
- Specified by:
handleOpenScreen
in interfaceClientGamePacketListener
-
handleContainerSetSlot
- Specified by:
handleContainerSetSlot
in interfaceClientGamePacketListener
-
handleContainerContent
- Specified by:
handleContainerContent
in interfaceClientGamePacketListener
-
handleOpenSignEditor
- Specified by:
handleOpenSignEditor
in interfaceClientGamePacketListener
-
handleBlockEntityData
- Specified by:
handleBlockEntityData
in interfaceClientGamePacketListener
-
handleContainerSetData
- Specified by:
handleContainerSetData
in interfaceClientGamePacketListener
-
handleSetEquipment
- Specified by:
handleSetEquipment
in interfaceClientGamePacketListener
-
handleContainerClose
- Specified by:
handleContainerClose
in interfaceClientGamePacketListener
-
handleBlockEvent
- Specified by:
handleBlockEvent
in interfaceClientGamePacketListener
-
handleBlockDestruction
- Specified by:
handleBlockDestruction
in interfaceClientGamePacketListener
-
handleGameEvent
- Specified by:
handleGameEvent
in interfaceClientGamePacketListener
-
handleMapItemData
- Specified by:
handleMapItemData
in interfaceClientGamePacketListener
-
handleLevelEvent
- Specified by:
handleLevelEvent
in interfaceClientGamePacketListener
-
handleUpdateAdvancementsPacket
- Specified by:
handleUpdateAdvancementsPacket
in interfaceClientGamePacketListener
-
handleSelectAdvancementsTab
- Specified by:
handleSelectAdvancementsTab
in interfaceClientGamePacketListener
-
handleCommands
- Specified by:
handleCommands
in interfaceClientGamePacketListener
-
handleStopSoundEvent
- Specified by:
handleStopSoundEvent
in interfaceClientGamePacketListener
-
handleCommandSuggestions
- Specified by:
handleCommandSuggestions
in interfaceClientGamePacketListener
-
handleUpdateRecipes
- Specified by:
handleUpdateRecipes
in interfaceClientGamePacketListener
-
handleLookAt
- Specified by:
handleLookAt
in interfaceClientGamePacketListener
-
handleTagQueryPacket
- Specified by:
handleTagQueryPacket
in interfaceClientGamePacketListener
-
handleAwardStats
- Specified by:
handleAwardStats
in interfaceClientGamePacketListener
-
handleAddOrRemoveRecipes
- Specified by:
handleAddOrRemoveRecipes
in interfaceClientGamePacketListener
-
handleUpdateMobEffect
- Specified by:
handleUpdateMobEffect
in interfaceClientGamePacketListener
-
handleUpdateTags
- Specified by:
handleUpdateTags
in interfaceClientCommonPacketListener
- Overrides:
handleUpdateTags
in classClientCommonPacketListenerImpl
-
refreshTagDependentData
private void refreshTagDependentData() -
handlePlayerCombatEnd
- Specified by:
handlePlayerCombatEnd
in interfaceClientGamePacketListener
-
handlePlayerCombatEnter
- Specified by:
handlePlayerCombatEnter
in interfaceClientGamePacketListener
-
handlePlayerCombatKill
- Specified by:
handlePlayerCombatKill
in interfaceClientGamePacketListener
-
handleChangeDifficulty
- Specified by:
handleChangeDifficulty
in interfaceClientGamePacketListener
-
handleSetCamera
- Specified by:
handleSetCamera
in interfaceClientGamePacketListener
-
handleInitializeBorder
- Specified by:
handleInitializeBorder
in interfaceClientGamePacketListener
-
handleSetBorderCenter
- Specified by:
handleSetBorderCenter
in interfaceClientGamePacketListener
-
handleSetBorderLerpSize
- Specified by:
handleSetBorderLerpSize
in interfaceClientGamePacketListener
-
handleSetBorderSize
- Specified by:
handleSetBorderSize
in interfaceClientGamePacketListener
-
handleSetBorderWarningDistance
- Specified by:
handleSetBorderWarningDistance
in interfaceClientGamePacketListener
-
handleSetBorderWarningDelay
- Specified by:
handleSetBorderWarningDelay
in interfaceClientGamePacketListener
-
handleTitlesClear
- Specified by:
handleTitlesClear
in interfaceClientGamePacketListener
-
handleServerData
- Specified by:
handleServerData
in interfaceClientGamePacketListener
-
handleCustomChatCompletions
- Specified by:
handleCustomChatCompletions
in interfaceClientGamePacketListener
-
setActionBarText
- Specified by:
setActionBarText
in interfaceClientGamePacketListener
-
setTitleText
- Specified by:
setTitleText
in interfaceClientGamePacketListener
-
setSubtitleText
- Specified by:
setSubtitleText
in interfaceClientGamePacketListener
-
setTitlesAnimation
- Specified by:
setTitlesAnimation
in interfaceClientGamePacketListener
-
handleTabListCustomisation
- Specified by:
handleTabListCustomisation
in interfaceClientGamePacketListener
-
handleRemoveMobEffect
- Specified by:
handleRemoveMobEffect
in interfaceClientGamePacketListener
-
handlePlayerInfoRemove
- Specified by:
handlePlayerInfoRemove
in interfaceClientGamePacketListener
-
handlePlayerInfoUpdate
- Specified by:
handlePlayerInfoUpdate
in interfaceClientGamePacketListener
-
applyPlayerInfoUpdate
private void applyPlayerInfoUpdate(ClientboundPlayerInfoUpdatePacket.Action p_248954_, ClientboundPlayerInfoUpdatePacket.Entry p_251310_, PlayerInfo p_251146_) -
initializeChatSession
private void initializeChatSession(ClientboundPlayerInfoUpdatePacket.Entry p_248806_, PlayerInfo p_251136_) -
enforcesSecureChat
private boolean enforcesSecureChat() -
handlePlayerAbilities
- Specified by:
handlePlayerAbilities
in interfaceClientGamePacketListener
-
handleSoundEvent
- Specified by:
handleSoundEvent
in interfaceClientGamePacketListener
-
handleSoundEntityEvent
- Specified by:
handleSoundEntityEvent
in interfaceClientGamePacketListener
-
handleBossUpdate
- Specified by:
handleBossUpdate
in interfaceClientGamePacketListener
-
handleItemCooldown
- Specified by:
handleItemCooldown
in interfaceClientGamePacketListener
-
handleMoveVehicle
- Specified by:
handleMoveVehicle
in interfaceClientGamePacketListener
-
handleOpenBook
- Specified by:
handleOpenBook
in interfaceClientGamePacketListener
-
handleCustomPayload
public void handleCustomPayload(ClientboundCustomPayloadPacket p_295727_, CustomPacketPayload p_295851_) - Specified by:
handleCustomPayload
in classClientCommonPacketListenerImpl
-
handleUnknownCustomPayload
private void handleUnknownCustomPayload(ClientboundCustomPayloadPacket p_295727_, CustomPacketPayload p_294389_) -
handleAddObjective
- Specified by:
handleAddObjective
in interfaceClientGamePacketListener
-
handleSetScore
- Specified by:
handleSetScore
in interfaceClientGamePacketListener
-
handleSetDisplayObjective
- Specified by:
handleSetDisplayObjective
in interfaceClientGamePacketListener
-
handleSetPlayerTeamPacket
- Specified by:
handleSetPlayerTeamPacket
in interfaceClientGamePacketListener
-
handleParticleEvent
- Specified by:
handleParticleEvent
in interfaceClientGamePacketListener
-
handleUpdateAttributes
- Specified by:
handleUpdateAttributes
in interfaceClientGamePacketListener
-
handlePlaceRecipe
- Specified by:
handlePlaceRecipe
in interfaceClientGamePacketListener
-
handleLightUpdatePacket
- Specified by:
handleLightUpdatePacket
in interfaceClientGamePacketListener
-
applyLightData
private void applyLightData(int p_194249_, int p_194250_, ClientboundLightUpdatePacketData p_194251_) -
handleMerchantOffers
- Specified by:
handleMerchantOffers
in interfaceClientGamePacketListener
-
handleSetChunkCacheRadius
- Specified by:
handleSetChunkCacheRadius
in interfaceClientGamePacketListener
-
handleSetSimulationDistance
- Specified by:
handleSetSimulationDistance
in interfaceClientGamePacketListener
-
handleSetChunkCacheCenter
- Specified by:
handleSetChunkCacheCenter
in interfaceClientGamePacketListener
-
handleBlockChangedAck
- Specified by:
handleBlockChangedAck
in interfaceClientGamePacketListener
-
handleBundlePacket
- Specified by:
handleBundlePacket
in interfaceClientGamePacketListener
-
handleChunkBatchStart
- Specified by:
handleChunkBatchStart
in interfaceClientGamePacketListener
-
handleChunkBatchFinished
- Specified by:
handleChunkBatchFinished
in interfaceClientGamePacketListener
-
handlePongResponse
- Specified by:
handlePongResponse
in interfaceClientPongPacketListener
-
readSectionList
private void readSectionList(int p_171735_, int p_171736_, LevelLightEngine p_171737_, LightLayer p_171738_, BitSet p_171739_, BitSet p_171740_, Iterator<byte[]> p_171741_) -
getConnection
-
isAcceptingMessages
public boolean isAcceptingMessages()- Specified by:
isAcceptingMessages
in interfacePacketListener
-
getListedOnlinePlayers
-
getOnlinePlayers
-
getOnlinePlayerIds
-
getPlayerInfo
-
getPlayerInfo
-
getLocalGameProfile
public com.mojang.authlib.GameProfile getLocalGameProfile() -
getAdvancements
-
getCommands
-
getLevel
-
getDebugQueryHandler
-
getId
-
levels
-
registryAccess
- Specified by:
registryAccess
in classClientCommonPacketListenerImpl
-
markMessageAsProcessed
-
sendChatAcknowledgement
private void sendChatAcknowledgement() -
sendChat
-
sendCommand
-
sendUnsignedCommand
-
parseCommand
-
tick
public void tick()- Specified by:
tick
in interfaceTickablePacketListener
-
setKeyPair
-
getServerData
-
enabledFeatures
-
isFeatureEnabled
-