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
Nested ClassesModifier and TypeClassDescription(package private) static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClientAdvancementsprivate final Screenprivate static final Componentprivate LocalChatSessioncom.mojang.brigadier.CommandDispatcher<SharedSuggestionProvider>private final Connectionprivate final DebugQueryHandlerprivate final List<ClientPacketListener.DeferredPacket>private FeatureFlagSetprivate static final Componentprivate final UUIDprivate static final Componentprivate LastSeenMessagesTrackerprivate ClientLevelprivate ClientLevel.ClientLevelDataprivate Set<ResourceKey<Level>>private final Set<PlayerInfo>private final com.mojang.authlib.GameProfileprivate static final org.slf4j.Loggerprivate MessageSignatureCacheprivate final Minecraftprivate static final intprivate final Map<UUID,PlayerInfo> private final RandomSourceprivate final RecipeManagerprivate LayeredRegistryAccess<ClientRegistryLayer>private intprivate final ServerDataprivate intprivate SignedMessageChain.Encoderprivate final ClientSuggestionProviderprivate final WorldSessionTelemetryManagerprivate static final Componentprivate static final Component -
Constructor Summary
ConstructorsConstructorDescriptionClientPacketListener(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 voidapplyLightData(int p_194249_, int p_194250_, ClientboundLightUpdatePacketData p_194251_) private voidapplyPlayerInfoUpdate(ClientboundPlayerInfoUpdatePacket.Action p_248954_, ClientboundPlayerInfoUpdatePacket.Entry p_251310_, PlayerInfo p_251146_) voidclose()private voiddownloadCallback(CompletableFuture<?> p_104952_) private voidenableChunkLight(LevelChunk p_194213_, int p_194214_, int p_194215_) private booleanprivate static ItemStackcom.mojang.brigadier.CommandDispatcher<SharedSuggestionProvider>getId()getLevel()com.mojang.authlib.GameProfilegetPlayerInfo(String p_104939_) getPlayerInfo(UUID p_104950_) voidhandleAddEntity(ClientboundAddEntityPacket p_104958_) voidvoidhandleAddObjective(ClientboundSetObjectivePacket p_105100_) voidhandleAddOrRemoveRecipes(ClientboundRecipePacket p_105058_) voidhandleAddPlayer(ClientboundAddPlayerPacket p_104966_) voidhandleAnimate(ClientboundAnimatePacket p_104968_) voidhandleAwardStats(ClientboundAwardStatsPacket p_104970_) voidvoidvoidvoidhandleBlockEvent(ClientboundBlockEventPacket p_104978_) voidhandleBlockUpdate(ClientboundBlockUpdatePacket p_104980_) voidhandleBossUpdate(ClientboundBossEventPacket p_104982_) voidhandleBundlePacket(ClientboundBundlePacket p_265195_) voidvoidvoidhandleChunksBiomes(ClientboundChunksBiomesPacket p_275437_) voidhandleCommands(ClientboundCommandsPacket p_104990_) voidvoidvoidvoidvoidvoidvoidvoidhandleDamageEvent(ClientboundDamageEventPacket p_270800_) voidhandleDeleteChat(ClientboundDeleteChatPacket p_241325_) voidhandleDisconnect(ClientboundDisconnectPacket p_105008_) voidvoidvoidhandleEntityEvent(ClientboundEntityEventPacket p_105010_) voidvoidhandleExplosion(ClientboundExplodePacket p_105012_) voidvoidhandleGameEvent(ClientboundGameEventPacket p_105016_) voidvoidvoidvoidhandleItemCooldown(ClientboundCooldownPacket p_105002_) voidhandleKeepAlive(ClientboundKeepAlivePacket p_105020_) voidvoidhandleLevelEvent(ClientboundLevelEventPacket p_105024_) voidvoidhandleLogin(ClientboundLoginPacket p_105030_) voidhandleLookAt(ClientboundPlayerLookAtPacket p_105054_) voidhandleMapItemData(ClientboundMapItemDataPacket p_105032_) voidvoidhandleMoveEntity(ClientboundMoveEntityPacket p_105036_) voidhandleMovePlayer(ClientboundPlayerPositionPacket p_105056_) voidhandleMoveVehicle(ClientboundMoveVehiclePacket p_105038_) voidhandleOpenBook(ClientboundOpenBookPacket p_105040_) voidhandleOpenScreen(ClientboundOpenScreenPacket p_105042_) voidvoidvoidhandlePing(ClientboundPingPacket p_171769_) voidvoidvoidhandlePlayerChat(ClientboundPlayerChatPacket p_233702_) voidvoidvoidvoidvoidvoidvoidvoidhandleResourcePack(ClientboundResourcePackPacket p_105064_) voidhandleRespawn(ClientboundRespawnPacket p_105066_) voidhandleRotateMob(ClientboundRotateHeadPacket p_105068_) voidvoidhandleServerData(ClientboundServerDataPacket p_233704_) voidvoidvoidvoidvoidvoidhandleSetCamera(ClientboundSetCameraPacket p_105076_) voidvoidvoidvoidvoidvoidvoidvoidhandleSetEquipment(ClientboundSetEquipmentPacket p_105094_) voidvoidhandleSetHealth(ClientboundSetHealthPacket p_105098_) voidvoidhandleSetScore(ClientboundSetScorePacket p_105106_) voidvoidvoidhandleSetTime(ClientboundSetTimePacket p_105108_) voidvoidhandleSoundEvent(ClientboundSoundPacket p_105114_) voidhandleStopSoundEvent(ClientboundStopSoundPacket p_105116_) voidhandleSystemChat(ClientboundSystemChatPacket p_233708_) voidvoidhandleTagQueryPacket(ClientboundTagQueryPacket p_105120_) voidvoidvoidhandleTitlesClear(ClientboundClearTitlesPacket p_171765_) voidvoidvoidvoidvoidhandleUpdateTags(ClientboundUpdateTagsPacket p_105134_) private voidinitializeChatSession(ClientboundPlayerInfoUpdatePacket.Entry p_248806_, PlayerInfo p_251136_) booleanbooleanisFeatureEnabled(FeatureFlagSet p_250605_) levels()voidmarkMessageAsProcessed(PlayerChatMessage p_242356_, boolean p_242455_) voidonDisconnect(Component p_104954_) private com.mojang.brigadier.ParseResults<SharedSuggestionProvider>parseCommand(String p_249982_) private static URLparseResourcePackUrl(String p_233710_) private voidpostAddEntitySoundInstance(Entity p_233664_) private static ComponentpreparePackPrompt(Component p_171760_, Component p_171761_) private voidprivate voidreadSectionList(int p_171735_, int p_171736_, LevelLightEngine p_171737_, LightLayer p_171738_, BitSet p_171739_, BitSet p_171740_, Iterator<byte[]> p_171741_) private voidsend(ServerboundResourcePackPacket.Action p_105136_) voidvoidprivate voidvoidsendCommand(String p_250092_) private voidbooleansendUnsignedCommand(String p_251509_) private voidsendWhen(Packet<ServerGamePacketListener> p_270433_, BooleanSupplier p_270843_, Duration p_270497_) voidvoidsetKeyPair(ProfileKeyPair p_261475_) voidsetSubtitleText(ClientboundSetSubtitleTextPacket p_171791_) voidvoidsetTitleText(ClientboundSetTitleTextPacket p_171793_) voidtick()private voidupdateLevelChunk(int p_194199_, int p_194200_, ClientboundLevelChunkPacketData p_194201_) private <T> voidupdateTagsForRegistry(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, waitMethods 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:
handleLoginin interfaceClientGamePacketListener
-
handleAddEntity
- Specified by:
handleAddEntityin interfaceClientGamePacketListener
-
postAddEntitySoundInstance
-
handleAddExperienceOrb
- Specified by:
handleAddExperienceOrbin interfaceClientGamePacketListener
-
handleSetEntityMotion
- Specified by:
handleSetEntityMotionin interfaceClientGamePacketListener
-
handleSetEntityData
- Specified by:
handleSetEntityDatain interfaceClientGamePacketListener
-
handleAddPlayer
- Specified by:
handleAddPlayerin interfaceClientGamePacketListener
-
handleTeleportEntity
- Specified by:
handleTeleportEntityin interfaceClientGamePacketListener
-
handleSetCarriedItem
- Specified by:
handleSetCarriedItemin interfaceClientGamePacketListener
-
handleMoveEntity
- Specified by:
handleMoveEntityin interfaceClientGamePacketListener
-
handleRotateMob
- Specified by:
handleRotateMobin interfaceClientGamePacketListener
-
handleRemoveEntities
- Specified by:
handleRemoveEntitiesin interfaceClientGamePacketListener
-
handleMovePlayer
- Specified by:
handleMovePlayerin interfaceClientGamePacketListener
-
handleChunkBlocksUpdate
- Specified by:
handleChunkBlocksUpdatein interfaceClientGamePacketListener
-
handleLevelChunkWithLight
- Specified by:
handleLevelChunkWithLightin interfaceClientGamePacketListener
-
handleChunksBiomes
- Specified by:
handleChunksBiomesin interfaceClientGamePacketListener
-
updateLevelChunk
private void updateLevelChunk(int p_194199_, int p_194200_, ClientboundLevelChunkPacketData p_194201_) -
enableChunkLight
-
handleForgetLevelChunk
- Specified by:
handleForgetLevelChunkin interfaceClientGamePacketListener
-
queueLightRemoval
-
handleBlockUpdate
- Specified by:
handleBlockUpdatein interfaceClientGamePacketListener
-
handleDisconnect
- Specified by:
handleDisconnectin interfaceClientGamePacketListener
-
onDisconnect
- Specified by:
onDisconnectin interfacePacketListener
-
send
-
handleTakeItemEntity
- Specified by:
handleTakeItemEntityin interfaceClientGamePacketListener
-
handleSystemChat
- Specified by:
handleSystemChatin interfaceClientGamePacketListener
-
handlePlayerChat
- Specified by:
handlePlayerChatin interfaceClientGamePacketListener
-
handleDisguisedChat
- Specified by:
handleDisguisedChatin interfaceClientGamePacketListener
-
handleDeleteChat
- Specified by:
handleDeleteChatin interfaceClientGamePacketListener
-
handleAnimate
- Specified by:
handleAnimatein interfaceClientGamePacketListener
-
handleHurtAnimation
- Specified by:
handleHurtAnimationin interfaceClientGamePacketListener
-
handleSetTime
- Specified by:
handleSetTimein interfaceClientGamePacketListener
-
handleSetSpawn
- Specified by:
handleSetSpawnin interfaceClientGamePacketListener
-
handleSetEntityPassengersPacket
- Specified by:
handleSetEntityPassengersPacketin interfaceClientGamePacketListener
-
handleEntityLinkPacket
- Specified by:
handleEntityLinkPacketin interfaceClientGamePacketListener
-
findTotem
-
handleEntityEvent
- Specified by:
handleEntityEventin interfaceClientGamePacketListener
-
handleDamageEvent
- Specified by:
handleDamageEventin interfaceClientGamePacketListener
-
handleSetHealth
- Specified by:
handleSetHealthin interfaceClientGamePacketListener
-
handleSetExperience
- Specified by:
handleSetExperiencein interfaceClientGamePacketListener
-
handleRespawn
- Specified by:
handleRespawnin interfaceClientGamePacketListener
-
handleExplosion
- Specified by:
handleExplosionin interfaceClientGamePacketListener
-
handleHorseScreenOpen
- Specified by:
handleHorseScreenOpenin interfaceClientGamePacketListener
-
handleOpenScreen
- Specified by:
handleOpenScreenin interfaceClientGamePacketListener
-
handleContainerSetSlot
- Specified by:
handleContainerSetSlotin interfaceClientGamePacketListener
-
handleContainerContent
- Specified by:
handleContainerContentin interfaceClientGamePacketListener
-
handleOpenSignEditor
- Specified by:
handleOpenSignEditorin interfaceClientGamePacketListener
-
handleBlockEntityData
- Specified by:
handleBlockEntityDatain interfaceClientGamePacketListener
-
handleContainerSetData
- Specified by:
handleContainerSetDatain interfaceClientGamePacketListener
-
handleSetEquipment
- Specified by:
handleSetEquipmentin interfaceClientGamePacketListener
-
handleContainerClose
- Specified by:
handleContainerClosein interfaceClientGamePacketListener
-
handleBlockEvent
- Specified by:
handleBlockEventin interfaceClientGamePacketListener
-
handleBlockDestruction
- Specified by:
handleBlockDestructionin interfaceClientGamePacketListener
-
handleGameEvent
- Specified by:
handleGameEventin interfaceClientGamePacketListener
-
handleMapItemData
- Specified by:
handleMapItemDatain interfaceClientGamePacketListener
-
handleLevelEvent
- Specified by:
handleLevelEventin interfaceClientGamePacketListener
-
handleUpdateAdvancementsPacket
- Specified by:
handleUpdateAdvancementsPacketin interfaceClientGamePacketListener
-
handleSelectAdvancementsTab
- Specified by:
handleSelectAdvancementsTabin interfaceClientGamePacketListener
-
handleCommands
- Specified by:
handleCommandsin interfaceClientGamePacketListener
-
handleStopSoundEvent
- Specified by:
handleStopSoundEventin interfaceClientGamePacketListener
-
handleCommandSuggestions
- Specified by:
handleCommandSuggestionsin interfaceClientGamePacketListener
-
handleUpdateRecipes
- Specified by:
handleUpdateRecipesin interfaceClientGamePacketListener
-
handleLookAt
- Specified by:
handleLookAtin interfaceClientGamePacketListener
-
handleTagQueryPacket
- Specified by:
handleTagQueryPacketin interfaceClientGamePacketListener
-
handleAwardStats
- Specified by:
handleAwardStatsin interfaceClientGamePacketListener
-
handleAddOrRemoveRecipes
- Specified by:
handleAddOrRemoveRecipesin interfaceClientGamePacketListener
-
handleUpdateMobEffect
- Specified by:
handleUpdateMobEffectin interfaceClientGamePacketListener
-
handleUpdateTags
- Specified by:
handleUpdateTagsin interfaceClientGamePacketListener
-
handleEnabledFeatures
- Specified by:
handleEnabledFeaturesin interfaceClientGamePacketListener
-
updateTagsForRegistry
private <T> void updateTagsForRegistry(ResourceKey<? extends Registry<? extends T>> p_205561_, TagNetworkSerialization.NetworkPayload p_205562_) -
handlePlayerCombatEnd
- Specified by:
handlePlayerCombatEndin interfaceClientGamePacketListener
-
handlePlayerCombatEnter
- Specified by:
handlePlayerCombatEnterin interfaceClientGamePacketListener
-
handlePlayerCombatKill
- Specified by:
handlePlayerCombatKillin interfaceClientGamePacketListener
-
handleChangeDifficulty
- Specified by:
handleChangeDifficultyin interfaceClientGamePacketListener
-
handleSetCamera
- Specified by:
handleSetCamerain interfaceClientGamePacketListener
-
handleInitializeBorder
- Specified by:
handleInitializeBorderin interfaceClientGamePacketListener
-
handleSetBorderCenter
- Specified by:
handleSetBorderCenterin interfaceClientGamePacketListener
-
handleSetBorderLerpSize
- Specified by:
handleSetBorderLerpSizein interfaceClientGamePacketListener
-
handleSetBorderSize
- Specified by:
handleSetBorderSizein interfaceClientGamePacketListener
-
handleSetBorderWarningDistance
- Specified by:
handleSetBorderWarningDistancein interfaceClientGamePacketListener
-
handleSetBorderWarningDelay
- Specified by:
handleSetBorderWarningDelayin interfaceClientGamePacketListener
-
handleTitlesClear
- Specified by:
handleTitlesClearin interfaceClientGamePacketListener
-
handleServerData
- Specified by:
handleServerDatain interfaceClientGamePacketListener
-
handleCustomChatCompletions
- Specified by:
handleCustomChatCompletionsin interfaceClientGamePacketListener
-
setActionBarText
- Specified by:
setActionBarTextin interfaceClientGamePacketListener
-
setTitleText
- Specified by:
setTitleTextin interfaceClientGamePacketListener
-
setSubtitleText
- Specified by:
setSubtitleTextin interfaceClientGamePacketListener
-
setTitlesAnimation
- Specified by:
setTitlesAnimationin interfaceClientGamePacketListener
-
handleTabListCustomisation
- Specified by:
handleTabListCustomisationin interfaceClientGamePacketListener
-
handleRemoveMobEffect
- Specified by:
handleRemoveMobEffectin interfaceClientGamePacketListener
-
handlePlayerInfoRemove
- Specified by:
handlePlayerInfoRemovein interfaceClientGamePacketListener
-
handlePlayerInfoUpdate
- Specified by:
handlePlayerInfoUpdatein 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:
handleKeepAlivein interfaceClientGamePacketListener
-
sendWhen
private void sendWhen(Packet<ServerGamePacketListener> p_270433_, BooleanSupplier p_270843_, Duration p_270497_) -
sendDeferredPackets
private void sendDeferredPackets() -
handlePlayerAbilities
- Specified by:
handlePlayerAbilitiesin interfaceClientGamePacketListener
-
handleSoundEvent
- Specified by:
handleSoundEventin interfaceClientGamePacketListener
-
handleSoundEntityEvent
- Specified by:
handleSoundEntityEventin interfaceClientGamePacketListener
-
handleResourcePack
- Specified by:
handleResourcePackin interfaceClientGamePacketListener
-
preparePackPrompt
-
parseResourcePackUrl
-
downloadCallback
-
send
-
handleBossUpdate
- Specified by:
handleBossUpdatein interfaceClientGamePacketListener
-
handleItemCooldown
- Specified by:
handleItemCooldownin interfaceClientGamePacketListener
-
handleMoveVehicle
- Specified by:
handleMoveVehiclein interfaceClientGamePacketListener
-
handleOpenBook
- Specified by:
handleOpenBookin interfaceClientGamePacketListener
-
handleCustomPayload
- Specified by:
handleCustomPayloadin interfaceClientGamePacketListener
-
handleAddObjective
- Specified by:
handleAddObjectivein interfaceClientGamePacketListener
-
handleSetScore
- Specified by:
handleSetScorein interfaceClientGamePacketListener
-
handleSetDisplayObjective
- Specified by:
handleSetDisplayObjectivein interfaceClientGamePacketListener
-
handleSetPlayerTeamPacket
- Specified by:
handleSetPlayerTeamPacketin interfaceClientGamePacketListener
-
handleParticleEvent
- Specified by:
handleParticleEventin interfaceClientGamePacketListener
-
handlePing
- Specified by:
handlePingin interfaceClientGamePacketListener
-
handleUpdateAttributes
- Specified by:
handleUpdateAttributesin interfaceClientGamePacketListener
-
handlePlaceRecipe
- Specified by:
handlePlaceRecipein interfaceClientGamePacketListener
-
handleLightUpdatePacket
- Specified by:
handleLightUpdatePacketin interfaceClientGamePacketListener
-
applyLightData
private void applyLightData(int p_194249_, int p_194250_, ClientboundLightUpdatePacketData p_194251_) -
handleMerchantOffers
- Specified by:
handleMerchantOffersin interfaceClientGamePacketListener
-
handleSetChunkCacheRadius
- Specified by:
handleSetChunkCacheRadiusin interfaceClientGamePacketListener
-
handleSetSimulationDistance
- Specified by:
handleSetSimulationDistancein interfaceClientGamePacketListener
-
handleSetChunkCacheCenter
- Specified by:
handleSetChunkCacheCenterin interfaceClientGamePacketListener
-
handleBlockChangedAck
- Specified by:
handleBlockChangedAckin interfaceClientGamePacketListener
-
handleBundlePacket
- Specified by:
handleBundlePacketin 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_) -
getConnection
-
isAcceptingMessages
public boolean isAcceptingMessages()- Specified by:
isAcceptingMessagesin 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:
tickin interfaceTickablePacketListener
-
setKeyPair
-
getServerData
-
enabledFeatures
-
isFeatureEnabled
-