@serenityjs/protocol 0.2.3-beta-20240516143349 → 0.2.3-beta-20240522190240
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +131 -2
- package/dist/index.js +189 -4
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -1538,6 +1538,58 @@ declare enum HUDVisibility {
|
|
|
1538
1538
|
RESET = 1
|
|
1539
1539
|
}
|
|
1540
1540
|
|
|
1541
|
+
declare enum PlayerAuthInputData {
|
|
1542
|
+
Ascend = 0,
|
|
1543
|
+
Descend = 1,
|
|
1544
|
+
NorthJump = 2,
|
|
1545
|
+
JumpDown = 3,
|
|
1546
|
+
SprintDown = 4,
|
|
1547
|
+
ChangeHeight = 5,
|
|
1548
|
+
Jumping = 6,
|
|
1549
|
+
AutoJumpingInWater = 7,
|
|
1550
|
+
Sneaking = 8,
|
|
1551
|
+
SneakDown = 9,
|
|
1552
|
+
Up = 10,
|
|
1553
|
+
Down = 11,
|
|
1554
|
+
Left = 12,
|
|
1555
|
+
Right = 13,
|
|
1556
|
+
UpLeft = 14,
|
|
1557
|
+
UpRight = 15,
|
|
1558
|
+
WantUp = 16,
|
|
1559
|
+
WantDown = 17,
|
|
1560
|
+
WantDownSlow = 18,
|
|
1561
|
+
WantUpSlow = 19,
|
|
1562
|
+
Sprinting = 20,
|
|
1563
|
+
AscendBlock = 21,
|
|
1564
|
+
DescendBlock = 22,
|
|
1565
|
+
SneakToggleDown = 23,
|
|
1566
|
+
PersistSneak = 24,
|
|
1567
|
+
StartSprinting = 25,
|
|
1568
|
+
StopSprinting = 26,
|
|
1569
|
+
StartSneaking = 27,
|
|
1570
|
+
StopSneaking = 28,
|
|
1571
|
+
StartSwimming = 29,
|
|
1572
|
+
StopSwimming = 30,
|
|
1573
|
+
StartJumping = 31,
|
|
1574
|
+
StartGliding = 32,
|
|
1575
|
+
StopGliding = 33,
|
|
1576
|
+
PerformItemInteraction = 34,
|
|
1577
|
+
PerformBlockActions = 35,
|
|
1578
|
+
PerformItemStackRequest = 36,
|
|
1579
|
+
HandledTeleport = 37,
|
|
1580
|
+
Emoting = 38,
|
|
1581
|
+
MissedSwing = 39,
|
|
1582
|
+
StartCrawling = 40,
|
|
1583
|
+
StopCrawling = 41,
|
|
1584
|
+
StartFlying = 42,
|
|
1585
|
+
StopFlying = 43,
|
|
1586
|
+
ClientAckServerData = 44,
|
|
1587
|
+
IsInClientPredictedVehicle = 45,
|
|
1588
|
+
PaddlingLeft = 46,
|
|
1589
|
+
PaddlingRight = 47,
|
|
1590
|
+
INPUT_NUM = 48
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1541
1593
|
declare class LoginTokens extends DataType {
|
|
1542
1594
|
client: string;
|
|
1543
1595
|
identity: string;
|
|
@@ -1628,13 +1680,86 @@ declare class Vector3f extends DataType {
|
|
|
1628
1680
|
* @param z The z coordinate of the vector.
|
|
1629
1681
|
*/
|
|
1630
1682
|
constructor(x: number, y: number, z: number);
|
|
1683
|
+
/**
|
|
1684
|
+
* Rounds the coordinates of the 3D vector to the nearest whole number.
|
|
1685
|
+
* @returns
|
|
1686
|
+
*/
|
|
1687
|
+
round(): Vector3f;
|
|
1688
|
+
/**
|
|
1689
|
+
* Ceils the coordinates of the 3D vector.
|
|
1690
|
+
* @returns The 3D vector with the coordinates ceiled.
|
|
1691
|
+
*/
|
|
1692
|
+
ceil(): Vector3f;
|
|
1631
1693
|
/**
|
|
1632
1694
|
* Floors the coordinates of the 3D vector.
|
|
1633
|
-
*
|
|
1634
1695
|
* @returns The 3D vector with the coordinates floored.
|
|
1635
1696
|
*/
|
|
1636
1697
|
floor(): Vector3f;
|
|
1698
|
+
/**
|
|
1699
|
+
* Adds another 3D vector to this 3D vector.
|
|
1700
|
+
* @param other The other 3D vector to add.
|
|
1701
|
+
* @returns The result of the addition.
|
|
1702
|
+
*/
|
|
1703
|
+
add(other: Vector3f): Vector3f;
|
|
1704
|
+
/**
|
|
1705
|
+
* Subtracts another 3D vector from this 3D vector.
|
|
1706
|
+
* @param other The other 3D vector to subtract.
|
|
1707
|
+
* @returns The result of the subtraction.
|
|
1708
|
+
*/
|
|
1637
1709
|
subtract(other: Vector3f): Vector3f;
|
|
1710
|
+
/**
|
|
1711
|
+
* Multiplies this 3D vector with a scalar.
|
|
1712
|
+
* @param scalar The scalar to multiply with.
|
|
1713
|
+
* @returns The result of the multiplication.
|
|
1714
|
+
*/
|
|
1715
|
+
multiply(scalar: number): Vector3f;
|
|
1716
|
+
/**
|
|
1717
|
+
* Divides this 3D vector with a scalar.
|
|
1718
|
+
* @param scalar The scalar to divide with.
|
|
1719
|
+
* @returns The result of the division.
|
|
1720
|
+
*/
|
|
1721
|
+
divide(scalar: number): Vector3f;
|
|
1722
|
+
/**
|
|
1723
|
+
* Calculates the dot product between this 3D vector and another 3D vector.
|
|
1724
|
+
* @param other The other 3D vector to calculate the dot product with.
|
|
1725
|
+
* @returns The result of the dot product.
|
|
1726
|
+
*/
|
|
1727
|
+
dot(other: Vector3f): number;
|
|
1728
|
+
/**
|
|
1729
|
+
* Calculates the cross product between this 3D vector and another 3D vector.
|
|
1730
|
+
* @param other The other 3D vector to calculate the cross product with.
|
|
1731
|
+
* @returns The result of the cross product.
|
|
1732
|
+
*/
|
|
1733
|
+
cross(other: Vector3f): Vector3f;
|
|
1734
|
+
/**
|
|
1735
|
+
* Calculates the length of this 3D vector.
|
|
1736
|
+
* @returns The length of the 3D vector.
|
|
1737
|
+
*/
|
|
1738
|
+
length(): number;
|
|
1739
|
+
/**
|
|
1740
|
+
* Normalizes this 3D vector.
|
|
1741
|
+
* @returns The normalized 3D vector.
|
|
1742
|
+
*/
|
|
1743
|
+
normalize(): Vector3f;
|
|
1744
|
+
/**
|
|
1745
|
+
* Linearly interpolates between this 3D vector and another 3D vector.
|
|
1746
|
+
* @param other The other 3D vector to interpolate with.
|
|
1747
|
+
* @param t The interpolation factor.
|
|
1748
|
+
* @returns The interpolated 3D vector.
|
|
1749
|
+
*/
|
|
1750
|
+
lerp(other: Vector3f, t: number): Vector3f;
|
|
1751
|
+
/**
|
|
1752
|
+
* Spherically interpolates between this 3D vector and another 3D vector.
|
|
1753
|
+
* @param other The other 3D vector to interpolate with.
|
|
1754
|
+
* @param t The interpolation factor.
|
|
1755
|
+
* @returns The interpolated 3D vector.
|
|
1756
|
+
*/
|
|
1757
|
+
slerp(other: Vector3f, t: number): Vector3f;
|
|
1758
|
+
/**
|
|
1759
|
+
* Returns a string representation of this 3D vector.
|
|
1760
|
+
* @returns The string representation of this 3D vector.
|
|
1761
|
+
*/
|
|
1762
|
+
equals(other: Vector3f): boolean;
|
|
1638
1763
|
/**
|
|
1639
1764
|
* Reads a 3D vector from the stream.
|
|
1640
1765
|
*
|
|
@@ -3126,6 +3251,10 @@ declare class PlayerAuthInputPacket extends DataPacket {
|
|
|
3126
3251
|
headYaw: number;
|
|
3127
3252
|
inputData: bigint;
|
|
3128
3253
|
inputMode: number;
|
|
3254
|
+
playMode: number;
|
|
3255
|
+
newInteractionModel: number;
|
|
3256
|
+
currentTick: bigint;
|
|
3257
|
+
positionDelta: Vector3f;
|
|
3129
3258
|
}
|
|
3130
3259
|
|
|
3131
3260
|
declare class PlayerHotbarPacket extends DataPacket {
|
|
@@ -3509,4 +3638,4 @@ declare const PROTOCOL_VERSION = 671;
|
|
|
3509
3638
|
declare const MINECRAFT_VERSION = "1.20.80";
|
|
3510
3639
|
declare const MINECRAFT_TICK_SPEED = 50;
|
|
3511
3640
|
|
|
3512
|
-
export { AbilityLayerFlag, AbilityLayerType, AbilityLayers, AbilitySet, ActionIds, AddEntityPacket, AddItemActorPacket, AddPlayerPacket, AnimateAction, AnimateId, AnimatePacket, Attribute, AvailableCommandsPacket, BehaviorPackInfo, BiomeDefinitionListPacket, BlockCoordinates, BlockFace, BlockPickRequestPacket, BlockProperties, ChainedSubcommandValues, ChangeDimensionPacket, ChunkCoords, ChunkRadiusUpdatePacket, CommandOriginData, CommandOutputData, CommandOutputMessage, CommandOutputPacket, CommandParameterType, CommandPermissionLevel, CommandRequestPacket, Commands, ComplexInventoryTransaction, ComponentItem, CompressionMethod, ContainerClosePacket, ContainerId, ContainerName, ContainerOpenPacket, ContainerType, CreativeContentPacket, CreativeItems, DataPacket, DeviceOS, Difficulty, DimensionType, DisconnectPacket, DisconnectReason, DisplaySlotType, DynamicEnums, EntityAttributes, EntityProperties, EnumConstraints, EnumValues, Enums, Experiments, Framer, GameRuleType, GameRules, Gamemode, HUDElement, HUDElementId, HUDVisibility, InteractActions, InteractPacket, InteractPosition, InventoryAction, InventoryContentPacket, InventorySlotPacket, InventorySource, InventorySourceType, InventoryTransaction, InventoryTransactionPacket, ItemComponentPacket, ItemData, ItemInstanceUserData, ItemReleaseInventoryTransaction, ItemReleaseInventoryTransactionType, type ItemStackAction, ItemStackActionType, type ItemStackContainer, ItemStackRequestPacket, ItemStackRequests, ItemStackResponsePacket, ItemStackResponses, ItemStackStatus, ItemStacks, ItemUseInventoryTransaction, ItemUseInventoryTransactionType, ItemUseOnEntityInventoryTransaction, ItemUseOnEntityInventoryTransactionType, LegacyTransaction, LevelChunkPacket, LevelEvent, LevelEventPacket, LevelSoundEvent, LevelSoundEventPacket, Links, LoginPacket, LoginTokens, MINECRAFT_TICK_SPEED, MINECRAFT_VERSION, MetadataDictionary, MetadataFlags, MetadataKey, MetadataType, MobEquipmentPacket, ModalFormCanceled, ModalFormCanceledReason, ModalFormData, ModalFormRequestPacket, ModalFormResponsePacket, ModalFormType, MoveActorAbsolutePacket, MoveMode, MovePlayerPacket, NetworkChunkPublisherUpdatePacket, NetworkItemInstanceDescriptor, NetworkItemStackDescriptor, NetworkSettingsPacket, ObjectiveSortOrder, PROTOCOL_VERSION, PackLinks, PackType, Packet, PacketViolationWarningPacket, Packets, PermissionLevel, PlayStatus, PlayStatusPacket, PlayerActionPacket, PlayerAttributes, PlayerAuthInputPacket, PlayerHotbarPacket, PlayerListAction, PlayerListPacket, PlayerListRecord, PostFixes, RemoveEntityPacket, RemoveObjectivePacket, RequestChunkRadiusPacket, RequestNetworkSettingsPacket, ResourceIdVersions, ResourcePackChunkDataPacket, ResourcePackChunkRequestPacket, ResourcePackClientResponsePacket, ResourcePackDataInfoPacket, ResourcePackIds, ResourcePackResponse, ResourcePackStackPacket, ResourcePacksInfoPacket, RespawnPacket, RespawnState, Rotation, ScoreActionType, ScoreEntry, ScoreEntryType, ScoreboardIdentity, ScoreboardIdentityAction, ScriptMessagePacket, SerializedSkin, SetActorMotionPacket, SetCommandsEnabledPacket, SetDisplayObjectivePacket, SetEntityDataPacket, SetHudPacket, SetLocalPlayerAsInitializedPacket, SetPlayerGameTypePacket, SetScorePacket, SetScoreboardIdentityPacket, SetTimePacket, SetTitlePacket, SkinAnimation, SkinImage, SkinPersonaPiece, SkinPersonaTintPiece, StackRequestSlotInfo, StartGamePacket, Subcommands, TakeItemActorPacket, TeleportCause, TextPacket, TextPacketType, TextParameters, TextSource, TexturePackInfo, TitleTypes, ToastRequestPacket, TransactionSourceType, TransferPacket, UpdateAbilitiesPacket, UpdateAdventureSettingsPacket, UpdateAttributesPacket, UpdateBlockFlagsType, UpdateBlockLayerType, UpdateBlockPacket, VariableStringArray as VarStringArray, VarintArray, Vector2f, Vector3f, ViolationSeverity, ViolationType, getPacketId };
|
|
3641
|
+
export { AbilityLayerFlag, AbilityLayerType, AbilityLayers, AbilitySet, ActionIds, AddEntityPacket, AddItemActorPacket, AddPlayerPacket, AnimateAction, AnimateId, AnimatePacket, Attribute, AvailableCommandsPacket, BehaviorPackInfo, BiomeDefinitionListPacket, BlockCoordinates, BlockFace, BlockPickRequestPacket, BlockProperties, ChainedSubcommandValues, ChangeDimensionPacket, ChunkCoords, ChunkRadiusUpdatePacket, CommandOriginData, CommandOutputData, CommandOutputMessage, CommandOutputPacket, CommandParameterType, CommandPermissionLevel, CommandRequestPacket, Commands, ComplexInventoryTransaction, ComponentItem, CompressionMethod, ContainerClosePacket, ContainerId, ContainerName, ContainerOpenPacket, ContainerType, CreativeContentPacket, CreativeItems, DataPacket, DeviceOS, Difficulty, DimensionType, DisconnectPacket, DisconnectReason, DisplaySlotType, DynamicEnums, EntityAttributes, EntityProperties, EnumConstraints, EnumValues, Enums, Experiments, Framer, GameRuleType, GameRules, Gamemode, HUDElement, HUDElementId, HUDVisibility, InteractActions, InteractPacket, InteractPosition, InventoryAction, InventoryContentPacket, InventorySlotPacket, InventorySource, InventorySourceType, InventoryTransaction, InventoryTransactionPacket, ItemComponentPacket, ItemData, ItemInstanceUserData, ItemReleaseInventoryTransaction, ItemReleaseInventoryTransactionType, type ItemStackAction, ItemStackActionType, type ItemStackContainer, ItemStackRequestPacket, ItemStackRequests, ItemStackResponsePacket, ItemStackResponses, ItemStackStatus, ItemStacks, ItemUseInventoryTransaction, ItemUseInventoryTransactionType, ItemUseOnEntityInventoryTransaction, ItemUseOnEntityInventoryTransactionType, LegacyTransaction, LevelChunkPacket, LevelEvent, LevelEventPacket, LevelSoundEvent, LevelSoundEventPacket, Links, LoginPacket, LoginTokens, MINECRAFT_TICK_SPEED, MINECRAFT_VERSION, MetadataDictionary, MetadataFlags, MetadataKey, MetadataType, MobEquipmentPacket, ModalFormCanceled, ModalFormCanceledReason, ModalFormData, ModalFormRequestPacket, ModalFormResponsePacket, ModalFormType, MoveActorAbsolutePacket, MoveMode, MovePlayerPacket, NetworkChunkPublisherUpdatePacket, NetworkItemInstanceDescriptor, NetworkItemStackDescriptor, NetworkSettingsPacket, ObjectiveSortOrder, PROTOCOL_VERSION, PackLinks, PackType, Packet, PacketViolationWarningPacket, Packets, PermissionLevel, PlayStatus, PlayStatusPacket, PlayerActionPacket, PlayerAttributes, PlayerAuthInputData, PlayerAuthInputPacket, PlayerHotbarPacket, PlayerListAction, PlayerListPacket, PlayerListRecord, PostFixes, RemoveEntityPacket, RemoveObjectivePacket, RequestChunkRadiusPacket, RequestNetworkSettingsPacket, ResourceIdVersions, ResourcePackChunkDataPacket, ResourcePackChunkRequestPacket, ResourcePackClientResponsePacket, ResourcePackDataInfoPacket, ResourcePackIds, ResourcePackResponse, ResourcePackStackPacket, ResourcePacksInfoPacket, RespawnPacket, RespawnState, Rotation, ScoreActionType, ScoreEntry, ScoreEntryType, ScoreboardIdentity, ScoreboardIdentityAction, ScriptMessagePacket, SerializedSkin, SetActorMotionPacket, SetCommandsEnabledPacket, SetDisplayObjectivePacket, SetEntityDataPacket, SetHudPacket, SetLocalPlayerAsInitializedPacket, SetPlayerGameTypePacket, SetScorePacket, SetScoreboardIdentityPacket, SetTimePacket, SetTitlePacket, SkinAnimation, SkinImage, SkinPersonaPiece, SkinPersonaTintPiece, StackRequestSlotInfo, StartGamePacket, Subcommands, TakeItemActorPacket, TeleportCause, TextPacket, TextPacketType, TextParameters, TextSource, TexturePackInfo, TitleTypes, ToastRequestPacket, TransactionSourceType, TransferPacket, UpdateAbilitiesPacket, UpdateAdventureSettingsPacket, UpdateAttributesPacket, UpdateBlockFlagsType, UpdateBlockLayerType, UpdateBlockPacket, VariableStringArray as VarStringArray, VarintArray, Vector2f, Vector3f, ViolationSeverity, ViolationType, getPacketId };
|
package/dist/index.js
CHANGED
|
@@ -158,6 +158,7 @@ __export(src_exports, {
|
|
|
158
158
|
PlayStatusPacket: () => PlayStatusPacket,
|
|
159
159
|
PlayerActionPacket: () => PlayerActionPacket,
|
|
160
160
|
PlayerAttributes: () => PlayerAttributes,
|
|
161
|
+
PlayerAuthInputData: () => PlayerAuthInputData,
|
|
161
162
|
PlayerAuthInputPacket: () => PlayerAuthInputPacket,
|
|
162
163
|
PlayerHotbarPacket: () => PlayerHotbarPacket,
|
|
163
164
|
PlayerListAction: () => PlayerListAction,
|
|
@@ -1875,6 +1876,60 @@ var HUDVisibility = /* @__PURE__ */ ((HUDVisibility3) => {
|
|
|
1875
1876
|
return HUDVisibility3;
|
|
1876
1877
|
})(HUDVisibility || {});
|
|
1877
1878
|
|
|
1879
|
+
// src/enums/player-auth-input-data.ts
|
|
1880
|
+
var PlayerAuthInputData = /* @__PURE__ */ ((PlayerAuthInputData2) => {
|
|
1881
|
+
PlayerAuthInputData2[PlayerAuthInputData2["Ascend"] = 0] = "Ascend";
|
|
1882
|
+
PlayerAuthInputData2[PlayerAuthInputData2["Descend"] = 1] = "Descend";
|
|
1883
|
+
PlayerAuthInputData2[PlayerAuthInputData2["NorthJump"] = 2] = "NorthJump";
|
|
1884
|
+
PlayerAuthInputData2[PlayerAuthInputData2["JumpDown"] = 3] = "JumpDown";
|
|
1885
|
+
PlayerAuthInputData2[PlayerAuthInputData2["SprintDown"] = 4] = "SprintDown";
|
|
1886
|
+
PlayerAuthInputData2[PlayerAuthInputData2["ChangeHeight"] = 5] = "ChangeHeight";
|
|
1887
|
+
PlayerAuthInputData2[PlayerAuthInputData2["Jumping"] = 6] = "Jumping";
|
|
1888
|
+
PlayerAuthInputData2[PlayerAuthInputData2["AutoJumpingInWater"] = 7] = "AutoJumpingInWater";
|
|
1889
|
+
PlayerAuthInputData2[PlayerAuthInputData2["Sneaking"] = 8] = "Sneaking";
|
|
1890
|
+
PlayerAuthInputData2[PlayerAuthInputData2["SneakDown"] = 9] = "SneakDown";
|
|
1891
|
+
PlayerAuthInputData2[PlayerAuthInputData2["Up"] = 10] = "Up";
|
|
1892
|
+
PlayerAuthInputData2[PlayerAuthInputData2["Down"] = 11] = "Down";
|
|
1893
|
+
PlayerAuthInputData2[PlayerAuthInputData2["Left"] = 12] = "Left";
|
|
1894
|
+
PlayerAuthInputData2[PlayerAuthInputData2["Right"] = 13] = "Right";
|
|
1895
|
+
PlayerAuthInputData2[PlayerAuthInputData2["UpLeft"] = 14] = "UpLeft";
|
|
1896
|
+
PlayerAuthInputData2[PlayerAuthInputData2["UpRight"] = 15] = "UpRight";
|
|
1897
|
+
PlayerAuthInputData2[PlayerAuthInputData2["WantUp"] = 16] = "WantUp";
|
|
1898
|
+
PlayerAuthInputData2[PlayerAuthInputData2["WantDown"] = 17] = "WantDown";
|
|
1899
|
+
PlayerAuthInputData2[PlayerAuthInputData2["WantDownSlow"] = 18] = "WantDownSlow";
|
|
1900
|
+
PlayerAuthInputData2[PlayerAuthInputData2["WantUpSlow"] = 19] = "WantUpSlow";
|
|
1901
|
+
PlayerAuthInputData2[PlayerAuthInputData2["Sprinting"] = 20] = "Sprinting";
|
|
1902
|
+
PlayerAuthInputData2[PlayerAuthInputData2["AscendBlock"] = 21] = "AscendBlock";
|
|
1903
|
+
PlayerAuthInputData2[PlayerAuthInputData2["DescendBlock"] = 22] = "DescendBlock";
|
|
1904
|
+
PlayerAuthInputData2[PlayerAuthInputData2["SneakToggleDown"] = 23] = "SneakToggleDown";
|
|
1905
|
+
PlayerAuthInputData2[PlayerAuthInputData2["PersistSneak"] = 24] = "PersistSneak";
|
|
1906
|
+
PlayerAuthInputData2[PlayerAuthInputData2["StartSprinting"] = 25] = "StartSprinting";
|
|
1907
|
+
PlayerAuthInputData2[PlayerAuthInputData2["StopSprinting"] = 26] = "StopSprinting";
|
|
1908
|
+
PlayerAuthInputData2[PlayerAuthInputData2["StartSneaking"] = 27] = "StartSneaking";
|
|
1909
|
+
PlayerAuthInputData2[PlayerAuthInputData2["StopSneaking"] = 28] = "StopSneaking";
|
|
1910
|
+
PlayerAuthInputData2[PlayerAuthInputData2["StartSwimming"] = 29] = "StartSwimming";
|
|
1911
|
+
PlayerAuthInputData2[PlayerAuthInputData2["StopSwimming"] = 30] = "StopSwimming";
|
|
1912
|
+
PlayerAuthInputData2[PlayerAuthInputData2["StartJumping"] = 31] = "StartJumping";
|
|
1913
|
+
PlayerAuthInputData2[PlayerAuthInputData2["StartGliding"] = 32] = "StartGliding";
|
|
1914
|
+
PlayerAuthInputData2[PlayerAuthInputData2["StopGliding"] = 33] = "StopGliding";
|
|
1915
|
+
PlayerAuthInputData2[PlayerAuthInputData2["PerformItemInteraction"] = 34] = "PerformItemInteraction";
|
|
1916
|
+
PlayerAuthInputData2[PlayerAuthInputData2["PerformBlockActions"] = 35] = "PerformBlockActions";
|
|
1917
|
+
PlayerAuthInputData2[PlayerAuthInputData2["PerformItemStackRequest"] = 36] = "PerformItemStackRequest";
|
|
1918
|
+
PlayerAuthInputData2[PlayerAuthInputData2["HandledTeleport"] = 37] = "HandledTeleport";
|
|
1919
|
+
PlayerAuthInputData2[PlayerAuthInputData2["Emoting"] = 38] = "Emoting";
|
|
1920
|
+
PlayerAuthInputData2[PlayerAuthInputData2["MissedSwing"] = 39] = "MissedSwing";
|
|
1921
|
+
PlayerAuthInputData2[PlayerAuthInputData2["StartCrawling"] = 40] = "StartCrawling";
|
|
1922
|
+
PlayerAuthInputData2[PlayerAuthInputData2["StopCrawling"] = 41] = "StopCrawling";
|
|
1923
|
+
PlayerAuthInputData2[PlayerAuthInputData2["StartFlying"] = 42] = "StartFlying";
|
|
1924
|
+
PlayerAuthInputData2[PlayerAuthInputData2["StopFlying"] = 43] = "StopFlying";
|
|
1925
|
+
PlayerAuthInputData2[PlayerAuthInputData2["ClientAckServerData"] = 44] = "ClientAckServerData";
|
|
1926
|
+
PlayerAuthInputData2[PlayerAuthInputData2["IsInClientPredictedVehicle"] = 45] = "IsInClientPredictedVehicle";
|
|
1927
|
+
PlayerAuthInputData2[PlayerAuthInputData2["PaddlingLeft"] = 46] = "PaddlingLeft";
|
|
1928
|
+
PlayerAuthInputData2[PlayerAuthInputData2["PaddlingRight"] = 47] = "PaddlingRight";
|
|
1929
|
+
PlayerAuthInputData2[PlayerAuthInputData2["INPUT_NUM"] = 48] = "INPUT_NUM";
|
|
1930
|
+
return PlayerAuthInputData2;
|
|
1931
|
+
})(PlayerAuthInputData || {});
|
|
1932
|
+
|
|
1878
1933
|
// src/proto/data/add-entity.ts
|
|
1879
1934
|
var import_binarystream32 = require("@serenityjs/binarystream");
|
|
1880
1935
|
var import_raknet67 = require("@serenityjs/raknet");
|
|
@@ -2170,9 +2225,28 @@ var Vector3f = class _Vector3f extends import_raknet8.DataType {
|
|
|
2170
2225
|
this.y = y;
|
|
2171
2226
|
this.z = z;
|
|
2172
2227
|
}
|
|
2228
|
+
/**
|
|
2229
|
+
* Rounds the coordinates of the 3D vector to the nearest whole number.
|
|
2230
|
+
* @returns
|
|
2231
|
+
*/
|
|
2232
|
+
round() {
|
|
2233
|
+
const x = Math.round(this.x);
|
|
2234
|
+
const y = Math.round(this.y);
|
|
2235
|
+
const z = Math.round(this.z);
|
|
2236
|
+
return new _Vector3f(x, y, z);
|
|
2237
|
+
}
|
|
2238
|
+
/**
|
|
2239
|
+
* Ceils the coordinates of the 3D vector.
|
|
2240
|
+
* @returns The 3D vector with the coordinates ceiled.
|
|
2241
|
+
*/
|
|
2242
|
+
ceil() {
|
|
2243
|
+
const x = Math.ceil(this.x);
|
|
2244
|
+
const y = Math.ceil(this.y);
|
|
2245
|
+
const z = Math.ceil(this.z);
|
|
2246
|
+
return new _Vector3f(x, y, z);
|
|
2247
|
+
}
|
|
2173
2248
|
/**
|
|
2174
2249
|
* Floors the coordinates of the 3D vector.
|
|
2175
|
-
*
|
|
2176
2250
|
* @returns The 3D vector with the coordinates floored.
|
|
2177
2251
|
*/
|
|
2178
2252
|
floor() {
|
|
@@ -2181,9 +2255,106 @@ var Vector3f = class _Vector3f extends import_raknet8.DataType {
|
|
|
2181
2255
|
const z = Math.floor(this.z);
|
|
2182
2256
|
return new _Vector3f(x, y, z);
|
|
2183
2257
|
}
|
|
2258
|
+
/**
|
|
2259
|
+
* Adds another 3D vector to this 3D vector.
|
|
2260
|
+
* @param other The other 3D vector to add.
|
|
2261
|
+
* @returns The result of the addition.
|
|
2262
|
+
*/
|
|
2263
|
+
add(other) {
|
|
2264
|
+
return new _Vector3f(this.x + other.x, this.y + other.y, this.z + other.z);
|
|
2265
|
+
}
|
|
2266
|
+
/**
|
|
2267
|
+
* Subtracts another 3D vector from this 3D vector.
|
|
2268
|
+
* @param other The other 3D vector to subtract.
|
|
2269
|
+
* @returns The result of the subtraction.
|
|
2270
|
+
*/
|
|
2184
2271
|
subtract(other) {
|
|
2185
2272
|
return new _Vector3f(this.x - other.x, this.y - other.y, this.z - other.z);
|
|
2186
2273
|
}
|
|
2274
|
+
/**
|
|
2275
|
+
* Multiplies this 3D vector with a scalar.
|
|
2276
|
+
* @param scalar The scalar to multiply with.
|
|
2277
|
+
* @returns The result of the multiplication.
|
|
2278
|
+
*/
|
|
2279
|
+
multiply(scalar) {
|
|
2280
|
+
return new _Vector3f(this.x * scalar, this.y * scalar, this.z * scalar);
|
|
2281
|
+
}
|
|
2282
|
+
/**
|
|
2283
|
+
* Divides this 3D vector with a scalar.
|
|
2284
|
+
* @param scalar The scalar to divide with.
|
|
2285
|
+
* @returns The result of the division.
|
|
2286
|
+
*/
|
|
2287
|
+
divide(scalar) {
|
|
2288
|
+
return new _Vector3f(this.x / scalar, this.y / scalar, this.z / scalar);
|
|
2289
|
+
}
|
|
2290
|
+
/**
|
|
2291
|
+
* Calculates the dot product between this 3D vector and another 3D vector.
|
|
2292
|
+
* @param other The other 3D vector to calculate the dot product with.
|
|
2293
|
+
* @returns The result of the dot product.
|
|
2294
|
+
*/
|
|
2295
|
+
dot(other) {
|
|
2296
|
+
return this.x * other.x + this.y * other.y + this.z * other.z;
|
|
2297
|
+
}
|
|
2298
|
+
/**
|
|
2299
|
+
* Calculates the cross product between this 3D vector and another 3D vector.
|
|
2300
|
+
* @param other The other 3D vector to calculate the cross product with.
|
|
2301
|
+
* @returns The result of the cross product.
|
|
2302
|
+
*/
|
|
2303
|
+
cross(other) {
|
|
2304
|
+
const x = this.y * other.z - this.z * other.y;
|
|
2305
|
+
const y = this.z * other.x - this.x * other.z;
|
|
2306
|
+
const z = this.x * other.y - this.y * other.x;
|
|
2307
|
+
return new _Vector3f(x, y, z);
|
|
2308
|
+
}
|
|
2309
|
+
/**
|
|
2310
|
+
* Calculates the length of this 3D vector.
|
|
2311
|
+
* @returns The length of the 3D vector.
|
|
2312
|
+
*/
|
|
2313
|
+
length() {
|
|
2314
|
+
return Math.hypot(this.x, this.y, this.z);
|
|
2315
|
+
}
|
|
2316
|
+
/**
|
|
2317
|
+
* Normalizes this 3D vector.
|
|
2318
|
+
* @returns The normalized 3D vector.
|
|
2319
|
+
*/
|
|
2320
|
+
normalize() {
|
|
2321
|
+
const length = this.length();
|
|
2322
|
+
return new _Vector3f(this.x / length, this.y / length, this.z / length);
|
|
2323
|
+
}
|
|
2324
|
+
/**
|
|
2325
|
+
* Linearly interpolates between this 3D vector and another 3D vector.
|
|
2326
|
+
* @param other The other 3D vector to interpolate with.
|
|
2327
|
+
* @param t The interpolation factor.
|
|
2328
|
+
* @returns The interpolated 3D vector.
|
|
2329
|
+
*/
|
|
2330
|
+
lerp(other, t) {
|
|
2331
|
+
return new _Vector3f(
|
|
2332
|
+
this.x + (other.x - this.x) * t,
|
|
2333
|
+
this.y + (other.y - this.y) * t,
|
|
2334
|
+
this.z + (other.z - this.z) * t
|
|
2335
|
+
);
|
|
2336
|
+
}
|
|
2337
|
+
/**
|
|
2338
|
+
* Spherically interpolates between this 3D vector and another 3D vector.
|
|
2339
|
+
* @param other The other 3D vector to interpolate with.
|
|
2340
|
+
* @param t The interpolation factor.
|
|
2341
|
+
* @returns The interpolated 3D vector.
|
|
2342
|
+
*/
|
|
2343
|
+
slerp(other, t) {
|
|
2344
|
+
const dot = this.dot(other);
|
|
2345
|
+
const theta = Math.acos(dot);
|
|
2346
|
+
const sinTheta = Math.sin(theta);
|
|
2347
|
+
const a = Math.sin((1 - t) * theta) / sinTheta;
|
|
2348
|
+
const b = Math.sin(t * theta) / sinTheta;
|
|
2349
|
+
return this.multiply(a).add(other.multiply(b));
|
|
2350
|
+
}
|
|
2351
|
+
/**
|
|
2352
|
+
* Returns a string representation of this 3D vector.
|
|
2353
|
+
* @returns The string representation of this 3D vector.
|
|
2354
|
+
*/
|
|
2355
|
+
equals(other) {
|
|
2356
|
+
return this.x === other.x && this.y === other.y && this.z === other.z;
|
|
2357
|
+
}
|
|
2187
2358
|
/**
|
|
2188
2359
|
* Reads a 3D vector from the stream.
|
|
2189
2360
|
*
|
|
@@ -5107,9 +5278,6 @@ var InventoryTransaction = class _InventoryTransaction extends import_raknet59.D
|
|
|
5107
5278
|
const action = InventoryAction.read(stream);
|
|
5108
5279
|
actions.push(action);
|
|
5109
5280
|
}
|
|
5110
|
-
if (actions.length > 0) {
|
|
5111
|
-
return new _InventoryTransaction(type, actions);
|
|
5112
|
-
}
|
|
5113
5281
|
switch (type) {
|
|
5114
5282
|
default: {
|
|
5115
5283
|
throw new Error(
|
|
@@ -6354,6 +6522,10 @@ var PlayerAuthInputPacket = class extends DataPacket {
|
|
|
6354
6522
|
headYaw;
|
|
6355
6523
|
inputData;
|
|
6356
6524
|
inputMode;
|
|
6525
|
+
playMode;
|
|
6526
|
+
newInteractionModel;
|
|
6527
|
+
currentTick;
|
|
6528
|
+
positionDelta;
|
|
6357
6529
|
};
|
|
6358
6530
|
__decorateClass([
|
|
6359
6531
|
(0, import_raknet103.Serialize)(import_binarystream61.Float32, import_binarystream61.Endianness.Little)
|
|
@@ -6376,6 +6548,18 @@ __decorateClass([
|
|
|
6376
6548
|
__decorateClass([
|
|
6377
6549
|
(0, import_raknet103.Serialize)(import_binarystream61.VarInt)
|
|
6378
6550
|
], PlayerAuthInputPacket.prototype, "inputMode", 2);
|
|
6551
|
+
__decorateClass([
|
|
6552
|
+
(0, import_raknet103.Serialize)(import_binarystream61.VarInt)
|
|
6553
|
+
], PlayerAuthInputPacket.prototype, "playMode", 2);
|
|
6554
|
+
__decorateClass([
|
|
6555
|
+
(0, import_raknet103.Serialize)(import_binarystream61.VarInt)
|
|
6556
|
+
], PlayerAuthInputPacket.prototype, "newInteractionModel", 2);
|
|
6557
|
+
__decorateClass([
|
|
6558
|
+
(0, import_raknet103.Serialize)(import_binarystream61.VarLong)
|
|
6559
|
+
], PlayerAuthInputPacket.prototype, "currentTick", 2);
|
|
6560
|
+
__decorateClass([
|
|
6561
|
+
(0, import_raknet103.Serialize)(Vector3f)
|
|
6562
|
+
], PlayerAuthInputPacket.prototype, "positionDelta", 2);
|
|
6379
6563
|
PlayerAuthInputPacket = __decorateClass([
|
|
6380
6564
|
(0, import_raknet103.Proto)(144 /* PlayerAuthInput */)
|
|
6381
6565
|
], PlayerAuthInputPacket);
|
|
@@ -7746,6 +7930,7 @@ var MINECRAFT_TICK_SPEED = 50;
|
|
|
7746
7930
|
PlayStatusPacket,
|
|
7747
7931
|
PlayerActionPacket,
|
|
7748
7932
|
PlayerAttributes,
|
|
7933
|
+
PlayerAuthInputData,
|
|
7749
7934
|
PlayerAuthInputPacket,
|
|
7750
7935
|
PlayerHotbarPacket,
|
|
7751
7936
|
PlayerListAction,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenityjs/protocol",
|
|
3
|
-
"version": "0.2.3-beta-
|
|
3
|
+
"version": "0.2.3-beta-20240522190240",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"repository": "https://github.com/SerenityJS/serenity",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
"preset": "@serenityjs/jest-presets/jest/node"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@serenityjs/eslint-config": "0.2.3-beta-
|
|
22
|
-
"@serenityjs/jest-presets": "0.2.3-beta-
|
|
23
|
-
"@serenityjs/typescript-config": "0.2.3-beta-
|
|
21
|
+
"@serenityjs/eslint-config": "0.2.3-beta-20240522190240",
|
|
22
|
+
"@serenityjs/jest-presets": "0.2.3-beta-20240522190240",
|
|
23
|
+
"@serenityjs/typescript-config": "0.2.3-beta-20240522190240",
|
|
24
24
|
"@types/jest": "^29.5.12",
|
|
25
25
|
"@types/node": "^20.11.24",
|
|
26
26
|
"jest": "^29.7.0",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@serenityjs/binarystream": "^2.5.2",
|
|
32
|
-
"@serenityjs/nbt": "0.2.3-beta-
|
|
33
|
-
"@serenityjs/raknet": "0.2.3-beta-
|
|
32
|
+
"@serenityjs/nbt": "0.2.3-beta-20240522190240",
|
|
33
|
+
"@serenityjs/raknet": "0.2.3-beta-20240522190240"
|
|
34
34
|
}
|
|
35
35
|
}
|