@Environment(value=CLIENT) public class ClientPlayNetworkHandler extends Object implements ClientPlayPacketListener
Modifier and Type | Field and Description |
---|---|
private ClientAdvancementManager |
advancementHandler |
private int |
chunkLoadDistance |
private MinecraftClient |
client |
private com.mojang.brigadier.CommandDispatcher<CommandSource> |
commandDispatcher |
private ClientCommandSource |
commandSource |
private ClientConnection |
connection |
private DataQueryHandler |
dataQueryHandler |
private static Text |
field_26620 |
private static Logger |
LOGGER |
private Screen |
loginScreen |
private Map<UUID,PlayerListEntry> |
playerListEntries |
private boolean |
positionLookSetup |
private com.mojang.authlib.GameProfile |
profile |
private Random |
random |
private RecipeManager |
recipeManager |
private DynamicRegistryManager |
registryManager |
private UUID |
sessionId |
private TagManager |
tagManager |
private ClientWorld |
world |
private Set<RegistryKey<World>> |
worldKeys |
private ClientWorld.Properties |
worldProperties |
Constructor and Description |
---|
ClientPlayNetworkHandler(MinecraftClient client,
Screen screen,
ClientConnection connection,
com.mojang.authlib.GameProfile profile) |
private static final Logger LOGGER
private static final Text field_26620
private final ClientConnection connection
private final com.mojang.authlib.GameProfile profile
private final Screen loginScreen
private MinecraftClient client
private ClientWorld world
private ClientWorld.Properties worldProperties
private boolean positionLookSetup
private final Map<UUID,PlayerListEntry> playerListEntries
private final ClientAdvancementManager advancementHandler
private final ClientCommandSource commandSource
private TagManager tagManager
private final DataQueryHandler dataQueryHandler
private int chunkLoadDistance
private final Random random
private com.mojang.brigadier.CommandDispatcher<CommandSource> commandDispatcher
private final RecipeManager recipeManager
private final UUID sessionId
private Set<RegistryKey<World>> worldKeys
private DynamicRegistryManager registryManager
public ClientPlayNetworkHandler(MinecraftClient client, Screen screen, ClientConnection connection, com.mojang.authlib.GameProfile profile)
public ClientCommandSource getCommandSource()
public void clearWorld()
public RecipeManager getRecipeManager()
public void onGameJoin(GameJoinS2CPacket packet)
onGameJoin
in interface ClientPlayPacketListener
public void onEntitySpawn(EntitySpawnS2CPacket packet)
onEntitySpawn
in interface ClientPlayPacketListener
public void onExperienceOrbSpawn(ExperienceOrbSpawnS2CPacket packet)
onExperienceOrbSpawn
in interface ClientPlayPacketListener
public void onPaintingSpawn(PaintingSpawnS2CPacket packet)
onPaintingSpawn
in interface ClientPlayPacketListener
public void onVelocityUpdate(EntityVelocityUpdateS2CPacket packet)
onVelocityUpdate
in interface ClientPlayPacketListener
public void onEntityTrackerUpdate(EntityTrackerUpdateS2CPacket packet)
onEntityTrackerUpdate
in interface ClientPlayPacketListener
public void onPlayerSpawn(PlayerSpawnS2CPacket packet)
onPlayerSpawn
in interface ClientPlayPacketListener
public void onEntityPosition(EntityPositionS2CPacket packet)
onEntityPosition
in interface ClientPlayPacketListener
public void onHeldItemChange(HeldItemChangeS2CPacket packet)
onHeldItemChange
in interface ClientPlayPacketListener
public void onEntityUpdate(EntityS2CPacket packet)
onEntityUpdate
in interface ClientPlayPacketListener
public void onEntitySetHeadYaw(EntitySetHeadYawS2CPacket packet)
onEntitySetHeadYaw
in interface ClientPlayPacketListener
public void onEntitiesDestroy(EntitiesDestroyS2CPacket packet)
onEntitiesDestroy
in interface ClientPlayPacketListener
public void onPlayerPositionLook(PlayerPositionLookS2CPacket packet)
onPlayerPositionLook
in interface ClientPlayPacketListener
public void onChunkDeltaUpdate(ChunkDeltaUpdateS2CPacket packet)
onChunkDeltaUpdate
in interface ClientPlayPacketListener
public void onChunkData(ChunkDataS2CPacket packet)
onChunkData
in interface ClientPlayPacketListener
public void onUnloadChunk(UnloadChunkS2CPacket packet)
onUnloadChunk
in interface ClientPlayPacketListener
public void onBlockUpdate(BlockUpdateS2CPacket packet)
onBlockUpdate
in interface ClientPlayPacketListener
public void onDisconnect(DisconnectS2CPacket packet)
onDisconnect
in interface ClientPlayPacketListener
public void onDisconnected(Text reason)
onDisconnected
in interface PacketListener
public void sendPacket(Packet<?> packet)
packet
- the packet to sendpublic void onItemPickupAnimation(ItemPickupAnimationS2CPacket packet)
onItemPickupAnimation
in interface ClientPlayPacketListener
public void onGameMessage(GameMessageS2CPacket packet)
onGameMessage
in interface ClientPlayPacketListener
public void onEntityAnimation(EntityAnimationS2CPacket packet)
onEntityAnimation
in interface ClientPlayPacketListener
public void onMobSpawn(MobSpawnS2CPacket packet)
onMobSpawn
in interface ClientPlayPacketListener
public void onWorldTimeUpdate(WorldTimeUpdateS2CPacket packet)
onWorldTimeUpdate
in interface ClientPlayPacketListener
public void onPlayerSpawnPosition(PlayerSpawnPositionS2CPacket packet)
onPlayerSpawnPosition
in interface ClientPlayPacketListener
public void onEntityPassengersSet(EntityPassengersSetS2CPacket packet)
onEntityPassengersSet
in interface ClientPlayPacketListener
public void onEntityAttach(EntityAttachS2CPacket packet)
onEntityAttach
in interface ClientPlayPacketListener
private static ItemStack getActiveTotemOfUndying(PlayerEntity player)
public void onEntityStatus(EntityStatusS2CPacket packet)
onEntityStatus
in interface ClientPlayPacketListener
public void onHealthUpdate(HealthUpdateS2CPacket packet)
onHealthUpdate
in interface ClientPlayPacketListener
public void onExperienceBarUpdate(ExperienceBarUpdateS2CPacket packet)
onExperienceBarUpdate
in interface ClientPlayPacketListener
public void onPlayerRespawn(PlayerRespawnS2CPacket packet)
onPlayerRespawn
in interface ClientPlayPacketListener
public void onExplosion(ExplosionS2CPacket packet)
onExplosion
in interface ClientPlayPacketListener
public void onOpenHorseScreen(OpenHorseScreenS2CPacket packet)
onOpenHorseScreen
in interface ClientPlayPacketListener
public void onOpenScreen(OpenScreenS2CPacket packet)
onOpenScreen
in interface ClientPlayPacketListener
public void onScreenHandlerSlotUpdate(ScreenHandlerSlotUpdateS2CPacket packet)
onScreenHandlerSlotUpdate
in interface ClientPlayPacketListener
public void onGuiActionConfirm(ConfirmGuiActionS2CPacket packet)
onGuiActionConfirm
in interface ClientPlayPacketListener
public void onInventory(InventoryS2CPacket packet)
onInventory
in interface ClientPlayPacketListener
public void onSignEditorOpen(SignEditorOpenS2CPacket packet)
onSignEditorOpen
in interface ClientPlayPacketListener
public void onBlockEntityUpdate(BlockEntityUpdateS2CPacket packet)
onBlockEntityUpdate
in interface ClientPlayPacketListener
public void onScreenHandlerPropertyUpdate(ScreenHandlerPropertyUpdateS2CPacket packet)
onScreenHandlerPropertyUpdate
in interface ClientPlayPacketListener
public void onEquipmentUpdate(EntityEquipmentUpdateS2CPacket packet)
onEquipmentUpdate
in interface ClientPlayPacketListener
public void onCloseScreen(CloseScreenS2CPacket packet)
onCloseScreen
in interface ClientPlayPacketListener
public void onBlockEvent(BlockEventS2CPacket packet)
onBlockEvent
in interface ClientPlayPacketListener
public void onBlockDestroyProgress(BlockBreakingProgressS2CPacket packet)
onBlockDestroyProgress
in interface ClientPlayPacketListener
public void onGameStateChange(GameStateChangeS2CPacket packet)
onGameStateChange
in interface ClientPlayPacketListener
public void onMapUpdate(MapUpdateS2CPacket packet)
onMapUpdate
in interface ClientPlayPacketListener
public void onWorldEvent(WorldEventS2CPacket packet)
onWorldEvent
in interface ClientPlayPacketListener
public void onAdvancements(AdvancementUpdateS2CPacket packet)
onAdvancements
in interface ClientPlayPacketListener
public void onSelectAdvancementTab(SelectAdvancementTabS2CPacket packet)
onSelectAdvancementTab
in interface ClientPlayPacketListener
public void onCommandTree(CommandTreeS2CPacket packet)
onCommandTree
in interface ClientPlayPacketListener
public void onStopSound(StopSoundS2CPacket packet)
onStopSound
in interface ClientPlayPacketListener
public void onCommandSuggestions(CommandSuggestionsS2CPacket packet)
onCommandSuggestions
in interface ClientPlayPacketListener
public void onSynchronizeRecipes(SynchronizeRecipesS2CPacket packet)
onSynchronizeRecipes
in interface ClientPlayPacketListener
public void onLookAt(LookAtS2CPacket packet)
onLookAt
in interface ClientPlayPacketListener
public void onTagQuery(TagQueryResponseS2CPacket packet)
onTagQuery
in interface ClientPlayPacketListener
public void onStatistics(StatisticsS2CPacket packet)
onStatistics
in interface ClientPlayPacketListener
public void onUnlockRecipes(UnlockRecipesS2CPacket packet)
onUnlockRecipes
in interface ClientPlayPacketListener
public void onEntityPotionEffect(EntityStatusEffectS2CPacket packet)
onEntityPotionEffect
in interface ClientPlayPacketListener
public void onSynchronizeTags(SynchronizeTagsS2CPacket packet)
onSynchronizeTags
in interface ClientPlayPacketListener
public void onCombatEvent(CombatEventS2CPacket packet)
onCombatEvent
in interface ClientPlayPacketListener
public void onDifficulty(DifficultyS2CPacket packet)
onDifficulty
in interface ClientPlayPacketListener
public void onSetCameraEntity(SetCameraEntityS2CPacket packet)
onSetCameraEntity
in interface ClientPlayPacketListener
public void onWorldBorder(WorldBorderS2CPacket packet)
onWorldBorder
in interface ClientPlayPacketListener
public void onTitle(TitleS2CPacket packet)
onTitle
in interface ClientPlayPacketListener
public void onPlayerListHeader(PlayerListHeaderS2CPacket packet)
onPlayerListHeader
in interface ClientPlayPacketListener
public void onRemoveEntityEffect(RemoveEntityStatusEffectS2CPacket packet)
onRemoveEntityEffect
in interface ClientPlayPacketListener
public void onPlayerList(PlayerListS2CPacket packet)
onPlayerList
in interface ClientPlayPacketListener
public void onKeepAlive(KeepAliveS2CPacket packet)
onKeepAlive
in interface ClientPlayPacketListener
public void onPlayerAbilities(PlayerAbilitiesS2CPacket packet)
onPlayerAbilities
in interface ClientPlayPacketListener
public void onPlaySound(PlaySoundS2CPacket packet)
onPlaySound
in interface ClientPlayPacketListener
public void onPlaySoundFromEntity(PlaySoundFromEntityS2CPacket packet)
onPlaySoundFromEntity
in interface ClientPlayPacketListener
public void onPlaySoundId(PlaySoundIdS2CPacket packet)
onPlaySoundId
in interface ClientPlayPacketListener
public void onResourcePackSend(ResourcePackSendS2CPacket packet)
onResourcePackSend
in interface ClientPlayPacketListener
private boolean validateResourcePackUrl(String url)
private void feedbackAfterDownload(CompletableFuture<?> downloadFuture)
private void sendResourcePackStatus(ResourcePackStatusC2SPacket.Status packStatus)
public void onBossBar(BossBarS2CPacket packet)
onBossBar
in interface ClientPlayPacketListener
public void onCooldownUpdate(CooldownUpdateS2CPacket packet)
onCooldownUpdate
in interface ClientPlayPacketListener
public void onVehicleMove(VehicleMoveS2CPacket packet)
onVehicleMove
in interface ClientPlayPacketListener
public void onOpenWrittenBook(OpenWrittenBookS2CPacket packet)
onOpenWrittenBook
in interface ClientPlayPacketListener
public void onCustomPayload(CustomPayloadS2CPacket packet)
onCustomPayload
in interface ClientPlayPacketListener
public void onScoreboardObjectiveUpdate(ScoreboardObjectiveUpdateS2CPacket packet)
onScoreboardObjectiveUpdate
in interface ClientPlayPacketListener
public void onScoreboardPlayerUpdate(ScoreboardPlayerUpdateS2CPacket packet)
onScoreboardPlayerUpdate
in interface ClientPlayPacketListener
public void onScoreboardDisplay(ScoreboardDisplayS2CPacket packet)
onScoreboardDisplay
in interface ClientPlayPacketListener
public void onTeam(TeamS2CPacket packet)
onTeam
in interface ClientPlayPacketListener
public void onParticle(ParticleS2CPacket packet)
onParticle
in interface ClientPlayPacketListener
public void onEntityAttributes(EntityAttributesS2CPacket packet)
onEntityAttributes
in interface ClientPlayPacketListener
public void onCraftFailedResponse(CraftFailedResponseS2CPacket packet)
onCraftFailedResponse
in interface ClientPlayPacketListener
public void onLightUpdate(LightUpdateS2CPacket packet)
onLightUpdate
in interface ClientPlayPacketListener
public void onSetTradeOffers(SetTradeOffersS2CPacket packet)
onSetTradeOffers
in interface ClientPlayPacketListener
public void onChunkLoadDistance(ChunkLoadDistanceS2CPacket packet)
onChunkLoadDistance
in interface ClientPlayPacketListener
public void onChunkRenderDistanceCenter(ChunkRenderDistanceCenterS2CPacket packet)
onChunkRenderDistanceCenter
in interface ClientPlayPacketListener
public void onPlayerActionResponse(PlayerActionResponseS2CPacket packet)
onPlayerActionResponse
in interface ClientPlayPacketListener
private void updateLighting(int chunkX, int chunkZ, LightingProvider provider, LightType type, int mask, int filledMask, Iterator<byte[]> updates, boolean bool)
public ClientConnection getConnection()
getConnection
in interface PacketListener
public Collection<PlayerListEntry> getPlayerList()
public Collection<UUID> getPlayerUuids()
@Nullable public PlayerListEntry getPlayerListEntry(UUID uuid)
@Nullable public PlayerListEntry getPlayerListEntry(String profileName)
public com.mojang.authlib.GameProfile getProfile()
public ClientAdvancementManager getAdvancementHandler()
public com.mojang.brigadier.CommandDispatcher<CommandSource> getCommandDispatcher()
public ClientWorld getWorld()
public TagManager getTagManager()
public DataQueryHandler getDataQueryHandler()
public UUID getSessionId()
public Set<RegistryKey<World>> getWorldKeys()
public DynamicRegistryManager getRegistryManager()