Перейти к основному содержимому

IPacket<TSelf>

interface

Defines a protocol type that is a top-level packet and therefore carries an identity and per-version wire ids.

Declaration

public interface IPacket<TSelf> : IProtocolType<TSelf> where TSelf : class, IPacket<TSelf>
NamespaceMcProtoNet.Protocol
AssemblyMcProtoNet.Protocol.dll
Sourcesrc/McProtoNet.Protocol/Flow/IPacket.cs#L38 ↗

Derived: AddResourcePackPacket, ClearDialogPacket, CodeOfConductPacket, CookieRequestPacket, CustomPayloadPacket, CustomReportDetailsPacket, DisconnectPacket, FeatureFlagsPacket, FinishConfigurationPacket, KeepAlivePacket, PingPacket, RemoveResourcePackPacket, ResetChatPacket, ResourcePackSendPacket, SelectKnownPacksPacket, ShowDialogPacket, StoreCookiePacket, TagsPacket, TransferPacket, AcceptCodeOfConductPacket, ClientInformationPacket, CookieResponsePacket, CustomClickActionPacket, CustomPayloadPacket, CustomReportDetailsPacket, FinishConfigurationPacket, KeepAlivePacket, PongPacket, ResourcePackReceivePacket, SelectKnownPacksPacket, LegacyServerListPingPacket, SetProtocolPacket, EncryptionRequestPacket, LoginCompressPacket, LoginCookieRequestPacket, LoginDisconnectPacket, LoginPluginRequestPacket, LoginSuccessPacket, EncryptionResponsePacket, LoginAcknowledgedPacket, LoginCookieResponsePacket, LoginPluginResponsePacket, LoginStartPacket, AbilitiesPacket, AcknowledgePlayerDiggingPacket, ActionBarPacket, AddResourcePackPacket, AnimationPacket, AttachEntityPacket, BlockActionPacket, BlockBreakAnimationPacket, BlockChangePacket, CameraPacket, ChatPacket, ChatPreviewPacket, ChatSuggestionsPacket, ChunkBatchFinishedPacket, ChunkBatchStartPacket, ChunkBiomesPacket, ClearDialogPacket, ClearTitlesPacket, CloseWindowPacket, CollectPacket, CookieRequestPacket, CraftProgressBarPacket, CustomPayloadPacket, CustomReportDetailsPacket, DamageEventPacket, DeathCombatEventPacket, DebugSamplePacket, DestroyEntityPacket, DifficultyPacket, EndCombatEventPacket, EnterCombatEventPacket, EntityDestroyPacket, EntityHeadRotationPacket, EntityLookPacket, EntityMoveLookPacket, EntityPacket, EntityStatusPacket, EntityTeleportPacket, EntityUpdateAttributesPacket, EntityVelocityPacket, ExperiencePacket, FeatureFlagsPacket, GameRuleValuesPacket, GameStateChangePacket, GameTestHighlightPosPacket, HeldItemSlotPacket, HurtAnimationPacket, InitializeWorldBorderPacket, KeepAlivePacket, KickDisconnectPacket, LoginPacket, LowDiskSpaceWarningPacket, MessageHeaderPacket, MoveMinecartPacket, NamedEntitySpawnPacket, NamedSoundEffectPacket, NbtQueryResponsePacket, OpenBookPacket, OpenHorseWindowPacket, OpenSignEntityPacket, OpenWindowPacket, PingPacket, PingResponsePacket, PlayerChatPacket, PlayerPositionPacket, PlayerRemovePacket, PlayerRotationPacket, PlayerlistHeaderPacket, ProfilelessChatPacket, RecipeBookRemovePacket, RelEntityMovePacket, RemoveEntityEffectPacket, RemoveResourcePackPacket, ResetScorePacket, ResourcePackSendPacket, RespawnPacket, ScoreboardDisplayObjectivePacket, SelectAdvancementTabPacket, ServerDataPacket, SetCooldownPacket, SetPassengersPacket, SetProjectilePowerPacket, SetTickingStatePacket, SetTitleSubtitlePacket, SetTitleTextPacket, SetTitleTimePacket, ShouldDisplayChatPreviewPacket, SimulationDistancePacket, SpawnEntityExperienceOrbPacket, SpawnEntityLivingPacket, SpawnEntityPacket, SpawnEntityPaintingPacket, SpawnPositionPacket, StartConfigurationPacket, StatisticsPacket, StepTickPacket, StoreCookiePacket, SyncEntityPositionPacket, SystemChatPacket, TabCompletePacket, TagsPacket, TeamsPacket, TestInstanceBlockStatusPacket, TileEntityDataPacket, TransactionPacket, TransferPacket, UnloadChunkPacket, UpdateHealthPacket, UpdateLightPacket, UpdateTimePacket, UpdateViewDistancePacket, UpdateViewPositionPacket, VehicleMovePacket, WorldBorderCenterPacket, WorldBorderLerpSizePacket, WorldBorderSizePacket, WorldBorderWarningDelayPacket, WorldBorderWarningReachPacket, WorldEventPacket, AbilitiesPacket, ArmAnimationPacket, AttackPacket, BlockDigPacket, BlockPlacePacket, ChangeGamemodePacket, ChatCommandPacket, ChatCommandSignedPacket, ChatMessagePacket, ChatPacket, ChatPreviewPacket, ChatSessionUpdatePacket, ChunkBatchReceivedPacket, ClientCommandPacket, CloseWindowPacket, ConfigurationAcknowledgedPacket, CookieResponsePacket, CraftRecipeRequestPacket, CustomClickActionPacket, CustomPayloadPacket, DebugSampleSubscriptionPacket, DisplayedRecipePacket, EnchantItemPacket, EntityActionPacket, FlyingPacket, GenerateStructurePacket, HeldItemSlotPacket, KeepAlivePacket, LockDifficultyPacket, LookPacket, NameItemPacket, PickItemFromBlockPacket, PickItemFromEntityPacket, PickItemPacket, PingRequestPacket, PlayerInputPacket, PlayerLoadedPacket, PongPacket, PositionLookPacket, PositionPacket, QueryBlockNbtPacket, QueryEntityNbtPacket, RecipeBookPacket, ResourcePackReceivePacket, SelectBundleItemPacket, SelectTradePacket, SetBeaconEffectPacket, SetDifficultyPacket, SetGameRulePacket, SetSlotStatePacket, SetTestBlockPacket, SpectateEntityPacket, SpectatePacket, SteerBoatPacket, SteerVehiclePacket, TabCompletePacket, TeleportConfirmPacket, TickEndPacket, TransactionPacket, UpdateCommandBlockMinecartPacket, UpdateCommandBlockPacket, UpdateJigsawBlockPacket, UpdateSignPacket, UpdateStructureBlockPacket, UseEntityPacket, UseItemPacket, VehicleMovePacket, PongResponsePacket, ServerInfoPacket, PingRequestPacket, PingStartPacket

Remarks

Nested protocol types, such as a slot or a login signature, implement IProtocolType<TSelf> instead. Packets are classes, so a packet costs one allocation and dispatch does not box.

Properties

SignatureDescription
static PacketIdentity IdentityGets the identity of the packet type.

Identity

public static abstract PacketIdentity Identity { get; }

Gets the identity of the packet type.

Returns: PacketIdentity

Methods

SignatureDescription
static bool TryGetPacketId(int protocolVersion, out int id)Attempts to get the wire id of the packet for the specified protocol version.

TryGetPacketId(int, out int)

public static abstract bool TryGetPacketId(int protocolVersion, out int id)

Attempts to get the wire id of the packet for the specified protocol version.

Parameters: protocolVersion (Int32), id (Int32)

Returns: Boolean - <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool"&gt;true&lt;/a> if the packet exists on the specified protocol version; otherwise, <a href="https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool"&gt;false&lt;/a>.