update 1.19.2 bot, chat support

This commit is contained in:
Tnze
2022-11-26 15:58:31 +08:00
parent 6a3589ad61
commit 7814e7b1ab
20 changed files with 532 additions and 136 deletions

View File

@ -0,0 +1,130 @@
// Code generated by "stringer -type ClientboundPacketID"; DO NOT EDIT.
package packetid
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[ClientboundAddEntity-0]
_ = x[ClientboundAddExperienceOrb-1]
_ = x[ClientboundAddPlayer-2]
_ = x[ClientboundAnimate-3]
_ = x[ClientboundAwardStats-4]
_ = x[ClientboundBlockChangedAck-5]
_ = x[ClientboundBlockDestruction-6]
_ = x[ClientboundBlockEntityData-7]
_ = x[ClientboundBlockEvent-8]
_ = x[ClientboundBlockUpdate-9]
_ = x[ClientboundBossEvent-10]
_ = x[ClientboundChangeDifficulty-11]
_ = x[ClientboundChatPreview-12]
_ = x[ClientboundClearTitles-13]
_ = x[ClientboundCommandSuggestions-14]
_ = x[ClientboundCommands-15]
_ = x[ClientboundContainerClose-16]
_ = x[ClientboundContainerSetContent-17]
_ = x[ClientboundContainerSetData-18]
_ = x[ClientboundContainerSetSlot-19]
_ = x[ClientboundCooldown-20]
_ = x[ClientboundCustomChatCompletions-21]
_ = x[ClientboundCustomPayload-22]
_ = x[ClientboundCustomSound-23]
_ = x[ClientboundDeleteChat-24]
_ = x[ClientboundDisconnect-25]
_ = x[ClientboundEntityEvent-26]
_ = x[ClientboundExplode-27]
_ = x[ClientboundForgetLevelChunk-28]
_ = x[ClientboundGameEvent-29]
_ = x[ClientboundHorseScreenOpen-30]
_ = x[ClientboundInitializeBorder-31]
_ = x[ClientboundKeepAlive-32]
_ = x[ClientboundLevelChunkWithLight-33]
_ = x[ClientboundLevelEvent-34]
_ = x[ClientboundLevelParticles-35]
_ = x[ClientboundLightUpdate-36]
_ = x[ClientboundLogin-37]
_ = x[ClientboundMapItemData-38]
_ = x[ClientboundMerchantOffers-39]
_ = x[ClientboundMoveEntityPos-40]
_ = x[ClientboundMoveEntityPosRot-41]
_ = x[ClientboundMoveEntityRot-42]
_ = x[ClientboundMoveVehicle-43]
_ = x[ClientboundOpenBook-44]
_ = x[ClientboundOpenScreen-45]
_ = x[ClientboundOpenSignEditor-46]
_ = x[ClientboundPing-47]
_ = x[ClientboundPlaceGhostRecipe-48]
_ = x[ClientboundPlayerAbilities-49]
_ = x[ClientboundPlayerChatHeader-50]
_ = x[ClientboundPlayerChat-51]
_ = x[ClientboundPlayerCombatEnd-52]
_ = x[ClientboundPlayerCombatEnter-53]
_ = x[ClientboundPlayerCombatKill-54]
_ = x[ClientboundPlayerInfo-55]
_ = x[ClientboundPlayerLookAt-56]
_ = x[ClientboundPlayerPosition-57]
_ = x[ClientboundRecipe-58]
_ = x[ClientboundRemoveEntities-59]
_ = x[ClientboundRemoveMobEffect-60]
_ = x[ClientboundResourcePack-61]
_ = x[ClientboundRespawn-62]
_ = x[ClientboundRotateHead-63]
_ = x[ClientboundSectionBlocksUpdate-64]
_ = x[ClientboundSelectAdvancementsTab-65]
_ = x[ClientboundServerData-66]
_ = x[ClientboundSetActionBarText-67]
_ = x[ClientboundSetBorderCenter-68]
_ = x[ClientboundSetBorderLerpSize-69]
_ = x[ClientboundSetBorderSize-70]
_ = x[ClientboundSetBorderWarningDelay-71]
_ = x[ClientboundSetBorderWarningDistance-72]
_ = x[ClientboundSetCamera-73]
_ = x[ClientboundSetCarriedItem-74]
_ = x[ClientboundSetChunkCacheCenter-75]
_ = x[ClientboundSetChunkCacheRadius-76]
_ = x[ClientboundSetDefaultSpawnPosition-77]
_ = x[ClientboundSetDisplayChatPreview-78]
_ = x[ClientboundSetDisplayObjective-79]
_ = x[ClientboundSetEntityData-80]
_ = x[ClientboundSetEntityLink-81]
_ = x[ClientboundSetEntityMotion-82]
_ = x[ClientboundSetEquipment-83]
_ = x[ClientboundSetExperience-84]
_ = x[ClientboundSetHealth-85]
_ = x[ClientboundSetObjective-86]
_ = x[ClientboundSetPassengers-87]
_ = x[ClientboundSetPlayerTeam-88]
_ = x[ClientboundSetScore-89]
_ = x[ClientboundSetSimulationDistance-90]
_ = x[ClientboundSetSubtitleText-91]
_ = x[ClientboundSetTime-92]
_ = x[ClientboundSetTitleText-93]
_ = x[ClientboundSetTitlesAnimation-94]
_ = x[ClientboundSoundEntity-95]
_ = x[ClientboundSound-96]
_ = x[ClientboundStopSound-97]
_ = x[ClientboundSystemChat-98]
_ = x[ClientboundTabList-99]
_ = x[ClientboundTagQuery-100]
_ = x[ClientboundTakeItemEntity-101]
_ = x[ClientboundTeleportEntity-102]
_ = x[ClientboundUpdateAdvancements-103]
_ = x[ClientboundUpdateAttributes-104]
_ = x[ClientboundUpdateMobEffect-105]
_ = x[ClientboundUpdateRecipes-106]
_ = x[ClientboundUpdateTags-107]
}
const _ClientboundPacketID_name = "ClientboundAddEntityClientboundAddExperienceOrbClientboundAddPlayerClientboundAnimateClientboundAwardStatsClientboundBlockChangedAckClientboundBlockDestructionClientboundBlockEntityDataClientboundBlockEventClientboundBlockUpdateClientboundBossEventClientboundChangeDifficultyClientboundChatPreviewClientboundClearTitlesClientboundCommandSuggestionsClientboundCommandsClientboundContainerCloseClientboundContainerSetContentClientboundContainerSetDataClientboundContainerSetSlotClientboundCooldownClientboundCustomChatCompletionsClientboundCustomPayloadClientboundCustomSoundClientboundDeleteChatClientboundDisconnectClientboundEntityEventClientboundExplodeClientboundForgetLevelChunkClientboundGameEventClientboundHorseScreenOpenClientboundInitializeBorderClientboundKeepAliveClientboundLevelChunkWithLightClientboundLevelEventClientboundLevelParticlesClientboundLightUpdateClientboundLoginClientboundMapItemDataClientboundMerchantOffersClientboundMoveEntityPosClientboundMoveEntityPosRotClientboundMoveEntityRotClientboundMoveVehicleClientboundOpenBookClientboundOpenScreenClientboundOpenSignEditorClientboundPingClientboundPlaceGhostRecipeClientboundPlayerAbilitiesClientboundPlayerChatHeaderClientboundPlayerChatClientboundPlayerCombatEndClientboundPlayerCombatEnterClientboundPlayerCombatKillClientboundPlayerInfoClientboundPlayerLookAtClientboundPlayerPositionClientboundRecipeClientboundRemoveEntitiesClientboundRemoveMobEffectClientboundResourcePackClientboundRespawnClientboundRotateHeadClientboundSectionBlocksUpdateClientboundSelectAdvancementsTabClientboundServerDataClientboundSetActionBarTextClientboundSetBorderCenterClientboundSetBorderLerpSizeClientboundSetBorderSizeClientboundSetBorderWarningDelayClientboundSetBorderWarningDistanceClientboundSetCameraClientboundSetCarriedItemClientboundSetChunkCacheCenterClientboundSetChunkCacheRadiusClientboundSetDefaultSpawnPositionClientboundSetDisplayChatPreviewClientboundSetDisplayObjectiveClientboundSetEntityDataClientboundSetEntityLinkClientboundSetEntityMotionClientboundSetEquipmentClientboundSetExperienceClientboundSetHealthClientboundSetObjectiveClientboundSetPassengersClientboundSetPlayerTeamClientboundSetScoreClientboundSetSimulationDistanceClientboundSetSubtitleTextClientboundSetTimeClientboundSetTitleTextClientboundSetTitlesAnimationClientboundSoundEntityClientboundSoundClientboundStopSoundClientboundSystemChatClientboundTabListClientboundTagQueryClientboundTakeItemEntityClientboundTeleportEntityClientboundUpdateAdvancementsClientboundUpdateAttributesClientboundUpdateMobEffectClientboundUpdateRecipesClientboundUpdateTags"
var _ClientboundPacketID_index = [...]uint16{0, 20, 47, 67, 85, 106, 132, 159, 185, 206, 228, 248, 275, 297, 319, 348, 367, 392, 422, 449, 476, 495, 527, 551, 573, 594, 615, 637, 655, 682, 702, 728, 755, 775, 805, 826, 851, 873, 889, 911, 936, 960, 987, 1011, 1033, 1052, 1073, 1098, 1113, 1140, 1166, 1193, 1214, 1240, 1268, 1295, 1316, 1339, 1364, 1381, 1406, 1432, 1455, 1473, 1494, 1524, 1556, 1577, 1604, 1630, 1658, 1682, 1714, 1749, 1769, 1794, 1824, 1854, 1888, 1920, 1950, 1974, 1998, 2024, 2047, 2071, 2091, 2114, 2138, 2162, 2181, 2213, 2239, 2257, 2280, 2309, 2331, 2347, 2367, 2388, 2406, 2425, 2450, 2475, 2504, 2531, 2557, 2581, 2602}
func (i ClientboundPacketID) String() string {
if i < 0 || i >= ClientboundPacketID(len(_ClientboundPacketID_index)-1) {
return "ClientboundPacketID(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _ClientboundPacketID_name[_ClientboundPacketID_index[i]:_ClientboundPacketID_index[i+1]]
}

View File

@ -1,5 +1,11 @@
package packetid
//go:generate stringer -type ClientboundPacketID
//go:generate stringer -type ServerboundPacketID
type ClientboundPacketID int32
type ServerboundPacketID int32
// Login Clientbound
const (
LoginDisconnect = iota
@ -30,7 +36,7 @@ const (
// Game Clientbound
const (
ClientboundAddEntity = iota
ClientboundAddEntity ClientboundPacketID = iota
ClientboundAddExperienceOrb
ClientboundAddPlayer
ClientboundAnimate
@ -142,7 +148,7 @@ const (
// Game Serverbound
const (
ServerboundAcceptTeleportation = iota
ServerboundAcceptTeleportation ServerboundPacketID = iota
ServerboundBlockEntityTagQuery
ServerboundChangeDifficulty
ServerboundChatAck

View File

@ -0,0 +1,73 @@
// Code generated by "stringer -type ServerboundPacketID"; DO NOT EDIT.
package packetid
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[ServerboundAcceptTeleportation-0]
_ = x[ServerboundBlockEntityTagQuery-1]
_ = x[ServerboundChangeDifficulty-2]
_ = x[ServerboundChatAck-3]
_ = x[ServerboundChatCommand-4]
_ = x[ServerboundChat-5]
_ = x[ServerboundChatPreview-6]
_ = x[ServerboundClientCommand-7]
_ = x[ServerboundClientInformation-8]
_ = x[ServerboundCommandSuggestion-9]
_ = x[ServerboundContainerButtonClick-10]
_ = x[ServerboundContainerClick-11]
_ = x[ServerboundContainerClose-12]
_ = x[ServerboundCustomPayload-13]
_ = x[ServerboundEditBook-14]
_ = x[ServerboundEntityTagQuery-15]
_ = x[ServerboundInteract-16]
_ = x[ServerboundJigsawGenerate-17]
_ = x[ServerboundKeepAlive-18]
_ = x[ServerboundLockDifficulty-19]
_ = x[ServerboundMovePlayerPos-20]
_ = x[ServerboundMovePlayerPosRot-21]
_ = x[ServerboundMovePlayerRot-22]
_ = x[ServerboundMovePlayerStatusOnly-23]
_ = x[ServerboundMoveVehicle-24]
_ = x[ServerboundPaddleBoat-25]
_ = x[ServerboundPickItem-26]
_ = x[ServerboundPlaceRecipe-27]
_ = x[ServerboundPlayerAbilities-28]
_ = x[ServerboundPlayerAction-29]
_ = x[ServerboundPlayerCommand-30]
_ = x[ServerboundPlayerInput-31]
_ = x[ServerboundPong-32]
_ = x[ServerboundRecipeBookChangeSettings-33]
_ = x[ServerboundRecipeBookSeenRecipe-34]
_ = x[ServerboundRenameItem-35]
_ = x[ServerboundResourcePack-36]
_ = x[ServerboundSeenAdvancements-37]
_ = x[ServerboundSelectTrade-38]
_ = x[ServerboundSetBeacon-39]
_ = x[ServerboundSetCarriedItem-40]
_ = x[ServerboundSetCommandBlock-41]
_ = x[ServerboundSetCommandMinecart-42]
_ = x[ServerboundSetCreativeModeSlot-43]
_ = x[ServerboundSetJigsawBlock-44]
_ = x[ServerboundSetStructureBlock-45]
_ = x[ServerboundSignUpdate-46]
_ = x[ServerboundSwing-47]
_ = x[ServerboundTeleportToEntity-48]
_ = x[ServerboundUseItemOn-49]
_ = x[ServerboundUseItem-50]
}
const _ServerboundPacketID_name = "ServerboundAcceptTeleportationServerboundBlockEntityTagQueryServerboundChangeDifficultyServerboundChatAckServerboundChatCommandServerboundChatServerboundChatPreviewServerboundClientCommandServerboundClientInformationServerboundCommandSuggestionServerboundContainerButtonClickServerboundContainerClickServerboundContainerCloseServerboundCustomPayloadServerboundEditBookServerboundEntityTagQueryServerboundInteractServerboundJigsawGenerateServerboundKeepAliveServerboundLockDifficultyServerboundMovePlayerPosServerboundMovePlayerPosRotServerboundMovePlayerRotServerboundMovePlayerStatusOnlyServerboundMoveVehicleServerboundPaddleBoatServerboundPickItemServerboundPlaceRecipeServerboundPlayerAbilitiesServerboundPlayerActionServerboundPlayerCommandServerboundPlayerInputServerboundPongServerboundRecipeBookChangeSettingsServerboundRecipeBookSeenRecipeServerboundRenameItemServerboundResourcePackServerboundSeenAdvancementsServerboundSelectTradeServerboundSetBeaconServerboundSetCarriedItemServerboundSetCommandBlockServerboundSetCommandMinecartServerboundSetCreativeModeSlotServerboundSetJigsawBlockServerboundSetStructureBlockServerboundSignUpdateServerboundSwingServerboundTeleportToEntityServerboundUseItemOnServerboundUseItem"
var _ServerboundPacketID_index = [...]uint16{0, 30, 60, 87, 105, 127, 142, 164, 188, 216, 244, 275, 300, 325, 349, 368, 393, 412, 437, 457, 482, 506, 533, 557, 588, 610, 631, 650, 672, 698, 721, 745, 767, 782, 817, 848, 869, 892, 919, 941, 961, 986, 1012, 1041, 1071, 1096, 1124, 1145, 1161, 1188, 1208, 1226}
func (i ServerboundPacketID) String() string {
if i < 0 || i >= ServerboundPacketID(len(_ServerboundPacketID_index)-1) {
return "ServerboundPacketID(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _ServerboundPacketID_name[_ServerboundPacketID_index[i]:_ServerboundPacketID_index[i+1]]
}