Package net.minecraft.client.multiplayer
Class ClientPacketListener
java.lang.Object
net.minecraft.client.multiplayer.ClientPacketListener
- All Implemented Interfaces:
PacketListener
,ClientGamePacketListener
,TickablePacketListener
public class ClientPacketListener
extends Object
implements TickablePacketListener, ClientGamePacketListener
-
Nested Class Summary
Modifier and TypeClassDescription(package private) static final record
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ClientAdvancements
private final Screen
private static final Component
private LocalChatSession
com.mojang.brigadier.CommandDispatcher<SharedSuggestionProvider>
private final Connection
private final DebugQueryHandler
private final List<ClientPacketListener.DeferredPacket>
private FeatureFlagSet
private static final Component
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 final Minecraft
private static final int
private final Map<UUID,
PlayerInfo> private final RandomSource
private final RecipeManager
private LayeredRegistryAccess<ClientRegistryLayer>
private int
private final ServerData
private int
private SignedMessageChain.Encoder
private final ClientSuggestionProvider
private final WorldSessionTelemetryManager
private static final Component
private static final Component
-
Constructor Summary
ConstructorDescriptionClientPacketListener
(Minecraft p_253924_, Screen p_254239_, Connection p_253614_, ServerData p_254072_, com.mojang.authlib.GameProfile p_254079_, WorldSessionTelemetryManager p_262115_) -
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 void
downloadCallback
(CompletableFuture<?> p_104952_) 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
handleAddPlayer
(ClientboundAddPlayerPacket p_104966_) 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
handleChunksBiomes
(ClientboundChunksBiomesPacket p_275437_) void
handleCommands
(ClientboundCommandsPacket p_104990_) void
void
void
void
void
void
void
void
handleDamageEvent
(ClientboundDamageEventPacket p_270800_) void
handleDeleteChat
(ClientboundDeleteChatPacket p_241325_) void
handleDisconnect
(ClientboundDisconnectPacket p_105008_) void
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
handleKeepAlive
(ClientboundKeepAlivePacket p_105020_) 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
handlePing
(ClientboundPingPacket p_171769_) void
void
void
handlePlayerChat
(ClientboundPlayerChatPacket p_233702_) void
void
void
void
void
void
void
void
handleResourcePack
(ClientboundResourcePackPacket p_105064_) 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_) void
void
void
void
void
handleUpdateTags
(ClientboundUpdateTagsPacket p_105134_) 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_) void
onDisconnect
(Component p_104954_) private com.mojang.brigadier.ParseResults<SharedSuggestionProvider>
parseCommand
(String p_249982_) private static URL
parseResourcePackUrl
(String p_233710_) private void
postAddEntitySoundInstance
(Entity p_233664_) private static Component
preparePackPrompt
(Component p_171760_, Component p_171761_) private void
queueLightUpdate
(int p_194203_, int p_194204_, ClientboundLightUpdatePacketData p_194205_) 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_, boolean p_171742_) private void
send
(ServerboundResourcePackPacket.Action p_105136_) void
void
private void
void
sendCommand
(String p_250092_) private void
boolean
sendUnsignedCommand
(String p_251509_) private void
sendWhen
(Packet<ServerGamePacketListener> p_270433_, BooleanSupplier p_270843_, Duration p_270497_) 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_) private <T> void
updateTagsForRegistry
(ResourceKey<? extends Registry<? extends T>> p_205561_, TagNetworkSerialization.NetworkPayload p_205562_) 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.PacketListener
shouldPropagateHandlingExceptions
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
GENERIC_DISCONNECT_MESSAGE
-
UNSECURE_SERVER_TOAST_TITLE
-
UNSERURE_SERVER_TOAST
-
INVALID_PACKET
-
CHAT_VALIDATION_FAILED_ERROR
-
PENDING_OFFSET_THRESHOLD
private static final int PENDING_OFFSET_THRESHOLD- See Also:
-
connection
-
deferredPackets
-
serverData
-
localGameProfile
private final com.mojang.authlib.GameProfile localGameProfile -
callbackScreen
-
minecraft
-
level
-
levelData
-
playerInfoMap
-
listedPlayers
-
advancements
-
suggestionsProvider
-
debugQueryHandler
-
serverChunkRadius
private int serverChunkRadius -
serverSimulationDistance
private int serverSimulationDistance -
random
-
commands
-
recipeManager
-
id
-
levels
-
registryAccess
-
enabledFeatures
-
telemetryManager
-
chatSession
-
signedMessageEncoder
-
lastSeenMessages
-
messageSignatureCache
-
-
Constructor Details
-
ClientPacketListener
public ClientPacketListener(Minecraft p_253924_, Screen p_254239_, Connection p_253614_, @Nullable ServerData p_254072_, com.mojang.authlib.GameProfile p_254079_, WorldSessionTelemetryManager p_262115_)
-
-
Method Details
-
getSuggestionsProvider
-
close
public void close() -
getRecipeManager
-
handleLogin
- Specified by:
handleLogin
in interfaceClientGamePacketListener
-
handleAddEntity
- Specified by:
handleAddEntity
in interfaceClientGamePacketListener
-
postAddEntitySoundInstance
-
handleAddExperienceOrb
- Specified by:
handleAddExperienceOrb
in interfaceClientGamePacketListener
-
handleSetEntityMotion
- Specified by:
handleSetEntityMotion
in interfaceClientGamePacketListener
-
handleSetEntityData
- Specified by:
handleSetEntityData
in interfaceClientGamePacketListener
-
handleAddPlayer
- Specified by:
handleAddPlayer
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_) -
queueLightUpdate
private void queueLightUpdate(int p_194203_, int p_194204_, ClientboundLightUpdatePacketData p_194205_) -
enableChunkLight
-
handleForgetLevelChunk
- Specified by:
handleForgetLevelChunk
in interfaceClientGamePacketListener
-
queueLightUpdate
-
handleBlockUpdate
- Specified by:
handleBlockUpdate
in interfaceClientGamePacketListener
-
handleDisconnect
- Specified by:
handleDisconnect
in interfaceClientGamePacketListener
-
onDisconnect
- Specified by:
onDisconnect
in interfacePacketListener
-
send
-
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 interfaceClientGamePacketListener
-
handleEnabledFeatures
- Specified by:
handleEnabledFeatures
in interfaceClientGamePacketListener
-
updateTagsForRegistry
private <T> void updateTagsForRegistry(ResourceKey<? extends Registry<? extends T>> p_205561_, TagNetworkSerialization.NetworkPayload p_205562_) -
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() -
handleKeepAlive
- Specified by:
handleKeepAlive
in interfaceClientGamePacketListener
-
sendWhen
private void sendWhen(Packet<ServerGamePacketListener> p_270433_, BooleanSupplier p_270843_, Duration p_270497_) -
sendDeferredPackets
private void sendDeferredPackets() -
handlePlayerAbilities
- Specified by:
handlePlayerAbilities
in interfaceClientGamePacketListener
-
handleSoundEvent
- Specified by:
handleSoundEvent
in interfaceClientGamePacketListener
-
handleSoundEntityEvent
- Specified by:
handleSoundEntityEvent
in interfaceClientGamePacketListener
-
handleResourcePack
- Specified by:
handleResourcePack
in interfaceClientGamePacketListener
-
preparePackPrompt
-
parseResourcePackUrl
-
downloadCallback
-
send
-
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
- Specified by:
handleCustomPayload
in interfaceClientGamePacketListener
-
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
-
handlePing
- Specified by:
handlePing
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
-
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_, boolean p_171742_) -
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
-
markMessageAsProcessed
-
sendChatAcknowledgement
private void sendChatAcknowledgement() -
sendChat
-
sendCommand
-
sendUnsignedCommand
-
parseCommand
-
tick
public void tick()- Specified by:
tick
in interfaceTickablePacketListener
-
setKeyPair
-
getServerData
-
enabledFeatures
-
isFeatureEnabled
-