Package net.minecraft.client.multiplayer
Class ClientPacketListener
java.lang.Object
net.minecraft.client.multiplayer.ClientPacketListener
- All Implemented Interfaces:
PacketListener
,ClientGamePacketListener
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ClientAdvancements
private final Screen
com.mojang.brigadier.CommandDispatcher<SharedSuggestionProvider>
private final Connection
private final DebugQueryHandler
private static final Component
private final UUID
private final LastSeenMessagesTracker
private Optional<LastSeenMessages.Entry>
private ClientLevel
private ClientLevel.ClientLevelData
private Set<ResourceKey<Level>>
private final com.mojang.authlib.GameProfile
private static final org.slf4j.Logger
private final Minecraft
private final Map<UUID,
PlayerInfo> private final RandomSource
private final RecipeManager
private RegistryAccess.Frozen
private int
private int
private final SignedMessageChain.Encoder
private final ClientSuggestionProvider
private final ClientTelemetryManager
private static final int
private int
private static final Component
private static final Component
-
Constructor Summary
ConstructorDescriptionClientPacketListener
(Minecraft p_194193_, Screen p_194194_, Connection p_194195_, com.mojang.authlib.GameProfile p_194196_, ClientTelemetryManager p_194197_) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
applyLightData
(int p_194249_, int p_194250_, ClientboundLightUpdatePacketData p_194251_) void
cleanup()
private void
downloadCallback
(CompletableFuture<?> p_104952_) private void
enableChunkLight
(LevelChunk p_194213_, int p_194214_, int p_194215_) 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
void
handleChatPreview
(ClientboundChatPreviewPacket p_233700_) void
void
handleCommands
(ClientboundCommandsPacket p_104990_) void
void
void
void
void
void
void
void
void
handleDeleteChat
(ClientboundDeleteChatPacket p_241325_) void
handleDisconnect
(ClientboundDisconnectPacket p_105008_) void
handleEntityEvent
(ClientboundEntityEventPacket p_105010_) void
void
handleExplosion
(ClientboundExplodePacket p_105012_) void
void
handleGameEvent
(ClientboundGameEventPacket p_105016_) 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
handlePlayerInfo
(ClientboundPlayerInfoPacket p_105052_) 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
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_) levels()
void
markMessageAsProcessed
(PlayerChatMessage p_242356_, boolean p_242455_) void
onDisconnect
(Component p_104954_) 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
void
setSubtitleText
(ClientboundSetSubtitleTextPacket p_171791_) void
void
setTitleText
(ClientboundSetTitleTextPacket p_171793_) 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
-
UNACKNOWLEDGED_MESSAGES_THRESHOLD
private static final int UNACKNOWLEDGED_MESSAGES_THRESHOLD- See Also:
-
connection
-
localGameProfile
private final com.mojang.authlib.GameProfile localGameProfile -
callbackScreen
-
minecraft
-
level
-
levelData
-
playerInfoMap
-
advancements
-
suggestionsProvider
-
debugQueryHandler
-
serverChunkRadius
private int serverChunkRadius -
serverSimulationDistance
private int serverSimulationDistance -
random
-
commands
-
recipeManager
-
id
-
levels
-
registryAccess
-
telemetryManager
-
signedMessageEncoder
-
lastSeenMessagesTracker
-
lastUnacknowledgedReceivedMessage
-
unacknowledgedReceivedMessageCount
private int unacknowledgedReceivedMessageCount
-
-
Constructor Details
-
ClientPacketListener
public ClientPacketListener(Minecraft p_194193_, Screen p_194194_, Connection p_194195_, com.mojang.authlib.GameProfile p_194196_, ClientTelemetryManager p_194197_)
-
-
Method Details
-
getSuggestionsProvider
-
cleanup
public void cleanup() -
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
-
handleChatPreview
- Specified by:
handleChatPreview
in interfaceClientGamePacketListener
-
handleSetDisplayChatPreview
- Specified by:
handleSetDisplayChatPreview
in interfaceClientGamePacketListener
-
handleChunkBlocksUpdate
- Specified by:
handleChunkBlocksUpdate
in interfaceClientGamePacketListener
-
handleLevelChunkWithLight
- Specified by:
handleLevelChunkWithLight
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
-
handlePlayerChatHeader
- Specified by:
handlePlayerChatHeader
in interfaceClientGamePacketListener
-
handleDeleteChat
- Specified by:
handleDeleteChat
in interfaceClientGamePacketListener
-
handleAnimate
- Specified by:
handleAnimate
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
-
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
-
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
-
handlePlayerInfo
- Specified by:
handlePlayerInfo
in interfaceClientGamePacketListener
-
handleKeepAlive
- Specified by:
handleKeepAlive
in interfaceClientGamePacketListener
-
handlePlayerAbilities
- Specified by:
handlePlayerAbilities
in interfaceClientGamePacketListener
-
handleSoundEvent
- Specified by:
handleSoundEvent
in interfaceClientGamePacketListener
-
handleSoundEntityEvent
- Specified by:
handleSoundEntityEvent
in interfaceClientGamePacketListener
-
handleCustomSoundEvent
- Specified by:
handleCustomSoundEvent
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
-
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
- Specified by:
getConnection
in interfacePacketListener
-
getOnlinePlayers
-
getOnlinePlayerIds
-
getPlayerInfo
-
getPlayerInfo
-
getLocalGameProfile
public com.mojang.authlib.GameProfile getLocalGameProfile() -
getAdvancements
-
getCommands
-
getLevel
-
getDebugQueryHandler
-
getId
-
levels
-
registryAccess
-
signedMessageEncoder
-
generateMessageAcknowledgements
-
markMessageAsProcessed
-