@serenityjs/protocol 0.5.1-beta-20240915233340 → 0.5.1-beta-20240916023948
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 +50 -41
- package/dist/index.js +103 -56
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ declare enum Packet {
|
|
|
65
65
|
ResourcePackChunkData = 83,// 83
|
|
66
66
|
ResourcePackChunkRequest = 84,// 84
|
|
67
67
|
Transfer = 85,// 85
|
|
68
|
+
PlaySound = 86,// 86
|
|
68
69
|
SetTitle = 88,// 88
|
|
69
70
|
StructureBlockUpdate = 90,// 90
|
|
70
71
|
PlayerSkin = 93,// 93
|
|
@@ -2457,7 +2458,7 @@ declare class Vector2f extends DataType {
|
|
|
2457
2458
|
static write(stream: BinaryStream, value: Vector2f): void;
|
|
2458
2459
|
}
|
|
2459
2460
|
|
|
2460
|
-
declare class
|
|
2461
|
+
declare class BlockPosition extends DataType implements IPosition {
|
|
2461
2462
|
x: number;
|
|
2462
2463
|
y: number;
|
|
2463
2464
|
z: number;
|
|
@@ -2466,53 +2467,53 @@ declare class BlockCoordinates extends DataType implements IPosition {
|
|
|
2466
2467
|
* Rounds the coordinates of the 3D position to the nearest whole number.
|
|
2467
2468
|
* @returns
|
|
2468
2469
|
*/
|
|
2469
|
-
round():
|
|
2470
|
+
round(): BlockPosition;
|
|
2470
2471
|
/**
|
|
2471
2472
|
* Ceils the coordinates of the 3D position.
|
|
2472
2473
|
* @returns The 3D position with the coordinates ceiled.
|
|
2473
2474
|
*/
|
|
2474
|
-
ceil():
|
|
2475
|
+
ceil(): BlockPosition;
|
|
2475
2476
|
/**
|
|
2476
2477
|
* Floors the coordinates of the 3D position.
|
|
2477
2478
|
* @returns The 3D position with the coordinates floored.
|
|
2478
2479
|
*/
|
|
2479
|
-
floor():
|
|
2480
|
+
floor(): BlockPosition;
|
|
2480
2481
|
/**
|
|
2481
2482
|
* Adds another 3D position to this 3D position.
|
|
2482
2483
|
* @param other The other 3D position to add.
|
|
2483
2484
|
* @returns The result of the addition.
|
|
2484
2485
|
*/
|
|
2485
|
-
add(other:
|
|
2486
|
+
add(other: BlockPosition): BlockPosition;
|
|
2486
2487
|
/**
|
|
2487
2488
|
* Subtracts another 3D position from this 3D position.
|
|
2488
2489
|
* @param other The other 3D position to subtract.
|
|
2489
2490
|
* @returns The result of the subtraction.
|
|
2490
2491
|
*/
|
|
2491
|
-
subtract(other:
|
|
2492
|
+
subtract(other: BlockPosition): BlockPosition;
|
|
2492
2493
|
/**
|
|
2493
2494
|
* Multiplies this 3D position with a scalar.
|
|
2494
2495
|
* @param scalar The scalar to multiply with.
|
|
2495
2496
|
* @returns The result of the multiplication.
|
|
2496
2497
|
*/
|
|
2497
|
-
multiply(scalar: number):
|
|
2498
|
+
multiply(scalar: number): BlockPosition;
|
|
2498
2499
|
/**
|
|
2499
2500
|
* Divides this 3D position with a scalar.
|
|
2500
2501
|
* @param scalar The scalar to divide with.
|
|
2501
2502
|
* @returns The result of the division.
|
|
2502
2503
|
*/
|
|
2503
|
-
divide(scalar: number):
|
|
2504
|
+
divide(scalar: number): BlockPosition;
|
|
2504
2505
|
/**
|
|
2505
2506
|
* Calculates the dot product between this 3D position and another 3D position.
|
|
2506
2507
|
* @param other The other 3D position to calculate the dot product with.
|
|
2507
2508
|
* @returns The result of the dot product.
|
|
2508
2509
|
*/
|
|
2509
|
-
dot(other:
|
|
2510
|
+
dot(other: BlockPosition): number;
|
|
2510
2511
|
/**
|
|
2511
2512
|
* Calculates the cross product between this 3D position and another 3D position.
|
|
2512
2513
|
* @param other The other 3D position to calculate the cross product with.
|
|
2513
2514
|
* @returns The result of the cross product.
|
|
2514
2515
|
*/
|
|
2515
|
-
cross(other:
|
|
2516
|
+
cross(other: BlockPosition): BlockPosition;
|
|
2516
2517
|
/**
|
|
2517
2518
|
* Calculates the length of this 3D position.
|
|
2518
2519
|
* @returns The length of the 3D position.
|
|
@@ -2527,50 +2528,50 @@ declare class BlockCoordinates extends DataType implements IPosition {
|
|
|
2527
2528
|
* Normalizes this 3D position.
|
|
2528
2529
|
* @returns The normalized 3D position.
|
|
2529
2530
|
*/
|
|
2530
|
-
normalize():
|
|
2531
|
+
normalize(): BlockPosition;
|
|
2531
2532
|
/**
|
|
2532
2533
|
* Linearly interpolates between this 3D position and another 3D position.
|
|
2533
2534
|
* @param other The other 3D position to interpolate with.
|
|
2534
2535
|
* @param t The interpolation factor.
|
|
2535
2536
|
* @returns The interpolated 3D position.
|
|
2536
2537
|
*/
|
|
2537
|
-
lerp(other:
|
|
2538
|
+
lerp(other: BlockPosition, t: number): BlockPosition;
|
|
2538
2539
|
/**
|
|
2539
2540
|
* Spherically interpolates between this 3D position and another 3D position.
|
|
2540
2541
|
* @param other The other 3D position to interpolate with.
|
|
2541
2542
|
* @param t The interpolation factor.
|
|
2542
2543
|
* @returns The interpolated 3D position.
|
|
2543
2544
|
*/
|
|
2544
|
-
slerp(other:
|
|
2545
|
+
slerp(other: BlockPosition, t: number): BlockPosition;
|
|
2545
2546
|
/**
|
|
2546
2547
|
* Returns a string representation of this 3D position.
|
|
2547
2548
|
* @returns The string representation of this 3D position.
|
|
2548
2549
|
*/
|
|
2549
|
-
equals(other:
|
|
2550
|
+
equals(other: BlockPosition): boolean;
|
|
2550
2551
|
/**
|
|
2551
2552
|
* Gets the distance between this 3D position and another 3D position.
|
|
2552
2553
|
* @param other The other 3D position to get the distance to.
|
|
2553
2554
|
* @returns The distance between the 3D positions.
|
|
2554
2555
|
*/
|
|
2555
|
-
distance(other:
|
|
2556
|
+
distance(other: BlockPosition): number;
|
|
2556
2557
|
/**
|
|
2557
2558
|
* Computes the absolute value of each coordinate of the 3D vector.
|
|
2558
2559
|
* @returnsthe absolute value of this 3D vector.
|
|
2559
2560
|
*/
|
|
2560
|
-
absolute():
|
|
2561
|
-
static read(stream: BinaryStream):
|
|
2562
|
-
static write(stream: BinaryStream, value:
|
|
2561
|
+
absolute(): BlockPosition;
|
|
2562
|
+
static read(stream: BinaryStream): BlockPosition;
|
|
2563
|
+
static write(stream: BinaryStream, value: BlockPosition): void;
|
|
2563
2564
|
/**
|
|
2564
|
-
* Converts a
|
|
2565
|
-
* @param position - The
|
|
2566
|
-
* @returns The converted
|
|
2565
|
+
* Converts a BlockPosition to a BlockPosition
|
|
2566
|
+
* @param position - The BlockPosition to convert
|
|
2567
|
+
* @returns The converted BlockPosition
|
|
2567
2568
|
*/
|
|
2568
|
-
static fromVector3f(position: Vector3f):
|
|
2569
|
+
static fromVector3f(position: Vector3f): BlockPosition;
|
|
2569
2570
|
/**
|
|
2570
|
-
* Converts the
|
|
2571
|
-
* @returns The converted
|
|
2571
|
+
* Converts the BlockPosition to a BlockPosition
|
|
2572
|
+
* @returns The converted BlockPosition
|
|
2572
2573
|
*/
|
|
2573
|
-
static toVector3f(coordinates:
|
|
2574
|
+
static toVector3f(coordinates: BlockPosition): Vector3f;
|
|
2574
2575
|
}
|
|
2575
2576
|
|
|
2576
2577
|
declare class GameRules extends DataType {
|
|
@@ -3623,7 +3624,7 @@ declare class ItemUseInventoryTransaction extends DataType {
|
|
|
3623
3624
|
/**
|
|
3624
3625
|
* The block position of the item use inventory transaction.
|
|
3625
3626
|
*/
|
|
3626
|
-
readonly blockPosition:
|
|
3627
|
+
readonly blockPosition: BlockPosition;
|
|
3627
3628
|
/**
|
|
3628
3629
|
* The block face of the item use inventory transaction.
|
|
3629
3630
|
*/
|
|
@@ -3666,7 +3667,7 @@ declare class ItemUseInventoryTransaction extends DataType {
|
|
|
3666
3667
|
* @param networkBlockId The network block id of the item use inventory transaction.
|
|
3667
3668
|
* @param initialTransaction Whether or not the transaction is an initial transaction.
|
|
3668
3669
|
*/
|
|
3669
|
-
constructor(type: ItemUseInventoryTransactionType, triggerType: TriggerType, blockPosition:
|
|
3670
|
+
constructor(type: ItemUseInventoryTransactionType, triggerType: TriggerType, blockPosition: BlockPosition, face: BlockFace, slot: number, item: NetworkItemStackDescriptor, fromPosition: Vector3f, clickPosition: Vector3f, networkBlockId: number, initialTransaction: boolean);
|
|
3670
3671
|
static read(stream: BinaryStream): ItemUseInventoryTransaction;
|
|
3671
3672
|
static write(stream: BinaryStream, value: ItemUseInventoryTransaction): void;
|
|
3672
3673
|
}
|
|
@@ -4559,8 +4560,8 @@ declare class StructureSettings extends DataType {
|
|
|
4559
4560
|
ignoreEntities: boolean;
|
|
4560
4561
|
ignoreBlocks: boolean;
|
|
4561
4562
|
allowNonTicking: boolean;
|
|
4562
|
-
size:
|
|
4563
|
-
offset:
|
|
4563
|
+
size: BlockPosition;
|
|
4564
|
+
offset: BlockPosition;
|
|
4564
4565
|
lastEdit: bigint;
|
|
4565
4566
|
rotation: number;
|
|
4566
4567
|
mirror: number;
|
|
@@ -4569,7 +4570,7 @@ declare class StructureSettings extends DataType {
|
|
|
4569
4570
|
integrityValue: number;
|
|
4570
4571
|
integritySeed: number;
|
|
4571
4572
|
rotationPivot: Vector3f;
|
|
4572
|
-
constructor(structurePalletName: string, ignoreEntities: boolean, ignoreBlocks: boolean, allowNonTicking: boolean, size:
|
|
4573
|
+
constructor(structurePalletName: string, ignoreEntities: boolean, ignoreBlocks: boolean, allowNonTicking: boolean, size: BlockPosition, offset: BlockPosition, lastEdit: bigint, rotation: number, mirror: number, animationMode: number, animationSeconds: number, integrityValue: number, integritySeed: number, rotationPivot: Vector3f);
|
|
4573
4574
|
static write(stream: BinaryStream, value: StructureSettings): void;
|
|
4574
4575
|
static read(stream: BinaryStream): StructureSettings;
|
|
4575
4576
|
}
|
|
@@ -5209,7 +5210,7 @@ declare class ContainerClosePacket extends DataPacket {
|
|
|
5209
5210
|
declare class ContainerOpenPacket extends DataPacket {
|
|
5210
5211
|
identifier: ContainerId;
|
|
5211
5212
|
type: ContainerType;
|
|
5212
|
-
position:
|
|
5213
|
+
position: BlockPosition;
|
|
5213
5214
|
uniqueId: bigint;
|
|
5214
5215
|
}
|
|
5215
5216
|
|
|
@@ -5333,7 +5334,7 @@ declare class MovePlayerPacket extends DataPacket {
|
|
|
5333
5334
|
}
|
|
5334
5335
|
|
|
5335
5336
|
declare class NetworkChunkPublisherUpdatePacket extends DataPacket {
|
|
5336
|
-
coordinate:
|
|
5337
|
+
coordinate: BlockPosition;
|
|
5337
5338
|
radius: number;
|
|
5338
5339
|
savedChunks: Array<ChunkCoords>;
|
|
5339
5340
|
}
|
|
@@ -5360,8 +5361,8 @@ declare class PlayStatusPacket extends DataPacket {
|
|
|
5360
5361
|
declare class PlayerActionPacket extends DataPacket {
|
|
5361
5362
|
entityRuntimeId: bigint;
|
|
5362
5363
|
action: ActionIds;
|
|
5363
|
-
blockPosition:
|
|
5364
|
-
resultPosition:
|
|
5364
|
+
blockPosition: BlockPosition;
|
|
5365
|
+
resultPosition: BlockPosition;
|
|
5365
5366
|
face: number;
|
|
5366
5367
|
}
|
|
5367
5368
|
|
|
@@ -5547,7 +5548,7 @@ declare class StartGamePacket extends DataPacket {
|
|
|
5547
5548
|
worldGamemode: Gamemode;
|
|
5548
5549
|
hardcore: boolean;
|
|
5549
5550
|
difficulty: Difficulty;
|
|
5550
|
-
spawnPosition:
|
|
5551
|
+
spawnPosition: BlockPosition;
|
|
5551
5552
|
achievementsDisabled: boolean;
|
|
5552
5553
|
editorWorldType: number;
|
|
5553
5554
|
createdInEdior: boolean;
|
|
@@ -5656,7 +5657,7 @@ declare class UpdateAttributesPacket extends DataPacket {
|
|
|
5656
5657
|
}
|
|
5657
5658
|
|
|
5658
5659
|
declare class UpdateBlockPacket extends DataPacket {
|
|
5659
|
-
position:
|
|
5660
|
+
position: BlockPosition;
|
|
5660
5661
|
networkBlockId: number;
|
|
5661
5662
|
flags: UpdateBlockFlagsType;
|
|
5662
5663
|
layer: UpdateBlockLayerType;
|
|
@@ -5762,7 +5763,7 @@ declare class PlayerSkinPacket extends DataPacket {
|
|
|
5762
5763
|
}
|
|
5763
5764
|
|
|
5764
5765
|
declare class BlockActorDataPacket extends DataPacket {
|
|
5765
|
-
position:
|
|
5766
|
+
position: BlockPosition;
|
|
5766
5767
|
nbt: CompoundTag<unknown>;
|
|
5767
5768
|
}
|
|
5768
5769
|
|
|
@@ -5814,7 +5815,7 @@ declare class NpcRequestPacket extends DataPacket {
|
|
|
5814
5815
|
}
|
|
5815
5816
|
|
|
5816
5817
|
declare class OpenSignPacket extends DataPacket {
|
|
5817
|
-
position:
|
|
5818
|
+
position: BlockPosition;
|
|
5818
5819
|
isFrontSide: boolean;
|
|
5819
5820
|
}
|
|
5820
5821
|
|
|
@@ -5876,7 +5877,7 @@ declare class AvailableActorIdentifiersPacket extends DataPacket {
|
|
|
5876
5877
|
}
|
|
5877
5878
|
|
|
5878
5879
|
declare class StructureBlockUpdatePacket extends DataPacket {
|
|
5879
|
-
blockPosition:
|
|
5880
|
+
blockPosition: BlockPosition;
|
|
5880
5881
|
structureEditData: StructureEditorData;
|
|
5881
5882
|
trigger: boolean;
|
|
5882
5883
|
isWaterLogged: boolean;
|
|
@@ -5907,7 +5908,7 @@ declare class RiderJumpPacket extends DataPacket {
|
|
|
5907
5908
|
}
|
|
5908
5909
|
|
|
5909
5910
|
declare class BlockEventPacket extends DataPacket {
|
|
5910
|
-
position:
|
|
5911
|
+
position: BlockPosition;
|
|
5911
5912
|
type: BlockEventType;
|
|
5912
5913
|
data: number;
|
|
5913
5914
|
}
|
|
@@ -5950,6 +5951,13 @@ declare class ServerboundDiagnosticsPacket extends DataPacket {
|
|
|
5950
5951
|
unaccountedTimePercent: number;
|
|
5951
5952
|
}
|
|
5952
5953
|
|
|
5954
|
+
declare class PlaySoundPacket extends DataPacket {
|
|
5955
|
+
name: string;
|
|
5956
|
+
position: BlockPosition;
|
|
5957
|
+
volume: number;
|
|
5958
|
+
pitch: number;
|
|
5959
|
+
}
|
|
5960
|
+
|
|
5953
5961
|
declare const Packets: {
|
|
5954
5962
|
1: typeof LoginPacket;
|
|
5955
5963
|
2: typeof PlayStatusPacket;
|
|
@@ -6012,6 +6020,7 @@ declare const Packets: {
|
|
|
6012
6020
|
83: typeof ResourcePackChunkDataPacket;
|
|
6013
6021
|
84: typeof ResourcePackChunkRequestPacket;
|
|
6014
6022
|
85: typeof TransferPacket;
|
|
6023
|
+
86: typeof PlaySoundPacket;
|
|
6015
6024
|
88: typeof SetTitlePacket;
|
|
6016
6025
|
90: typeof StructureBlockUpdatePacket;
|
|
6017
6026
|
93: typeof PlayerSkinPacket;
|
|
@@ -6082,4 +6091,4 @@ declare const PROTOCOL_VERSION = 712;
|
|
|
6082
6091
|
declare const MINECRAFT_VERSION = "1.21.20";
|
|
6083
6092
|
declare const MINECRAFT_TICK_SPEED = 50;
|
|
6084
6093
|
|
|
6085
|
-
export { AbilityIndex, AbilityLayer, AbilityLayerType, AbilitySet, AbilitySetId, ActionIds, ActorDamageCause, ActorData, ActorDataId, ActorDataType, ActorEventIds, ActorEventPacket, ActorFlag, AddEntityPacket, AddItemActorPacket, AddPlayerPacket, AnimateAction, AnimateEntity, AnimateEntityPacket, AnimateId, AnimatePacket, Attribute, AttributeModifier, AttributeName, AvailableActorIdentifiersPacket, AvailableCommandsPacket, AwardAchievementPacket, BehaviorPackInfo, BiomeDefinitionListPacket, BlockAction, BlockActorDataPacket,
|
|
6094
|
+
export { AbilityIndex, AbilityLayer, AbilityLayerType, AbilitySet, AbilitySetId, ActionIds, ActorDamageCause, ActorData, ActorDataId, ActorDataType, ActorEventIds, ActorEventPacket, ActorFlag, AddEntityPacket, AddItemActorPacket, AddPlayerPacket, AnimateAction, AnimateEntity, AnimateEntityPacket, AnimateId, AnimatePacket, Attribute, AttributeModifier, AttributeName, AvailableActorIdentifiersPacket, AvailableCommandsPacket, AwardAchievementPacket, BehaviorPackInfo, BiomeDefinitionListPacket, BlockAction, BlockActorDataPacket, BlockEventPacket, BlockEventType, BlockFace, BlockPickRequestPacket, BlockPosition, BlockProperties, BookActions, BookEditAction, BookEditPacket, BossEventAdd, BossEventColor, BossEventPacket, BossEventUpdate, BossEventUpdateType, CameraAudioListener, CameraFadeDuration, CameraFadeInstruction, CameraInstructions, CameraInstructionsPacket, CameraPreset, CameraPresetsPacket, CameraSetEasing, CameraSetInstruction, CameraShakePacket, ChainedSubcommandValues, ChangeDimensionPacket, ChunkCoords, ChunkRadiusUpdatePacket, type ClientData, ClientPredictedVehicle, ClientToServerHandshakePacket, ClientboundCloseFormPacket, Color, CommandOriginData, CommandOutputData, CommandOutputMessage, CommandOutputPacket, CommandParameterType, CommandPermissionLevel, CommandRequestPacket, Commands, CompletedUsingItemPacket, ComplexInventoryTransaction, ComponentItem, CompressionMethod, ContainerClosePacket, ContainerDataType, ContainerId, ContainerMixDataEntry, ContainerName, ContainerOpenPacket, ContainerSetDataPacket, ContainerType, CraftingDataEntry, CraftingDataEntryType, CraftingDataPacket, CreativeContentPacket, CreativeItems, DataItem, DataPacket, DeathInfoPacket, DeathParameters, DeviceOS, Difficulty, DimensionDataPacket, DimensionDefinition, DimensionDefinitionGroup, DimensionType, DisconnectMessage, DisconnectPacket, DisconnectReason, DisplaySlotType, DynamicEnums, EasingType, EffectType, EmoteFlags, EmoteListPacket, EmotePacket, Emotes, EnchantOption, Enchantment, EntityAttributes, EntityPickRequestPacket, EnumConstraints, EnumValues, Enums, EquipmentSlot, Experiments, Framer, FullContainerName, GameRuleType, GameRules, Gamemode, GeneratorType, HUDElement, HUDElementId, HUDVisibility, HurtArmorPacket, type IPosition, type IdentityData, InputDataFlags, InputLockFlags, InputMode, InputTransaction, InteractActions, InteractPacket, InteractPosition, InteractionMode, InternalType, InventoryAction, InventoryContentPacket, InventoryLayout, InventoryLeftTab, InventoryRightTab, InventorySlotPacket, InventorySource, InventorySourceType, InventoryTransaction, InventoryTransactionPacket, ItemComponentPacket, ItemData, ItemInstanceUserData, ItemReleaseInventoryTransaction, ItemReleaseInventoryTransactionType, ItemStackActionTakePlace, type ItemStackContainer, ItemStackRequest, ItemStackRequestAction, ItemStackRequestActionBeanconPayment, ItemStackRequestActionCraftCreative, ItemStackRequestActionCraftGrindstoneRequest, ItemStackRequestActionCraftLoomRequest, ItemStackRequestActionCraftRecipe, ItemStackRequestActionCraftRecipeAuto, ItemStackRequestActionCreate, ItemStackRequestActionDestroyConsume, ItemStackRequestActionDrop, ItemStackRequestActionMineBlock, ItemStackRequestActionOptional, ItemStackRequestActionResultsDeprecated, ItemStackRequestActionSwap, ItemStackRequestActionType, ItemStackRequestPacket, ItemStackRequestSlotInfo, ItemStackResponsePacket, ItemStackResponses, ItemStackStatus, ItemStacks, ItemUseInventoryTransaction, ItemUseInventoryTransactionType, ItemUseMethod, ItemUseOnEntityInventoryTransaction, ItemUseOnEntityInventoryTransactionType, LegacyTransaction, LevelChunkPacket, LevelEvent, LevelEventPacket, LevelSoundEvent, LevelSoundEventPacket, Links, LoginPacket, type LoginTokenData, LoginTokens, MINECRAFT_TICK_SPEED, MINECRAFT_VERSION, MaterialReducerDataEntry, MobArmorEquipmentPacket, MobEffectEvents, MobEffectPacket, MobEquipmentPacket, ModalFormCanceled, ModalFormCanceledReason, ModalFormData, ModalFormRequestPacket, ModalFormResponsePacket, ModalFormType, MoveActorAbsolutePacket, MoveMode, MovePlayerPacket, NetworkChunkPublisherUpdatePacket, NetworkItemInstanceDescriptor, NetworkItemStackDescriptor, NetworkSettingsPacket, NetworkStackLatencyPacket, NpcDialogueAction, NpcDialoguePacket, NpcRequestPacket, NpcRequestType, ObjectiveSortOrder, OnScreenTextureAnimationPacket, OpenSignPacket, Optional, PROTOCOL_VERSION, PackLinks, PackType, Packet, PacketViolationWarningPacket, Packets, PermissionLevel, PlayMode, PlaySoundPacket, PlayStatus, PlayStatusPacket, PlayerActionPacket, PlayerAuthInputData, PlayerAuthInputPacket, PlayerEnchantOptionsPacket, PlayerHotbarPacket, PlayerListAction, PlayerListPacket, PlayerListRecord, PlayerSkinPacket, PlayerStartItemCooldownPacket, PostFixes, PotionMixDataEntry, PropertySyncData, RecipeIngredient, RecipeUnlockingRequirement, RemoveEntityPacket, RemoveObjectivePacket, RequestChunkRadiusPacket, RequestNetworkSettingsPacket, ResourceIdVersions, ResourcePackChunkDataPacket, ResourcePackChunkRequestPacket, ResourcePackClientResponsePacket, ResourcePackDataInfoPacket, ResourcePackIds, ResourcePackResponse, ResourcePackStackPacket, ResourcePacksInfoPacket, RespawnPacket, RespawnState, RiderJumpPacket, Rotation, ScoreEntry, ScoreboardActionType, ScoreboardIdentity, ScoreboardIdentityAction, ScoreboardIdentityType, ScriptMessagePacket, SerializedSkin, ServerToClientHandshakePacket, ServerboundDiagnosticsPacket, ServerboundLoadingScreenPacketPacket, ServerboundLoadingScreenType, SetActorDataPacket, SetActorMotionPacket, SetCommandsEnabledPacket, SetDisplayObjectivePacket, SetHudPacket, SetLocalPlayerAsInitializedPacket, SetPlayerGameTypePacket, SetPlayerInventoryOptionsPacket, SetScorePacket, SetScoreboardIdentityPacket, SetTimePacket, SetTitlePacket, ShakeAction, ShakeType, ShapedRecipe, ShapelessRecipe, ShowCreditsPacket, SkinAnimation, SkinImage, SkinPersonaPiece, SkinPersonaTintPiece, SpawnParticleEffectPacket, StartGamePacket, StructureBlockUpdatePacket, StructureEditorData, StructureSettings, Subcommands, TakeItemActorPacket, TeleportCause, TextPacket, TextPacketType, TextParameters, TextSource, TexturePackInfo, TitleTypes, ToastRequestPacket, TransactionSourceType, TransferPacket, TriggerType, UnlockingContext, UpdateAbilitiesPacket, UpdateAdventureSettingsPacket, UpdateAttributesPacket, UpdateBlockFlagsType, UpdateBlockLayerType, UpdateBlockPacket, UpdateClientInputLocksPacket, VariableStringArray as VarStringArray, Vector2f, Vector3f, ViolationSeverity, ViolationType, getPacketId };
|
package/dist/index.js
CHANGED
|
@@ -52,11 +52,11 @@ __export(src_exports, {
|
|
|
52
52
|
BiomeDefinitionListPacket: () => BiomeDefinitionListPacket,
|
|
53
53
|
BlockAction: () => BlockAction,
|
|
54
54
|
BlockActorDataPacket: () => BlockActorDataPacket,
|
|
55
|
-
BlockCoordinates: () => BlockCoordinates,
|
|
56
55
|
BlockEventPacket: () => BlockEventPacket,
|
|
57
56
|
BlockEventType: () => BlockEventType,
|
|
58
57
|
BlockFace: () => BlockFace,
|
|
59
58
|
BlockPickRequestPacket: () => BlockPickRequestPacket,
|
|
59
|
+
BlockPosition: () => BlockPosition,
|
|
60
60
|
BlockProperties: () => BlockProperties,
|
|
61
61
|
BookActions: () => BookActions,
|
|
62
62
|
BookEditAction: () => BookEditAction,
|
|
@@ -247,6 +247,7 @@ __export(src_exports, {
|
|
|
247
247
|
Packets: () => Packets,
|
|
248
248
|
PermissionLevel: () => PermissionLevel,
|
|
249
249
|
PlayMode: () => PlayMode,
|
|
250
|
+
PlaySoundPacket: () => PlaySoundPacket,
|
|
250
251
|
PlayStatus: () => PlayStatus,
|
|
251
252
|
PlayStatusPacket: () => PlayStatusPacket,
|
|
252
253
|
PlayerActionPacket: () => PlayerActionPacket,
|
|
@@ -412,6 +413,7 @@ var Packet;
|
|
|
412
413
|
Packet2[Packet2["ResourcePackChunkData"] = 83] = "ResourcePackChunkData";
|
|
413
414
|
Packet2[Packet2["ResourcePackChunkRequest"] = 84] = "ResourcePackChunkRequest";
|
|
414
415
|
Packet2[Packet2["Transfer"] = 85] = "Transfer";
|
|
416
|
+
Packet2[Packet2["PlaySound"] = 86] = "PlaySound";
|
|
415
417
|
Packet2[Packet2["SetTitle"] = 88] = "SetTitle";
|
|
416
418
|
Packet2[Packet2["StructureBlockUpdate"] = 90] = "StructureBlockUpdate";
|
|
417
419
|
Packet2[Packet2["PlayerSkin"] = 93] = "PlayerSkin";
|
|
@@ -3187,11 +3189,11 @@ var Vector2f = class Vector2f2 extends import_raknet9.DataType {
|
|
|
3187
3189
|
}
|
|
3188
3190
|
};
|
|
3189
3191
|
|
|
3190
|
-
// src/proto/types/block-
|
|
3192
|
+
// src/proto/types/block-position.ts
|
|
3191
3193
|
var import_raknet10 = require("@serenityjs/raknet");
|
|
3192
|
-
var
|
|
3194
|
+
var BlockPosition = class BlockPosition2 extends import_raknet10.DataType {
|
|
3193
3195
|
static {
|
|
3194
|
-
__name(this, "
|
|
3196
|
+
__name(this, "BlockPosition");
|
|
3195
3197
|
}
|
|
3196
3198
|
x;
|
|
3197
3199
|
y;
|
|
@@ -3210,7 +3212,7 @@ var BlockCoordinates = class BlockCoordinates2 extends import_raknet10.DataType
|
|
|
3210
3212
|
const x = Math.round(this.x);
|
|
3211
3213
|
const y = Math.round(this.y);
|
|
3212
3214
|
const z = Math.round(this.z);
|
|
3213
|
-
return new
|
|
3215
|
+
return new BlockPosition2(x, y, z);
|
|
3214
3216
|
}
|
|
3215
3217
|
/**
|
|
3216
3218
|
* Ceils the coordinates of the 3D position.
|
|
@@ -3220,7 +3222,7 @@ var BlockCoordinates = class BlockCoordinates2 extends import_raknet10.DataType
|
|
|
3220
3222
|
const x = Math.ceil(this.x);
|
|
3221
3223
|
const y = Math.ceil(this.y);
|
|
3222
3224
|
const z = Math.ceil(this.z);
|
|
3223
|
-
return new
|
|
3225
|
+
return new BlockPosition2(x, y, z);
|
|
3224
3226
|
}
|
|
3225
3227
|
/**
|
|
3226
3228
|
* Floors the coordinates of the 3D position.
|
|
@@ -3230,7 +3232,7 @@ var BlockCoordinates = class BlockCoordinates2 extends import_raknet10.DataType
|
|
|
3230
3232
|
const x = Math.floor(this.x);
|
|
3231
3233
|
const y = Math.floor(this.y);
|
|
3232
3234
|
const z = Math.floor(this.z);
|
|
3233
|
-
return new
|
|
3235
|
+
return new BlockPosition2(x, y, z);
|
|
3234
3236
|
}
|
|
3235
3237
|
/**
|
|
3236
3238
|
* Adds another 3D position to this 3D position.
|
|
@@ -3238,7 +3240,7 @@ var BlockCoordinates = class BlockCoordinates2 extends import_raknet10.DataType
|
|
|
3238
3240
|
* @returns The result of the addition.
|
|
3239
3241
|
*/
|
|
3240
3242
|
add(other) {
|
|
3241
|
-
return new
|
|
3243
|
+
return new BlockPosition2(this.x + other.x, this.y + other.y, this.z + other.z);
|
|
3242
3244
|
}
|
|
3243
3245
|
/**
|
|
3244
3246
|
* Subtracts another 3D position from this 3D position.
|
|
@@ -3246,7 +3248,7 @@ var BlockCoordinates = class BlockCoordinates2 extends import_raknet10.DataType
|
|
|
3246
3248
|
* @returns The result of the subtraction.
|
|
3247
3249
|
*/
|
|
3248
3250
|
subtract(other) {
|
|
3249
|
-
return new
|
|
3251
|
+
return new BlockPosition2(this.x - other.x, this.y - other.y, this.z - other.z);
|
|
3250
3252
|
}
|
|
3251
3253
|
/**
|
|
3252
3254
|
* Multiplies this 3D position with a scalar.
|
|
@@ -3254,7 +3256,7 @@ var BlockCoordinates = class BlockCoordinates2 extends import_raknet10.DataType
|
|
|
3254
3256
|
* @returns The result of the multiplication.
|
|
3255
3257
|
*/
|
|
3256
3258
|
multiply(scalar) {
|
|
3257
|
-
return new
|
|
3259
|
+
return new BlockPosition2(this.x * scalar, this.y * scalar, this.z * scalar);
|
|
3258
3260
|
}
|
|
3259
3261
|
/**
|
|
3260
3262
|
* Divides this 3D position with a scalar.
|
|
@@ -3262,7 +3264,7 @@ var BlockCoordinates = class BlockCoordinates2 extends import_raknet10.DataType
|
|
|
3262
3264
|
* @returns The result of the division.
|
|
3263
3265
|
*/
|
|
3264
3266
|
divide(scalar) {
|
|
3265
|
-
return new
|
|
3267
|
+
return new BlockPosition2(this.x / scalar, this.y / scalar, this.z / scalar);
|
|
3266
3268
|
}
|
|
3267
3269
|
/**
|
|
3268
3270
|
* Calculates the dot product between this 3D position and another 3D position.
|
|
@@ -3281,7 +3283,7 @@ var BlockCoordinates = class BlockCoordinates2 extends import_raknet10.DataType
|
|
|
3281
3283
|
const x = this.y * other.z - this.z * other.y;
|
|
3282
3284
|
const y = this.z * other.x - this.x * other.z;
|
|
3283
3285
|
const z = this.x * other.y - this.y * other.x;
|
|
3284
|
-
return new
|
|
3286
|
+
return new BlockPosition2(x, y, z);
|
|
3285
3287
|
}
|
|
3286
3288
|
/**
|
|
3287
3289
|
* Calculates the length of this 3D position.
|
|
@@ -3303,7 +3305,7 @@ var BlockCoordinates = class BlockCoordinates2 extends import_raknet10.DataType
|
|
|
3303
3305
|
*/
|
|
3304
3306
|
normalize() {
|
|
3305
3307
|
const length = this.length();
|
|
3306
|
-
return new
|
|
3308
|
+
return new BlockPosition2(this.x / length, this.y / length, this.z / length);
|
|
3307
3309
|
}
|
|
3308
3310
|
/**
|
|
3309
3311
|
* Linearly interpolates between this 3D position and another 3D position.
|
|
@@ -3312,7 +3314,7 @@ var BlockCoordinates = class BlockCoordinates2 extends import_raknet10.DataType
|
|
|
3312
3314
|
* @returns The interpolated 3D position.
|
|
3313
3315
|
*/
|
|
3314
3316
|
lerp(other, t) {
|
|
3315
|
-
return new
|
|
3317
|
+
return new BlockPosition2(this.x + (other.x - this.x) * t, this.y + (other.y - this.y) * t, this.z + (other.z - this.z) * t);
|
|
3316
3318
|
}
|
|
3317
3319
|
/**
|
|
3318
3320
|
* Spherically interpolates between this 3D position and another 3D position.
|
|
@@ -3348,14 +3350,14 @@ var BlockCoordinates = class BlockCoordinates2 extends import_raknet10.DataType
|
|
|
3348
3350
|
* @returnsthe absolute value of this 3D vector.
|
|
3349
3351
|
*/
|
|
3350
3352
|
absolute() {
|
|
3351
|
-
return new
|
|
3353
|
+
return new BlockPosition2(Math.abs(this.x), Math.abs(this.y), Math.abs(this.z));
|
|
3352
3354
|
}
|
|
3353
3355
|
static read(stream) {
|
|
3354
3356
|
const x = stream.readZigZag();
|
|
3355
3357
|
let y = stream.readVarInt();
|
|
3356
3358
|
const z = stream.readZigZag();
|
|
3357
3359
|
y = 4294967295 - 64 >= y ? y : y - 4294967296;
|
|
3358
|
-
return new
|
|
3360
|
+
return new BlockPosition2(x, y, z);
|
|
3359
3361
|
}
|
|
3360
3362
|
static write(stream, value) {
|
|
3361
3363
|
const y = value.y < 0 ? 4294967296 + value.y : value.y;
|
|
@@ -3364,16 +3366,16 @@ var BlockCoordinates = class BlockCoordinates2 extends import_raknet10.DataType
|
|
|
3364
3366
|
stream.writeZigZag(value.z);
|
|
3365
3367
|
}
|
|
3366
3368
|
/**
|
|
3367
|
-
* Converts a
|
|
3368
|
-
* @param position - The
|
|
3369
|
-
* @returns The converted
|
|
3369
|
+
* Converts a BlockPosition to a BlockPosition
|
|
3370
|
+
* @param position - The BlockPosition to convert
|
|
3371
|
+
* @returns The converted BlockPosition
|
|
3370
3372
|
*/
|
|
3371
3373
|
static fromVector3f(position) {
|
|
3372
|
-
return new
|
|
3374
|
+
return new BlockPosition2(Math.floor(position.x), Math.floor(position.y), Math.floor(position.z));
|
|
3373
3375
|
}
|
|
3374
3376
|
/**
|
|
3375
|
-
* Converts the
|
|
3376
|
-
* @returns The converted
|
|
3377
|
+
* Converts the BlockPosition to a BlockPosition
|
|
3378
|
+
* @returns The converted BlockPosition
|
|
3377
3379
|
*/
|
|
3378
3380
|
static toVector3f(coordinates) {
|
|
3379
3381
|
return new Vector3f(coordinates.x, coordinates.y, coordinates.z);
|
|
@@ -5966,7 +5968,7 @@ var ItemUseInventoryTransaction = class ItemUseInventoryTransaction2 extends imp
|
|
|
5966
5968
|
static read(stream) {
|
|
5967
5969
|
const type = stream.readVarInt();
|
|
5968
5970
|
const triggerType = stream.readVarInt();
|
|
5969
|
-
const blockPosition =
|
|
5971
|
+
const blockPosition = BlockPosition.read(stream);
|
|
5970
5972
|
const face = stream.readZigZag();
|
|
5971
5973
|
const slot = stream.readZigZag();
|
|
5972
5974
|
const item = NetworkItemStackDescriptor.read(stream);
|
|
@@ -5979,7 +5981,7 @@ var ItemUseInventoryTransaction = class ItemUseInventoryTransaction2 extends imp
|
|
|
5979
5981
|
static write(stream, value) {
|
|
5980
5982
|
stream.writeVarInt(value.type);
|
|
5981
5983
|
stream.writeVarInt(value.triggerType);
|
|
5982
|
-
|
|
5984
|
+
BlockPosition.write(stream, value.blockPosition);
|
|
5983
5985
|
stream.writeZigZag(value.face);
|
|
5984
5986
|
stream.writeZigZag(value.slot);
|
|
5985
5987
|
NetworkItemStackDescriptor.write(stream, value.item);
|
|
@@ -6814,7 +6816,7 @@ var DataItem = class DataItem2 extends import_raknet72.DataType {
|
|
|
6814
6816
|
break;
|
|
6815
6817
|
}
|
|
6816
6818
|
case ActorDataType.BlockPos: {
|
|
6817
|
-
value =
|
|
6819
|
+
value = BlockPosition.read(stream);
|
|
6818
6820
|
break;
|
|
6819
6821
|
}
|
|
6820
6822
|
case ActorDataType.Long: {
|
|
@@ -6861,7 +6863,7 @@ var DataItem = class DataItem2 extends import_raknet72.DataType {
|
|
|
6861
6863
|
break;
|
|
6862
6864
|
}
|
|
6863
6865
|
case ActorDataType.BlockPos: {
|
|
6864
|
-
|
|
6866
|
+
BlockPosition.write(stream, item.value);
|
|
6865
6867
|
break;
|
|
6866
6868
|
}
|
|
6867
6869
|
case ActorDataType.Long: {
|
|
@@ -8319,8 +8321,8 @@ var StructureSettings = class StructureSettings2 extends import_raknet95.DataTyp
|
|
|
8319
8321
|
stream.writeBool(value.ignoreBlocks);
|
|
8320
8322
|
stream.writeBool(value.ignoreEntities);
|
|
8321
8323
|
stream.writeBool(value.allowNonTicking);
|
|
8322
|
-
|
|
8323
|
-
|
|
8324
|
+
BlockPosition.write(stream, value.size);
|
|
8325
|
+
BlockPosition.write(stream, value.offset);
|
|
8324
8326
|
stream.writeZigZong(value.lastEdit);
|
|
8325
8327
|
stream.writeByte(value.animationMode);
|
|
8326
8328
|
stream.writeFloat32(value.animationSeconds);
|
|
@@ -8334,8 +8336,8 @@ var StructureSettings = class StructureSettings2 extends import_raknet95.DataTyp
|
|
|
8334
8336
|
stream.readBool(),
|
|
8335
8337
|
stream.readBool(),
|
|
8336
8338
|
stream.readBool(),
|
|
8337
|
-
|
|
8338
|
-
|
|
8339
|
+
BlockPosition.read(stream),
|
|
8340
|
+
BlockPosition.read(stream),
|
|
8339
8341
|
stream.readZigZong(),
|
|
8340
8342
|
stream.readByte(),
|
|
8341
8343
|
stream.readByte(),
|
|
@@ -10216,8 +10218,8 @@ _ts_decorate13([
|
|
|
10216
10218
|
_ts_metadata12("design:type", typeof ContainerType === "undefined" ? Object : ContainerType)
|
|
10217
10219
|
], ContainerOpenPacket.prototype, "type", void 0);
|
|
10218
10220
|
_ts_decorate13([
|
|
10219
|
-
(0, import_raknet136.Serialize)(
|
|
10220
|
-
_ts_metadata12("design:type", typeof
|
|
10221
|
+
(0, import_raknet136.Serialize)(BlockPosition),
|
|
10222
|
+
_ts_metadata12("design:type", typeof BlockPosition === "undefined" ? Object : BlockPosition)
|
|
10221
10223
|
], ContainerOpenPacket.prototype, "position", void 0);
|
|
10222
10224
|
_ts_decorate13([
|
|
10223
10225
|
(0, import_raknet136.Serialize)(import_binarystream56.VarLong),
|
|
@@ -10985,8 +10987,8 @@ var NetworkChunkPublisherUpdatePacket = class NetworkChunkPublisherUpdatePacket2
|
|
|
10985
10987
|
savedChunks;
|
|
10986
10988
|
};
|
|
10987
10989
|
_ts_decorate32([
|
|
10988
|
-
(0, import_raknet155.Serialize)(
|
|
10989
|
-
_ts_metadata30("design:type", typeof
|
|
10990
|
+
(0, import_raknet155.Serialize)(BlockPosition),
|
|
10991
|
+
_ts_metadata30("design:type", typeof BlockPosition === "undefined" ? Object : BlockPosition)
|
|
10990
10992
|
], NetworkChunkPublisherUpdatePacket.prototype, "coordinate", void 0);
|
|
10991
10993
|
_ts_decorate32([
|
|
10992
10994
|
(0, import_raknet155.Serialize)(import_binarystream70.VarInt),
|
|
@@ -11152,12 +11154,12 @@ _ts_decorate36([
|
|
|
11152
11154
|
_ts_metadata34("design:type", typeof ActionIds === "undefined" ? Object : ActionIds)
|
|
11153
11155
|
], PlayerActionPacket.prototype, "action", void 0);
|
|
11154
11156
|
_ts_decorate36([
|
|
11155
|
-
(0, import_raknet159.Serialize)(
|
|
11156
|
-
_ts_metadata34("design:type", typeof
|
|
11157
|
+
(0, import_raknet159.Serialize)(BlockPosition),
|
|
11158
|
+
_ts_metadata34("design:type", typeof BlockPosition === "undefined" ? Object : BlockPosition)
|
|
11157
11159
|
], PlayerActionPacket.prototype, "blockPosition", void 0);
|
|
11158
11160
|
_ts_decorate36([
|
|
11159
|
-
(0, import_raknet159.Serialize)(
|
|
11160
|
-
_ts_metadata34("design:type", typeof
|
|
11161
|
+
(0, import_raknet159.Serialize)(BlockPosition),
|
|
11162
|
+
_ts_metadata34("design:type", typeof BlockPosition === "undefined" ? Object : BlockPosition)
|
|
11161
11163
|
], PlayerActionPacket.prototype, "resultPosition", void 0);
|
|
11162
11164
|
_ts_decorate36([
|
|
11163
11165
|
(0, import_raknet159.Serialize)(import_binarystream74.ZigZag),
|
|
@@ -12194,8 +12196,8 @@ _ts_decorate57([
|
|
|
12194
12196
|
_ts_metadata52("design:type", typeof Difficulty === "undefined" ? Object : Difficulty)
|
|
12195
12197
|
], StartGamePacket.prototype, "difficulty", void 0);
|
|
12196
12198
|
_ts_decorate57([
|
|
12197
|
-
(0, import_raknet180.Serialize)(
|
|
12198
|
-
_ts_metadata52("design:type", typeof
|
|
12199
|
+
(0, import_raknet180.Serialize)(BlockPosition),
|
|
12200
|
+
_ts_metadata52("design:type", typeof BlockPosition === "undefined" ? Object : BlockPosition)
|
|
12199
12201
|
], StartGamePacket.prototype, "spawnPosition", void 0);
|
|
12200
12202
|
_ts_decorate57([
|
|
12201
12203
|
(0, import_raknet180.Serialize)(import_binarystream95.Bool),
|
|
@@ -12722,8 +12724,8 @@ var UpdateBlockPacket = class UpdateBlockPacket2 extends DataPacket {
|
|
|
12722
12724
|
layer;
|
|
12723
12725
|
};
|
|
12724
12726
|
_ts_decorate63([
|
|
12725
|
-
(0, import_raknet186.Serialize)(
|
|
12726
|
-
_ts_metadata58("design:type", typeof
|
|
12727
|
+
(0, import_raknet186.Serialize)(BlockPosition),
|
|
12728
|
+
_ts_metadata58("design:type", typeof BlockPosition === "undefined" ? Object : BlockPosition)
|
|
12727
12729
|
], UpdateBlockPacket.prototype, "position", void 0);
|
|
12728
12730
|
_ts_decorate63([
|
|
12729
12731
|
(0, import_raknet186.Serialize)(import_binarystream101.VarInt),
|
|
@@ -13386,8 +13388,8 @@ var BlockActorDataPacket = class BlockActorDataPacket2 extends DataPacket {
|
|
|
13386
13388
|
nbt;
|
|
13387
13389
|
};
|
|
13388
13390
|
_ts_decorate80([
|
|
13389
|
-
(0, import_raknet203.Serialize)(
|
|
13390
|
-
_ts_metadata75("design:type", typeof
|
|
13391
|
+
(0, import_raknet203.Serialize)(BlockPosition),
|
|
13392
|
+
_ts_metadata75("design:type", typeof BlockPosition === "undefined" ? Object : BlockPosition)
|
|
13391
13393
|
], BlockActorDataPacket.prototype, "position", void 0);
|
|
13392
13394
|
_ts_decorate80([
|
|
13393
13395
|
(0, import_raknet203.Serialize)(import_nbt6.CompoundTag, true),
|
|
@@ -13713,8 +13715,8 @@ var OpenSignPacket = class OpenSignPacket2 extends DataPacket {
|
|
|
13713
13715
|
isFrontSide;
|
|
13714
13716
|
};
|
|
13715
13717
|
_ts_decorate89([
|
|
13716
|
-
(0, import_raknet212.Serialize)(
|
|
13717
|
-
_ts_metadata83("design:type", typeof
|
|
13718
|
+
(0, import_raknet212.Serialize)(BlockPosition),
|
|
13719
|
+
_ts_metadata83("design:type", typeof BlockPosition === "undefined" ? Object : BlockPosition)
|
|
13718
13720
|
], OpenSignPacket.prototype, "position", void 0);
|
|
13719
13721
|
_ts_decorate89([
|
|
13720
13722
|
(0, import_raknet212.Serialize)(import_binarystream125.Bool),
|
|
@@ -14112,8 +14114,8 @@ var StructureBlockUpdatePacket = class StructureBlockUpdatePacket2 extends DataP
|
|
|
14112
14114
|
isWaterLogged;
|
|
14113
14115
|
};
|
|
14114
14116
|
_ts_decorate100([
|
|
14115
|
-
(0, import_raknet223.Serialize)(
|
|
14116
|
-
_ts_metadata94("design:type", typeof
|
|
14117
|
+
(0, import_raknet223.Serialize)(BlockPosition),
|
|
14118
|
+
_ts_metadata94("design:type", typeof BlockPosition === "undefined" ? Object : BlockPosition)
|
|
14117
14119
|
], StructureBlockUpdatePacket.prototype, "blockPosition", void 0);
|
|
14118
14120
|
_ts_decorate100([
|
|
14119
14121
|
(0, import_raknet223.Serialize)(StructureEditorData),
|
|
@@ -14307,8 +14309,8 @@ var BlockEventPacket = class BlockEventPacket2 extends DataPacket {
|
|
|
14307
14309
|
data;
|
|
14308
14310
|
};
|
|
14309
14311
|
_ts_decorate106([
|
|
14310
|
-
(0, import_raknet229.Serialize)(
|
|
14311
|
-
_ts_metadata99("design:type", typeof
|
|
14312
|
+
(0, import_raknet229.Serialize)(BlockPosition),
|
|
14313
|
+
_ts_metadata99("design:type", typeof BlockPosition === "undefined" ? Object : BlockPosition)
|
|
14312
14314
|
], BlockEventPacket.prototype, "position", void 0);
|
|
14313
14315
|
_ts_decorate106([
|
|
14314
14316
|
(0, import_raknet229.Serialize)(import_binarystream136.ZigZag),
|
|
@@ -14560,6 +14562,49 @@ ServerboundDiagnosticsPacket = _ts_decorate112([
|
|
|
14560
14562
|
(0, import_raknet235.Proto)(Packet.ServerboundDiagnosticPacket)
|
|
14561
14563
|
], ServerboundDiagnosticsPacket);
|
|
14562
14564
|
|
|
14565
|
+
// src/proto/data/play-sound.ts
|
|
14566
|
+
var import_raknet236 = require("@serenityjs/raknet");
|
|
14567
|
+
var import_binarystream143 = require("@serenityjs/binarystream");
|
|
14568
|
+
function _ts_decorate113(decorators, target, key, desc) {
|
|
14569
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14570
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
14571
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
14572
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14573
|
+
}
|
|
14574
|
+
__name(_ts_decorate113, "_ts_decorate");
|
|
14575
|
+
function _ts_metadata106(k, v) {
|
|
14576
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
14577
|
+
}
|
|
14578
|
+
__name(_ts_metadata106, "_ts_metadata");
|
|
14579
|
+
var PlaySoundPacket = class PlaySoundPacket2 extends DataPacket {
|
|
14580
|
+
static {
|
|
14581
|
+
__name(this, "PlaySoundPacket");
|
|
14582
|
+
}
|
|
14583
|
+
name;
|
|
14584
|
+
position;
|
|
14585
|
+
volume;
|
|
14586
|
+
pitch;
|
|
14587
|
+
};
|
|
14588
|
+
_ts_decorate113([
|
|
14589
|
+
(0, import_raknet236.Serialize)(import_binarystream143.VarString),
|
|
14590
|
+
_ts_metadata106("design:type", String)
|
|
14591
|
+
], PlaySoundPacket.prototype, "name", void 0);
|
|
14592
|
+
_ts_decorate113([
|
|
14593
|
+
(0, import_raknet236.Serialize)(BlockPosition),
|
|
14594
|
+
_ts_metadata106("design:type", typeof BlockPosition === "undefined" ? Object : BlockPosition)
|
|
14595
|
+
], PlaySoundPacket.prototype, "position", void 0);
|
|
14596
|
+
_ts_decorate113([
|
|
14597
|
+
(0, import_raknet236.Serialize)(import_binarystream143.Float32, import_binarystream143.Endianness.Little),
|
|
14598
|
+
_ts_metadata106("design:type", Number)
|
|
14599
|
+
], PlaySoundPacket.prototype, "volume", void 0);
|
|
14600
|
+
_ts_decorate113([
|
|
14601
|
+
(0, import_raknet236.Serialize)(import_binarystream143.Float32, import_binarystream143.Endianness.Little),
|
|
14602
|
+
_ts_metadata106("design:type", Number)
|
|
14603
|
+
], PlaySoundPacket.prototype, "pitch", void 0);
|
|
14604
|
+
PlaySoundPacket = _ts_decorate113([
|
|
14605
|
+
(0, import_raknet236.Proto)(Packet.PlaySound)
|
|
14606
|
+
], PlaySoundPacket);
|
|
14607
|
+
|
|
14563
14608
|
// src/proto/data/packets.ts
|
|
14564
14609
|
var Packets = {
|
|
14565
14610
|
[Packet.Login]: LoginPacket,
|
|
@@ -14623,6 +14668,7 @@ var Packets = {
|
|
|
14623
14668
|
[Packet.ResourcePackChunkData]: ResourcePackChunkDataPacket,
|
|
14624
14669
|
[Packet.ResourcePackChunkRequest]: ResourcePackChunkRequestPacket,
|
|
14625
14670
|
[Packet.Transfer]: TransferPacket,
|
|
14671
|
+
[Packet.PlaySound]: PlaySoundPacket,
|
|
14626
14672
|
[Packet.SetTitle]: SetTitlePacket,
|
|
14627
14673
|
[Packet.StructureBlockUpdate]: StructureBlockUpdatePacket,
|
|
14628
14674
|
[Packet.PlayerSkin]: PlayerSkinPacket,
|
|
@@ -14678,13 +14724,13 @@ var Packets = {
|
|
|
14678
14724
|
};
|
|
14679
14725
|
|
|
14680
14726
|
// src/proto/framer.ts
|
|
14681
|
-
var
|
|
14727
|
+
var import_binarystream144 = require("@serenityjs/binarystream");
|
|
14682
14728
|
var Framer = class Framer2 {
|
|
14683
14729
|
static {
|
|
14684
14730
|
__name(this, "Framer");
|
|
14685
14731
|
}
|
|
14686
14732
|
static unframe(buffer) {
|
|
14687
|
-
const stream = new
|
|
14733
|
+
const stream = new import_binarystream144.BinaryStream(buffer);
|
|
14688
14734
|
const frames = [];
|
|
14689
14735
|
do {
|
|
14690
14736
|
const length = stream.readVarInt();
|
|
@@ -14694,7 +14740,7 @@ var Framer = class Framer2 {
|
|
|
14694
14740
|
return frames;
|
|
14695
14741
|
}
|
|
14696
14742
|
static frame(...buffers) {
|
|
14697
|
-
const stream = new
|
|
14743
|
+
const stream = new import_binarystream144.BinaryStream();
|
|
14698
14744
|
for (const buffer of buffers) {
|
|
14699
14745
|
stream.writeVarInt(buffer.length);
|
|
14700
14746
|
stream.writeBuffer(buffer);
|
|
@@ -14704,9 +14750,9 @@ var Framer = class Framer2 {
|
|
|
14704
14750
|
};
|
|
14705
14751
|
|
|
14706
14752
|
// src/proto/packet-id.ts
|
|
14707
|
-
var
|
|
14753
|
+
var import_binarystream145 = require("@serenityjs/binarystream");
|
|
14708
14754
|
function getPacketId(buffer) {
|
|
14709
|
-
const stream =
|
|
14755
|
+
const stream = import_binarystream145.BinaryStream.fromBuffer(buffer);
|
|
14710
14756
|
return stream.readVarInt();
|
|
14711
14757
|
}
|
|
14712
14758
|
__name(getPacketId, "getPacketId");
|
|
@@ -14748,11 +14794,11 @@ var MINECRAFT_TICK_SPEED = 50;
|
|
|
14748
14794
|
BiomeDefinitionListPacket,
|
|
14749
14795
|
BlockAction,
|
|
14750
14796
|
BlockActorDataPacket,
|
|
14751
|
-
BlockCoordinates,
|
|
14752
14797
|
BlockEventPacket,
|
|
14753
14798
|
BlockEventType,
|
|
14754
14799
|
BlockFace,
|
|
14755
14800
|
BlockPickRequestPacket,
|
|
14801
|
+
BlockPosition,
|
|
14756
14802
|
BlockProperties,
|
|
14757
14803
|
BookActions,
|
|
14758
14804
|
BookEditAction,
|
|
@@ -14943,6 +14989,7 @@ var MINECRAFT_TICK_SPEED = 50;
|
|
|
14943
14989
|
Packets,
|
|
14944
14990
|
PermissionLevel,
|
|
14945
14991
|
PlayMode,
|
|
14992
|
+
PlaySoundPacket,
|
|
14946
14993
|
PlayStatus,
|
|
14947
14994
|
PlayStatusPacket,
|
|
14948
14995
|
PlayerActionPacket,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@serenityjs/protocol",
|
|
3
|
-
"version": "0.5.1-beta-
|
|
3
|
+
"version": "0.5.1-beta-20240916023948",
|
|
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.5.1-beta-
|
|
22
|
-
"@serenityjs/jest-presets": "0.5.1-beta-
|
|
23
|
-
"@serenityjs/typescript-config": "0.5.1-beta-
|
|
21
|
+
"@serenityjs/eslint-config": "0.5.1-beta-20240916023948",
|
|
22
|
+
"@serenityjs/jest-presets": "0.5.1-beta-20240916023948",
|
|
23
|
+
"@serenityjs/typescript-config": "0.5.1-beta-20240916023948",
|
|
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.6.6",
|
|
32
|
-
"@serenityjs/nbt": "0.5.1-beta-
|
|
33
|
-
"@serenityjs/raknet": "0.5.1-beta-
|
|
32
|
+
"@serenityjs/nbt": "0.5.1-beta-20240916023948",
|
|
33
|
+
"@serenityjs/raknet": "0.5.1-beta-20240916023948"
|
|
34
34
|
}
|
|
35
35
|
}
|