use more standard packet id names
This commit is contained in:
@ -8,13 +8,13 @@ func _() {
|
|||||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||||
// Re-run the stringer command to generate them again.
|
// Re-run the stringer command to generate them again.
|
||||||
var x [1]struct{}
|
var x [1]struct{}
|
||||||
_ = x[ClientboundLoginDisconnect-0]
|
_ = x[ClientboundLoginLoginDisconnect-0]
|
||||||
_ = x[ClientboundLoginEncryptionRequest-1]
|
_ = x[ClientboundLoginHello-1]
|
||||||
_ = x[ClientboundLoginSuccess-2]
|
_ = x[ClientboundLoginGameProfile-2]
|
||||||
_ = x[ClientboundLoginCompression-3]
|
_ = x[ClientboundLoginLoginCompression-3]
|
||||||
_ = x[ClientboundLoginPluginRequest-4]
|
_ = x[ClientboundLoginCustomQuery-4]
|
||||||
_ = x[ClientboundLoginCookieRequest-5]
|
_ = x[ClientboundLoginCookieRequest-5]
|
||||||
_ = x[ClientboundStatusResponse-0]
|
_ = x[ClientboundStatusStatusResponse-0]
|
||||||
_ = x[ClientboundStatusPongResponse-1]
|
_ = x[ClientboundStatusPongResponse-1]
|
||||||
_ = x[ClientboundConfigCookieRequest-0]
|
_ = x[ClientboundConfigCookieRequest-0]
|
||||||
_ = x[ClientboundConfigCustomPayload-1]
|
_ = x[ClientboundConfigCustomPayload-1]
|
||||||
@ -160,9 +160,9 @@ func _() {
|
|||||||
_ = x[ClientboundPacketIDGuard-124]
|
_ = x[ClientboundPacketIDGuard-124]
|
||||||
}
|
}
|
||||||
|
|
||||||
const _ClientboundPacketID_name = "ClientboundLoginDisconnectClientboundLoginEncryptionRequestClientboundLoginSuccessClientboundLoginCompressionClientboundLoginPluginRequestClientboundLoginCookieRequestClientboundConfigResetChatClientboundConfigRegistryDataClientboundConfigResourcePackPopClientboundConfigResourcePackPushClientboundConfigStoreCookieClientboundConfigTransferClientboundConfigUpdateEnabledFeaturesClientboundConfigUpdateTagsClientboundConfigSelectKnownPacksClientboundConfigCustomReportDetailsClientboundConfigServerLinksClientboundCommandsClientboundContainerCloseClientboundContainerSetContentClientboundContainerSetDataClientboundContainerSetSlotClientboundCookieRequestClientboundCooldownClientboundCustomChatCompletionsClientboundCustomPayloadClientboundDamageEventClientboundDebugSampleClientboundDeleteChatClientboundDisconnectClientboundDisguisedChatClientboundEntityEventClientboundExplodeClientboundForgetLevelChunkClientboundGameEventClientboundHorseScreenOpenClientboundHurtAnimationClientboundInitializeBorderClientboundKeepAliveClientboundLevelChunkWithLightClientboundLevelEventClientboundLevelParticlesClientboundLightUpdateClientboundLoginClientboundMapItemDataClientboundMerchantOffersClientboundMoveEntityPosClientboundMoveEntityPosRotClientboundMoveEntityRotClientboundMoveVehicleClientboundOpenBookClientboundOpenScreenClientboundOpenSignEditorClientboundPingClientboundPongResponseClientboundPlaceGhostRecipeClientboundPlayerAbilitiesClientboundPlayerChatClientboundPlayerCombatEndClientboundPlayerCombatEnterClientboundPlayerCombatKillClientboundPlayerInfoRemoveClientboundPlayerInfoUpdateClientboundPlayerLookAtClientboundPlayerPositionClientboundRecipeClientboundRemoveEntitiesClientboundRemoveMobEffectClientboundResetScoreClientboundResourcePackPopClientboundResourcePackPushClientboundRespawnClientboundRotateHeadClientboundSectionBlocksUpdateClientboundSelectAdvancementsTabClientboundServerDataClientboundSetActionBarTextClientboundSetBorderCenterClientboundSetBorderLerpSizeClientboundSetBorderSizeClientboundSetBorderWarningDelayClientboundSetBorderWarningDistanceClientboundSetCameraClientboundSetCarriedItemClientboundSetChunkCacheCenterClientboundSetChunkCacheRadiusClientboundSetDefaultSpawnPositionClientboundSetDisplayObjectiveClientboundSetEntityDataClientboundSetEntityLinkClientboundSetEntityMotionClientboundSetEquipmentClientboundSetExperienceClientboundSetHealthClientboundSetObjectiveClientboundSetPassengersClientboundSetPlayerTeamClientboundSetScoreClientboundSetSimulationDistanceClientboundSetSubtitleTextClientboundSetTimeClientboundSetTitleTextClientboundSetTitlesAnimationClientboundSoundEntityClientboundSoundClientboundStartConfigurationClientboundStopSoundClientboundStoreCookieClientboundSystemChatClientboundTabListClientboundTagQueryClientboundTakeItemEntityClientboundTeleportEntityClientboundTickingStateClientboundTickingStepClientboundTransferClientboundUpdateAdvancementsClientboundUpdateAttributesClientboundUpdateMobEffectClientboundUpdateRecipesClientboundUpdateTagsClientboundProjectilePowerClientboundCustomReportDetailsClientboundServerLinksClientboundPacketIDGuard"
|
const _ClientboundPacketID_name = "ClientboundLoginLoginDisconnectClientboundLoginHelloClientboundLoginGameProfileClientboundLoginLoginCompressionClientboundLoginCustomQueryClientboundLoginCookieRequestClientboundConfigResetChatClientboundConfigRegistryDataClientboundConfigResourcePackPopClientboundConfigResourcePackPushClientboundConfigStoreCookieClientboundConfigTransferClientboundConfigUpdateEnabledFeaturesClientboundConfigUpdateTagsClientboundConfigSelectKnownPacksClientboundConfigCustomReportDetailsClientboundConfigServerLinksClientboundCommandsClientboundContainerCloseClientboundContainerSetContentClientboundContainerSetDataClientboundContainerSetSlotClientboundCookieRequestClientboundCooldownClientboundCustomChatCompletionsClientboundCustomPayloadClientboundDamageEventClientboundDebugSampleClientboundDeleteChatClientboundDisconnectClientboundDisguisedChatClientboundEntityEventClientboundExplodeClientboundForgetLevelChunkClientboundGameEventClientboundHorseScreenOpenClientboundHurtAnimationClientboundInitializeBorderClientboundKeepAliveClientboundLevelChunkWithLightClientboundLevelEventClientboundLevelParticlesClientboundLightUpdateClientboundLoginClientboundMapItemDataClientboundMerchantOffersClientboundMoveEntityPosClientboundMoveEntityPosRotClientboundMoveEntityRotClientboundMoveVehicleClientboundOpenBookClientboundOpenScreenClientboundOpenSignEditorClientboundPingClientboundPongResponseClientboundPlaceGhostRecipeClientboundPlayerAbilitiesClientboundPlayerChatClientboundPlayerCombatEndClientboundPlayerCombatEnterClientboundPlayerCombatKillClientboundPlayerInfoRemoveClientboundPlayerInfoUpdateClientboundPlayerLookAtClientboundPlayerPositionClientboundRecipeClientboundRemoveEntitiesClientboundRemoveMobEffectClientboundResetScoreClientboundResourcePackPopClientboundResourcePackPushClientboundRespawnClientboundRotateHeadClientboundSectionBlocksUpdateClientboundSelectAdvancementsTabClientboundServerDataClientboundSetActionBarTextClientboundSetBorderCenterClientboundSetBorderLerpSizeClientboundSetBorderSizeClientboundSetBorderWarningDelayClientboundSetBorderWarningDistanceClientboundSetCameraClientboundSetCarriedItemClientboundSetChunkCacheCenterClientboundSetChunkCacheRadiusClientboundSetDefaultSpawnPositionClientboundSetDisplayObjectiveClientboundSetEntityDataClientboundSetEntityLinkClientboundSetEntityMotionClientboundSetEquipmentClientboundSetExperienceClientboundSetHealthClientboundSetObjectiveClientboundSetPassengersClientboundSetPlayerTeamClientboundSetScoreClientboundSetSimulationDistanceClientboundSetSubtitleTextClientboundSetTimeClientboundSetTitleTextClientboundSetTitlesAnimationClientboundSoundEntityClientboundSoundClientboundStartConfigurationClientboundStopSoundClientboundStoreCookieClientboundSystemChatClientboundTabListClientboundTagQueryClientboundTakeItemEntityClientboundTeleportEntityClientboundTickingStateClientboundTickingStepClientboundTransferClientboundUpdateAdvancementsClientboundUpdateAttributesClientboundUpdateMobEffectClientboundUpdateRecipesClientboundUpdateTagsClientboundProjectilePowerClientboundCustomReportDetailsClientboundServerLinksClientboundPacketIDGuard"
|
||||||
|
|
||||||
var _ClientboundPacketID_index = [...]uint16{0, 26, 59, 82, 109, 138, 167, 193, 222, 254, 287, 315, 340, 378, 405, 438, 474, 502, 521, 546, 576, 603, 630, 654, 673, 705, 729, 751, 773, 794, 815, 839, 861, 879, 906, 926, 952, 976, 1003, 1023, 1053, 1074, 1099, 1121, 1137, 1159, 1184, 1208, 1235, 1259, 1281, 1300, 1321, 1346, 1361, 1384, 1411, 1437, 1458, 1484, 1512, 1539, 1566, 1593, 1616, 1641, 1658, 1683, 1709, 1730, 1756, 1783, 1801, 1822, 1852, 1884, 1905, 1932, 1958, 1986, 2010, 2042, 2077, 2097, 2122, 2152, 2182, 2216, 2246, 2270, 2294, 2320, 2343, 2367, 2387, 2410, 2434, 2458, 2477, 2509, 2535, 2553, 2576, 2605, 2627, 2643, 2672, 2692, 2714, 2735, 2753, 2772, 2797, 2822, 2845, 2867, 2886, 2915, 2942, 2968, 2992, 3013, 3039, 3069, 3091, 3115}
|
var _ClientboundPacketID_index = [...]uint16{0, 31, 52, 79, 111, 138, 167, 193, 222, 254, 287, 315, 340, 378, 405, 438, 474, 502, 521, 546, 576, 603, 630, 654, 673, 705, 729, 751, 773, 794, 815, 839, 861, 879, 906, 926, 952, 976, 1003, 1023, 1053, 1074, 1099, 1121, 1137, 1159, 1184, 1208, 1235, 1259, 1281, 1300, 1321, 1346, 1361, 1384, 1411, 1437, 1458, 1484, 1512, 1539, 1566, 1593, 1616, 1641, 1658, 1683, 1709, 1730, 1756, 1783, 1801, 1822, 1852, 1884, 1905, 1932, 1958, 1986, 2010, 2042, 2077, 2097, 2122, 2152, 2182, 2216, 2246, 2270, 2294, 2320, 2343, 2367, 2387, 2410, 2434, 2458, 2477, 2509, 2535, 2553, 2576, 2605, 2627, 2643, 2672, 2692, 2714, 2735, 2753, 2772, 2797, 2822, 2845, 2867, 2886, 2915, 2942, 2968, 2992, 3013, 3039, 3069, 3091, 3115}
|
||||||
|
|
||||||
func (i ClientboundPacketID) String() string {
|
func (i ClientboundPacketID) String() string {
|
||||||
if i < 0 || i >= ClientboundPacketID(len(_ClientboundPacketID_index)-1) {
|
if i < 0 || i >= ClientboundPacketID(len(_ClientboundPacketID_index)-1) {
|
||||||
|
@ -3,29 +3,52 @@ package packetid
|
|||||||
// This file might be remove in the future go-mc!!!
|
// This file might be remove in the future go-mc!!!
|
||||||
|
|
||||||
// Login Clientbound
|
// Login Clientbound
|
||||||
|
//
|
||||||
|
// Deprecated: Legacy name, might be removed in future version
|
||||||
const (
|
const (
|
||||||
LoginDisconnect = iota
|
LoginDisconnect = ClientboundLoginLoginDisconnect
|
||||||
LoginEncryptionRequest
|
LoginEncryptionRequest = ClientboundLoginHello
|
||||||
LoginSuccess
|
LoginSuccess = ClientboundLoginGameProfile
|
||||||
LoginCompression
|
LoginCompression = ClientboundLoginLoginCompression
|
||||||
LoginPluginRequest
|
LoginPluginRequest = ClientboundLoginCustomQuery
|
||||||
|
|
||||||
|
ClientboundLoginDisconnect = ClientboundLoginLoginDisconnect
|
||||||
|
ClientboundLoginEncryptionRequest = ClientboundLoginHello
|
||||||
|
ClientboundLoginSuccess = ClientboundLoginGameProfile
|
||||||
|
ClientboundLoginCompression = ClientboundLoginLoginCompression
|
||||||
|
ClientboundLoginPluginRequest = ClientboundLoginCustomQuery
|
||||||
)
|
)
|
||||||
|
|
||||||
// Login Serverbound
|
// Login Serverbound
|
||||||
|
//
|
||||||
|
// Deprecated: Legacy name, might be removed in future version
|
||||||
const (
|
const (
|
||||||
LoginStart = iota
|
LoginStart = ServerboundLoginHello
|
||||||
LoginEncryptionResponse
|
LoginEncryptionResponse = ServerboundLoginKey
|
||||||
LoginPluginResponse
|
LoginPluginResponse = ServerboundLoginCustomQueryAnswer
|
||||||
|
|
||||||
|
ServerboundLoginStart = ServerboundLoginHello
|
||||||
|
ServerboundLoginEncryptionResponse = ServerboundLoginKey
|
||||||
|
ServerboundLoginPluginResponse = ServerboundLoginCustomQueryAnswer
|
||||||
|
ServerboundLoginAcknowledged = ServerboundLoginLoginAcknowledged
|
||||||
)
|
)
|
||||||
|
|
||||||
// Status Clientbound
|
// Status Clientbound
|
||||||
|
//
|
||||||
|
// Deprecated: Legacy name, might be removed in future version
|
||||||
const (
|
const (
|
||||||
StatusResponse = iota
|
StatusResponse = ClientboundStatusStatusResponse
|
||||||
StatusPongResponse
|
StatusPongResponse = ClientboundStatusPongResponse
|
||||||
|
|
||||||
|
ClientboundStatusResponse = ClientboundStatusStatusResponse
|
||||||
)
|
)
|
||||||
|
|
||||||
// Status Serverbound
|
// Status Serverbound
|
||||||
|
//
|
||||||
|
// Deprecated: Legacy name, might be removed in future version
|
||||||
const (
|
const (
|
||||||
StatusRequest = iota
|
StatusRequest = ServerboundStatusStatusRequest
|
||||||
StatusPingRequest
|
StatusPingRequest = ServerboundStatusPingRequest
|
||||||
|
|
||||||
|
ServerboundStatusRequest = ServerboundStatusStatusRequest
|
||||||
)
|
)
|
||||||
|
@ -9,32 +9,32 @@ type (
|
|||||||
|
|
||||||
// Login Clientbound
|
// Login Clientbound
|
||||||
const (
|
const (
|
||||||
ClientboundLoginDisconnect ClientboundPacketID = iota // LoginDisconnect
|
ClientboundLoginLoginDisconnect ClientboundPacketID = iota
|
||||||
ClientboundLoginEncryptionRequest // Hello
|
ClientboundLoginHello
|
||||||
ClientboundLoginSuccess // GameProfile
|
ClientboundLoginGameProfile
|
||||||
ClientboundLoginCompression // LoginCompression
|
ClientboundLoginLoginCompression
|
||||||
ClientboundLoginPluginRequest // CustomQuery
|
ClientboundLoginCustomQuery
|
||||||
ClientboundLoginCookieRequest
|
ClientboundLoginCookieRequest
|
||||||
)
|
)
|
||||||
|
|
||||||
// Login Serverbound
|
// Login Serverbound
|
||||||
const (
|
const (
|
||||||
ServerboundLoginStart ServerboundPacketID = iota // Hello
|
ServerboundLoginHello ServerboundPacketID = iota
|
||||||
ServerboundLoginEncryptionResponse // Key
|
ServerboundLoginKey
|
||||||
ServerboundLoginPluginResponse // CustomQueryAnswer
|
ServerboundLoginCustomQueryAnswer
|
||||||
ServerboundLoginAcknowledged // LoginAcknowledged
|
ServerboundLoginLoginAcknowledged
|
||||||
ServerboundLoginCookieResponse
|
ServerboundLoginCookieResponse
|
||||||
)
|
)
|
||||||
|
|
||||||
// Status Clientbound
|
// Status Clientbound
|
||||||
const (
|
const (
|
||||||
ClientboundStatusResponse ClientboundPacketID = iota
|
ClientboundStatusStatusResponse ClientboundPacketID = iota
|
||||||
ClientboundStatusPongResponse
|
ClientboundStatusPongResponse
|
||||||
)
|
)
|
||||||
|
|
||||||
// Status Serverbound
|
// Status Serverbound
|
||||||
const (
|
const (
|
||||||
ServerboundStatusRequest ServerboundPacketID = iota
|
ServerboundStatusStatusRequest ServerboundPacketID = iota
|
||||||
ServerboundStatusPingRequest
|
ServerboundStatusPingRequest
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -8,12 +8,12 @@ func _() {
|
|||||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||||
// Re-run the stringer command to generate them again.
|
// Re-run the stringer command to generate them again.
|
||||||
var x [1]struct{}
|
var x [1]struct{}
|
||||||
_ = x[ServerboundLoginStart-0]
|
_ = x[ServerboundLoginHello-0]
|
||||||
_ = x[ServerboundLoginEncryptionResponse-1]
|
_ = x[ServerboundLoginKey-1]
|
||||||
_ = x[ServerboundLoginPluginResponse-2]
|
_ = x[ServerboundLoginCustomQueryAnswer-2]
|
||||||
_ = x[ServerboundLoginAcknowledged-3]
|
_ = x[ServerboundLoginLoginAcknowledged-3]
|
||||||
_ = x[ServerboundLoginCookieResponse-4]
|
_ = x[ServerboundLoginCookieResponse-4]
|
||||||
_ = x[ServerboundStatusRequest-0]
|
_ = x[ServerboundStatusStatusRequest-0]
|
||||||
_ = x[ServerboundStatusPingRequest-1]
|
_ = x[ServerboundStatusPingRequest-1]
|
||||||
_ = x[ServerboundConfigClientInformation-0]
|
_ = x[ServerboundConfigClientInformation-0]
|
||||||
_ = x[ServerboundConfigCookieResponse-1]
|
_ = x[ServerboundConfigCookieResponse-1]
|
||||||
@ -84,9 +84,9 @@ func _() {
|
|||||||
_ = x[ServerboundPacketIDGuard-58]
|
_ = x[ServerboundPacketIDGuard-58]
|
||||||
}
|
}
|
||||||
|
|
||||||
const _ServerboundPacketID_name = "ServerboundLoginStartServerboundLoginEncryptionResponseServerboundLoginPluginResponseServerboundLoginAcknowledgedServerboundLoginCookieResponseServerboundConfigPongServerboundConfigResourcePackServerboundConfigSelectKnownPacksServerboundChunkBatchReceivedServerboundClientCommandServerboundClientInformationServerboundCommandSuggestionServerboundConfigurationAcknowledgedServerboundContainerButtonClickServerboundContainerClickServerboundContainerCloseServerboundContainerSlotStateChangedServerboundCookieResponseServerboundCustomPayloadServerboundDebugSampleSubscriptionServerboundEditBookServerboundEntityTagQueryServerboundInteractServerboundJigsawGenerateServerboundKeepAliveServerboundLockDifficultyServerboundMovePlayerPosServerboundMovePlayerPosRotServerboundMovePlayerRotServerboundMovePlayerStatusOnlyServerboundMoveVehicleServerboundPaddleBoatServerboundPickItemServerboundPingRequestServerboundPlaceRecipeServerboundPlayerAbilitiesServerboundPlayerActionServerboundPlayerCommandServerboundPlayerInputServerboundPongServerboundRecipeBookChangeSettingsServerboundRecipeBookSeenRecipeServerboundRenameItemServerboundResourcePackServerboundSeenAdvancementsServerboundSelectTradeServerboundSetBeaconServerboundSetCarriedItemServerboundSetCommandBlockServerboundSetCommandMinecartServerboundSetCreativeModeSlotServerboundSetJigsawBlockServerboundSetStructureBlockServerboundSignUpdateServerboundSwingServerboundTeleportToEntityServerboundUseItemOnServerboundUseItemServerboundPacketIDGuard"
|
const _ServerboundPacketID_name = "ServerboundLoginHelloServerboundLoginKeyServerboundLoginCustomQueryAnswerServerboundLoginLoginAcknowledgedServerboundLoginCookieResponseServerboundConfigPongServerboundConfigResourcePackServerboundConfigSelectKnownPacksServerboundChunkBatchReceivedServerboundClientCommandServerboundClientInformationServerboundCommandSuggestionServerboundConfigurationAcknowledgedServerboundContainerButtonClickServerboundContainerClickServerboundContainerCloseServerboundContainerSlotStateChangedServerboundCookieResponseServerboundCustomPayloadServerboundDebugSampleSubscriptionServerboundEditBookServerboundEntityTagQueryServerboundInteractServerboundJigsawGenerateServerboundKeepAliveServerboundLockDifficultyServerboundMovePlayerPosServerboundMovePlayerPosRotServerboundMovePlayerRotServerboundMovePlayerStatusOnlyServerboundMoveVehicleServerboundPaddleBoatServerboundPickItemServerboundPingRequestServerboundPlaceRecipeServerboundPlayerAbilitiesServerboundPlayerActionServerboundPlayerCommandServerboundPlayerInputServerboundPongServerboundRecipeBookChangeSettingsServerboundRecipeBookSeenRecipeServerboundRenameItemServerboundResourcePackServerboundSeenAdvancementsServerboundSelectTradeServerboundSetBeaconServerboundSetCarriedItemServerboundSetCommandBlockServerboundSetCommandMinecartServerboundSetCreativeModeSlotServerboundSetJigsawBlockServerboundSetStructureBlockServerboundSignUpdateServerboundSwingServerboundTeleportToEntityServerboundUseItemOnServerboundUseItemServerboundPacketIDGuard"
|
||||||
|
|
||||||
var _ServerboundPacketID_index = [...]uint16{0, 21, 55, 85, 113, 143, 164, 193, 226, 255, 279, 307, 335, 371, 402, 427, 452, 488, 513, 537, 571, 590, 615, 634, 659, 679, 704, 728, 755, 779, 810, 832, 853, 872, 894, 916, 942, 965, 989, 1011, 1026, 1061, 1092, 1113, 1136, 1163, 1185, 1205, 1230, 1256, 1285, 1315, 1340, 1368, 1389, 1405, 1432, 1452, 1470, 1494}
|
var _ServerboundPacketID_index = [...]uint16{0, 21, 40, 73, 106, 136, 157, 186, 219, 248, 272, 300, 328, 364, 395, 420, 445, 481, 506, 530, 564, 583, 608, 627, 652, 672, 697, 721, 748, 772, 803, 825, 846, 865, 887, 909, 935, 958, 982, 1004, 1019, 1054, 1085, 1106, 1129, 1156, 1178, 1198, 1223, 1249, 1278, 1308, 1333, 1361, 1382, 1398, 1425, 1445, 1463, 1487}
|
||||||
|
|
||||||
func (i ServerboundPacketID) String() string {
|
func (i ServerboundPacketID) String() string {
|
||||||
if i < 0 || i >= ServerboundPacketID(len(_ServerboundPacketID_index)-1) {
|
if i < 0 || i >= ServerboundPacketID(len(_ServerboundPacketID_index)-1) {
|
||||||
|
Reference in New Issue
Block a user