@serenityjs/core 0.8.7 → 0.8.8-beta-20250807152221
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/CHANGELOG.md +14 -0
- package/dist/index.d.mts +19 -3
- package/dist/index.d.ts +19 -3
- package/dist/index.js +58 -22
- package/dist/index.mjs +58 -22
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @serenityjs/core
|
|
2
2
|
|
|
3
|
+
## 0.8.8-beta-20250807152221
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`314f82a`](https://github.com/SerenityJS/serenity/commit/314f82a1c23a8d75c7f2e3daea5c6c95b714c60b) Thanks [@PMK744](https://github.com/PMK744)! - init v0.8.8-beta
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`314f82a`](https://github.com/SerenityJS/serenity/commit/314f82a1c23a8d75c7f2e3daea5c6c95b714c60b)]:
|
|
10
|
+
- @serenityjs/data@0.8.8-beta-20250807152221
|
|
11
|
+
- @serenityjs/emitter@0.8.8-beta-20250807152221
|
|
12
|
+
- @serenityjs/logger@0.8.8-beta-20250807152221
|
|
13
|
+
- @serenityjs/nbt@0.8.8-beta-20250807152221
|
|
14
|
+
- @serenityjs/protocol@0.8.8-beta-20250807152221
|
|
15
|
+
- @serenityjs/raknet@0.8.8-beta-20250807152221
|
|
16
|
+
|
|
3
17
|
## 0.8.7
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Logger } from '@serenityjs/logger';
|
|
2
2
|
import { Connection, RaknetServerProperties, Server, Priority } from '@serenityjs/raknet';
|
|
3
3
|
import Emitter, { Emitter as Emitter$1 } from '@serenityjs/emitter';
|
|
4
|
-
import { Packet, DataPacket, ResourcePackDescriptor, LoginPacket, PlayStatusPacket, ServerToClientHandshakePacket, ClientToServerHandshakePacket, DisconnectPacket, ResourcePacksInfoPacket, ResourcePackStackPacket, ResourcePackClientResponsePacket, TextPacket, SetTimePacket, StartGamePacket, AddPlayerPacket, AddEntityPacket, RemoveEntityPacket, AddItemActorPacket, TakeItemActorPacket, MoveActorAbsolutePacket, MovePlayerPacket, RiderJumpPacket, UpdateBlockPacket, LevelEventPacket, BlockEventPacket, ActorEventPacket, UpdateAttributesPacket, InventoryTransactionPacket, SetActorLinkPacket, CompletedUsingItemPacket, MobEquipmentPacket, MobArmorEquipmentPacket, MobEffectPacket, InteractPacket, BlockPickRequestPacket, BookEditPacket, PlayerStartItemCooldownPacket, EntityPickRequestPacket, PlayerActionPacket, HurtArmorPacket, SetActorDataPacket, SetActorMotionPacket, AnimatePacket, RespawnPacket, ContainerOpenPacket, ContainerClosePacket, PlayerHotbarPacket, InventoryContentPacket, InventorySlotPacket, ContainerSetDataPacket, CraftingDataPacket, BlockActorDataPacket, LevelChunkPacket, SetCommandsEnabledPacket, ChangeDimensionPacket, SetPlayerGameTypePacket, PlayerListPacket, RequestChunkRadiusPacket, ChunkRadiusUpdatePacket, GameRulesChangedPacket, BossEventPacket, LegacyTelemetryEventPacket, AvailableCommandsPacket, CommandRequestPacket, CommandBlockUpdatePacket, CommandOutputPacket, ResourcePackDataInfoPacket, SetSpawnPositionPacket, StructureBlockUpdatePacket, SetHealthPacket, SetDifficultyPacket, DimensionDataPacket, CameraInstructionsPacket, ResourcePackChunkDataPacket, TrimDataPacket, ShowCreditsPacket, CameraPresetsPacket, ResourcePackChunkRequestPacket, UnlockedRecipesPacket, TransferPacket, PlaySoundPacket, SetTitlePacket, PlayerSkinPacket, NpcRequestPacket, OpenSignPacket, CameraShakePacket, PlayerFogPacket, ModalFormRequestPacket, ModalFormResponsePacket, ServerSettingsResponsePacket, ShowProfilePacket, RemoveObjectivePacket, SetDisplayObjectivePacket, SetScorePacket, MoveActorDeltaPacket, SetScoreboardIdentityPacket, NetworkStackLatencyPacket, AvailableActorIdentifiersPacket, SpawnParticleEffectPacket, SetLocalPlayerAsInitializedPacket, NetworkChunkPublisherUpdatePacket, BiomeDefinitionListPacket, LevelSoundEventPacket, LevelEventGenericPacket, OnScreenTextureAnimationPacket, StopSoundPacket, EmotePacket, NetworkSettingsPacket, PlayerAuthInputPacket, CreativeContentPacket, PlayerEnchantOptionsPacket, SyncActorPropertyPacket, ItemStackRequestPacket, ItemStackResponsePacket, EmoteListPacket, DebugInfoPacket, PacketViolationWarningPacket, AnimateEntityPacket, CorrectPlayerMovePredictionPacket, ClientBoundMapItemDataPacket, MapInfoRequestPacket, ItemRegistryPacket, ClientBoundDebugRendererPacket, UpdateTradePacket, NpcDialoguePacket, ScriptMessagePacket, RequestPermissionsPacket, ToastRequestPacket, UpdateAbilitiesPacket, UpdateAdventureSettingsPacket, DeathInfoPacket, RequestNetworkSettingsPacket, SetPlayerInventoryOptionsPacket, SetHudPacket, AwardAchievementPacket, ClientboundCloseFormPacket, ServerboundLoadingScreenPacketPacket, UpdateClientInputLocksPacket, CurrectStructureFeaturePacket, ServerboundDiagnosticsPacket, MovementEffectPacket, UpdateSubchunkBlocksPacket, UpdateBlockSyncPacket, SetLastHurtByPacket, UpdatePlayerGameTypePacket, SetDefaultGamemodePacket, MotionPredictHintsPacket, ClientCacheStatusPacket, AddPaintingPacket, PlayerUpdateEntityOverridesPacket, ServerScriptDebugDrawerPacket, MaterialRenderMethod, EntityPropertyType, WearableSlot, ContainerType, ContainerId, CreativeItemCategory, CreativeItemGroup, ItemUseMethod, Vector3f, BlockFace, NetworkItemInstanceDescriptor, NetworkItemStackDescriptor, Enchantment, EquipmentSlot, EffectType, Color, DimensionType, IPosition, UpdateBlockLayerType, ScoreboardIdentityType, ObjectiveSortOrder, DisplaySlotType, GameRule, Gamemode, Difficulty, ModalFormType, BossEventColor, ActorDataId, DataItem, ActorFlag, AttributeName, Attribute, AbilityIndex, PropertySyncData, HudElement, DeviceOS, MemoryTier, InputMode, InteractionMode, PlayMode, Rotation, SerializedSkin, BlockPosition, DisconnectReason, ContainerName, Vector2f, ActorDamageCause, ChunkCoords, NetworkBlockTypeDefinition, CompressionMethod, InventoryAction, ItemUseInventoryTransaction, ItemUseOnEntityInventoryTransaction, LoginTokens, LoginTokenData, InputData, PlayerBlockActionData, ItemStackRequestActionMineBlock } from '@serenityjs/protocol';
|
|
4
|
+
import { Packet, DataPacket, ResourcePackDescriptor, LoginPacket, PlayStatusPacket, ServerToClientHandshakePacket, ClientToServerHandshakePacket, DisconnectPacket, ResourcePacksInfoPacket, ResourcePackStackPacket, ResourcePackClientResponsePacket, TextPacket, SetTimePacket, StartGamePacket, AddPlayerPacket, AddEntityPacket, RemoveEntityPacket, AddItemActorPacket, TakeItemActorPacket, MoveActorAbsolutePacket, MovePlayerPacket, RiderJumpPacket, UpdateBlockPacket, LevelEventPacket, BlockEventPacket, ActorEventPacket, UpdateAttributesPacket, InventoryTransactionPacket, SetActorLinkPacket, CompletedUsingItemPacket, MobEquipmentPacket, MobArmorEquipmentPacket, MobEffectPacket, InteractPacket, BlockPickRequestPacket, BookEditPacket, PlayerStartItemCooldownPacket, EntityPickRequestPacket, PlayerActionPacket, HurtArmorPacket, SetActorDataPacket, SetActorMotionPacket, AnimatePacket, RespawnPacket, ContainerOpenPacket, ContainerClosePacket, PlayerHotbarPacket, InventoryContentPacket, InventorySlotPacket, ContainerSetDataPacket, CraftingDataPacket, BlockActorDataPacket, LevelChunkPacket, SetCommandsEnabledPacket, ChangeDimensionPacket, SetPlayerGameTypePacket, PlayerListPacket, RequestChunkRadiusPacket, ChunkRadiusUpdatePacket, GameRulesChangedPacket, BossEventPacket, LegacyTelemetryEventPacket, AvailableCommandsPacket, CommandRequestPacket, CommandBlockUpdatePacket, CommandOutputPacket, ResourcePackDataInfoPacket, SetSpawnPositionPacket, StructureBlockUpdatePacket, SetHealthPacket, SetDifficultyPacket, DimensionDataPacket, CameraInstructionsPacket, ResourcePackChunkDataPacket, TrimDataPacket, ShowCreditsPacket, CameraPresetsPacket, ResourcePackChunkRequestPacket, UnlockedRecipesPacket, TransferPacket, PlaySoundPacket, SetTitlePacket, PlayerSkinPacket, NpcRequestPacket, OpenSignPacket, CameraShakePacket, PlayerFogPacket, ModalFormRequestPacket, ModalFormResponsePacket, ServerSettingsResponsePacket, ShowProfilePacket, RemoveObjectivePacket, SetDisplayObjectivePacket, SetScorePacket, MoveActorDeltaPacket, SetScoreboardIdentityPacket, NetworkStackLatencyPacket, AvailableActorIdentifiersPacket, SpawnParticleEffectPacket, SetLocalPlayerAsInitializedPacket, NetworkChunkPublisherUpdatePacket, BiomeDefinitionListPacket, LevelSoundEventPacket, LevelEventGenericPacket, OnScreenTextureAnimationPacket, StopSoundPacket, EmotePacket, NetworkSettingsPacket, PlayerAuthInputPacket, CreativeContentPacket, PlayerEnchantOptionsPacket, SyncActorPropertyPacket, ItemStackRequestPacket, ItemStackResponsePacket, EmoteListPacket, DebugInfoPacket, PacketViolationWarningPacket, AnimateEntityPacket, CorrectPlayerMovePredictionPacket, ClientBoundMapItemDataPacket, MapInfoRequestPacket, ItemRegistryPacket, ClientBoundDebugRendererPacket, UpdateTradePacket, NpcDialoguePacket, SubChunkPacket, SubChunkRequestPacket, ScriptMessagePacket, RequestPermissionsPacket, ToastRequestPacket, UpdateAbilitiesPacket, UpdateAdventureSettingsPacket, DeathInfoPacket, RequestNetworkSettingsPacket, SetPlayerInventoryOptionsPacket, SetHudPacket, AwardAchievementPacket, ClientboundCloseFormPacket, ServerboundLoadingScreenPacketPacket, UpdateClientInputLocksPacket, CurrectStructureFeaturePacket, ServerboundDiagnosticsPacket, MovementEffectPacket, UpdateSubchunkBlocksPacket, UpdateBlockSyncPacket, SetLastHurtByPacket, UpdatePlayerGameTypePacket, SetDefaultGamemodePacket, MotionPredictHintsPacket, ClientCacheStatusPacket, AddPaintingPacket, PlayerUpdateEntityOverridesPacket, ServerScriptDebugDrawerPacket, MaterialRenderMethod, EntityPropertyType, WearableSlot, ContainerType, ContainerId, CreativeItemCategory, CreativeItemGroup, ItemUseMethod, Vector3f, BlockFace, NetworkItemInstanceDescriptor, NetworkItemStackDescriptor, Enchantment, EquipmentSlot, EffectType, Color, DimensionType, IPosition, UpdateBlockLayerType, ScoreboardIdentityType, ObjectiveSortOrder, DisplaySlotType, GameRule, Gamemode, Difficulty, ModalFormType, BossEventColor, ActorDataId, DataItem, ActorFlag, AttributeName, Attribute, AbilityIndex, PropertySyncData, HudElement, DeviceOS, MemoryTier, InputMode, InteractionMode, PlayMode, Rotation, SerializedSkin, BlockPosition, DisconnectReason, ContainerName, Vector2f, ActorDamageCause, ChunkCoords, NetworkBlockTypeDefinition, CompressionMethod, InventoryAction, ItemUseInventoryTransaction, ItemUseOnEntityInventoryTransaction, LoginTokens, LoginTokenData, InputData, PlayerBlockActionData, ItemStackRequestActionMineBlock, RequestedResourcePack } from '@serenityjs/protocol';
|
|
5
5
|
import { CompoundTag, TagType, BaseTag, ListTag, IntTag, StringTag, ByteTag, LongTag } from '@serenityjs/nbt';
|
|
6
6
|
import { BinaryStream } from '@serenityjs/binarystream';
|
|
7
7
|
import * as readline from 'readline';
|
|
@@ -38,6 +38,10 @@ declare class NetworkHandler {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
declare class ResourcePack {
|
|
41
|
+
/**
|
|
42
|
+
* The information about the resource pack.
|
|
43
|
+
*/
|
|
44
|
+
static packInformation: string;
|
|
41
45
|
/**
|
|
42
46
|
* The path to the main directory of the resource pack.
|
|
43
47
|
*/
|
|
@@ -117,6 +121,7 @@ declare class ResourcePack {
|
|
|
117
121
|
* @returns The hash as a Buffer.
|
|
118
122
|
*/
|
|
119
123
|
generateHash(): Buffer;
|
|
124
|
+
getSize(): number;
|
|
120
125
|
getDescriptor(): ResourcePackDescriptor;
|
|
121
126
|
}
|
|
122
127
|
|
|
@@ -3312,6 +3317,8 @@ interface NetworkEvents {
|
|
|
3312
3317
|
];
|
|
3313
3318
|
[Packet.UpdateTrade]: [NetworkPacketEvent<UpdateTradePacket>];
|
|
3314
3319
|
[Packet.NpcDialogue]: [NetworkPacketEvent<NpcDialoguePacket>];
|
|
3320
|
+
[Packet.SubChunk]: [NetworkPacketEvent<SubChunkPacket>];
|
|
3321
|
+
[Packet.SubChunkRequest]: [NetworkPacketEvent<SubChunkRequestPacket>];
|
|
3315
3322
|
[Packet.ScriptMessage]: [NetworkPacketEvent<ScriptMessagePacket>];
|
|
3316
3323
|
[Packet.RequestPermissions]: [NetworkPacketEvent<RequestPermissionsPacket>];
|
|
3317
3324
|
[Packet.ToastRequest]: [NetworkPacketEvent<ToastRequestPacket>];
|
|
@@ -11142,11 +11149,11 @@ declare class TickSchedule {
|
|
|
11142
11149
|
/**
|
|
11143
11150
|
* The amount of ticks to wait before the schedule is complete.
|
|
11144
11151
|
*/
|
|
11145
|
-
|
|
11152
|
+
scheduledTick: bigint;
|
|
11146
11153
|
/**
|
|
11147
11154
|
* The tick at which the schedule will be complete.
|
|
11148
11155
|
*/
|
|
11149
|
-
|
|
11156
|
+
completeTick: bigint;
|
|
11150
11157
|
/**
|
|
11151
11158
|
* The callbacks to call when the schedule is complete.
|
|
11152
11159
|
*/
|
|
@@ -17627,8 +17634,16 @@ declare class EmoteHandler extends NetworkHandler {
|
|
|
17627
17634
|
handle(packet: EmotePacket, connection: Connection): void;
|
|
17628
17635
|
}
|
|
17629
17636
|
|
|
17637
|
+
interface PlayerPackQueue {
|
|
17638
|
+
packs: Array<RequestedResourcePack>;
|
|
17639
|
+
schedule?: TickSchedule;
|
|
17640
|
+
}
|
|
17630
17641
|
declare class ResourcePackChunkRequestHandler extends NetworkHandler {
|
|
17631
17642
|
static readonly packet = Packet.ResourcePackChunkRequest;
|
|
17643
|
+
/**
|
|
17644
|
+
* A queue to keep track of resource pack chunk requests.
|
|
17645
|
+
*/
|
|
17646
|
+
readonly queue: Map<Player, PlayerPackQueue>;
|
|
17632
17647
|
handle(packet: ResourcePackChunkRequestPacket, connection: Connection): void;
|
|
17633
17648
|
/**
|
|
17634
17649
|
* Starts sending the resource pack to the player.
|
|
@@ -17636,6 +17651,7 @@ declare class ResourcePackChunkRequestHandler extends NetworkHandler {
|
|
|
17636
17651
|
* @param player The player to send the pack to.
|
|
17637
17652
|
* @param chunk The chunk index to start sending from.
|
|
17638
17653
|
*/
|
|
17654
|
+
private sendQueuedPacks;
|
|
17639
17655
|
private sendResourcePack;
|
|
17640
17656
|
}
|
|
17641
17657
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Logger } from '@serenityjs/logger';
|
|
2
2
|
import { Connection, RaknetServerProperties, Server, Priority } from '@serenityjs/raknet';
|
|
3
3
|
import Emitter, { Emitter as Emitter$1 } from '@serenityjs/emitter';
|
|
4
|
-
import { Packet, DataPacket, ResourcePackDescriptor, LoginPacket, PlayStatusPacket, ServerToClientHandshakePacket, ClientToServerHandshakePacket, DisconnectPacket, ResourcePacksInfoPacket, ResourcePackStackPacket, ResourcePackClientResponsePacket, TextPacket, SetTimePacket, StartGamePacket, AddPlayerPacket, AddEntityPacket, RemoveEntityPacket, AddItemActorPacket, TakeItemActorPacket, MoveActorAbsolutePacket, MovePlayerPacket, RiderJumpPacket, UpdateBlockPacket, LevelEventPacket, BlockEventPacket, ActorEventPacket, UpdateAttributesPacket, InventoryTransactionPacket, SetActorLinkPacket, CompletedUsingItemPacket, MobEquipmentPacket, MobArmorEquipmentPacket, MobEffectPacket, InteractPacket, BlockPickRequestPacket, BookEditPacket, PlayerStartItemCooldownPacket, EntityPickRequestPacket, PlayerActionPacket, HurtArmorPacket, SetActorDataPacket, SetActorMotionPacket, AnimatePacket, RespawnPacket, ContainerOpenPacket, ContainerClosePacket, PlayerHotbarPacket, InventoryContentPacket, InventorySlotPacket, ContainerSetDataPacket, CraftingDataPacket, BlockActorDataPacket, LevelChunkPacket, SetCommandsEnabledPacket, ChangeDimensionPacket, SetPlayerGameTypePacket, PlayerListPacket, RequestChunkRadiusPacket, ChunkRadiusUpdatePacket, GameRulesChangedPacket, BossEventPacket, LegacyTelemetryEventPacket, AvailableCommandsPacket, CommandRequestPacket, CommandBlockUpdatePacket, CommandOutputPacket, ResourcePackDataInfoPacket, SetSpawnPositionPacket, StructureBlockUpdatePacket, SetHealthPacket, SetDifficultyPacket, DimensionDataPacket, CameraInstructionsPacket, ResourcePackChunkDataPacket, TrimDataPacket, ShowCreditsPacket, CameraPresetsPacket, ResourcePackChunkRequestPacket, UnlockedRecipesPacket, TransferPacket, PlaySoundPacket, SetTitlePacket, PlayerSkinPacket, NpcRequestPacket, OpenSignPacket, CameraShakePacket, PlayerFogPacket, ModalFormRequestPacket, ModalFormResponsePacket, ServerSettingsResponsePacket, ShowProfilePacket, RemoveObjectivePacket, SetDisplayObjectivePacket, SetScorePacket, MoveActorDeltaPacket, SetScoreboardIdentityPacket, NetworkStackLatencyPacket, AvailableActorIdentifiersPacket, SpawnParticleEffectPacket, SetLocalPlayerAsInitializedPacket, NetworkChunkPublisherUpdatePacket, BiomeDefinitionListPacket, LevelSoundEventPacket, LevelEventGenericPacket, OnScreenTextureAnimationPacket, StopSoundPacket, EmotePacket, NetworkSettingsPacket, PlayerAuthInputPacket, CreativeContentPacket, PlayerEnchantOptionsPacket, SyncActorPropertyPacket, ItemStackRequestPacket, ItemStackResponsePacket, EmoteListPacket, DebugInfoPacket, PacketViolationWarningPacket, AnimateEntityPacket, CorrectPlayerMovePredictionPacket, ClientBoundMapItemDataPacket, MapInfoRequestPacket, ItemRegistryPacket, ClientBoundDebugRendererPacket, UpdateTradePacket, NpcDialoguePacket, ScriptMessagePacket, RequestPermissionsPacket, ToastRequestPacket, UpdateAbilitiesPacket, UpdateAdventureSettingsPacket, DeathInfoPacket, RequestNetworkSettingsPacket, SetPlayerInventoryOptionsPacket, SetHudPacket, AwardAchievementPacket, ClientboundCloseFormPacket, ServerboundLoadingScreenPacketPacket, UpdateClientInputLocksPacket, CurrectStructureFeaturePacket, ServerboundDiagnosticsPacket, MovementEffectPacket, UpdateSubchunkBlocksPacket, UpdateBlockSyncPacket, SetLastHurtByPacket, UpdatePlayerGameTypePacket, SetDefaultGamemodePacket, MotionPredictHintsPacket, ClientCacheStatusPacket, AddPaintingPacket, PlayerUpdateEntityOverridesPacket, ServerScriptDebugDrawerPacket, MaterialRenderMethod, EntityPropertyType, WearableSlot, ContainerType, ContainerId, CreativeItemCategory, CreativeItemGroup, ItemUseMethod, Vector3f, BlockFace, NetworkItemInstanceDescriptor, NetworkItemStackDescriptor, Enchantment, EquipmentSlot, EffectType, Color, DimensionType, IPosition, UpdateBlockLayerType, ScoreboardIdentityType, ObjectiveSortOrder, DisplaySlotType, GameRule, Gamemode, Difficulty, ModalFormType, BossEventColor, ActorDataId, DataItem, ActorFlag, AttributeName, Attribute, AbilityIndex, PropertySyncData, HudElement, DeviceOS, MemoryTier, InputMode, InteractionMode, PlayMode, Rotation, SerializedSkin, BlockPosition, DisconnectReason, ContainerName, Vector2f, ActorDamageCause, ChunkCoords, NetworkBlockTypeDefinition, CompressionMethod, InventoryAction, ItemUseInventoryTransaction, ItemUseOnEntityInventoryTransaction, LoginTokens, LoginTokenData, InputData, PlayerBlockActionData, ItemStackRequestActionMineBlock } from '@serenityjs/protocol';
|
|
4
|
+
import { Packet, DataPacket, ResourcePackDescriptor, LoginPacket, PlayStatusPacket, ServerToClientHandshakePacket, ClientToServerHandshakePacket, DisconnectPacket, ResourcePacksInfoPacket, ResourcePackStackPacket, ResourcePackClientResponsePacket, TextPacket, SetTimePacket, StartGamePacket, AddPlayerPacket, AddEntityPacket, RemoveEntityPacket, AddItemActorPacket, TakeItemActorPacket, MoveActorAbsolutePacket, MovePlayerPacket, RiderJumpPacket, UpdateBlockPacket, LevelEventPacket, BlockEventPacket, ActorEventPacket, UpdateAttributesPacket, InventoryTransactionPacket, SetActorLinkPacket, CompletedUsingItemPacket, MobEquipmentPacket, MobArmorEquipmentPacket, MobEffectPacket, InteractPacket, BlockPickRequestPacket, BookEditPacket, PlayerStartItemCooldownPacket, EntityPickRequestPacket, PlayerActionPacket, HurtArmorPacket, SetActorDataPacket, SetActorMotionPacket, AnimatePacket, RespawnPacket, ContainerOpenPacket, ContainerClosePacket, PlayerHotbarPacket, InventoryContentPacket, InventorySlotPacket, ContainerSetDataPacket, CraftingDataPacket, BlockActorDataPacket, LevelChunkPacket, SetCommandsEnabledPacket, ChangeDimensionPacket, SetPlayerGameTypePacket, PlayerListPacket, RequestChunkRadiusPacket, ChunkRadiusUpdatePacket, GameRulesChangedPacket, BossEventPacket, LegacyTelemetryEventPacket, AvailableCommandsPacket, CommandRequestPacket, CommandBlockUpdatePacket, CommandOutputPacket, ResourcePackDataInfoPacket, SetSpawnPositionPacket, StructureBlockUpdatePacket, SetHealthPacket, SetDifficultyPacket, DimensionDataPacket, CameraInstructionsPacket, ResourcePackChunkDataPacket, TrimDataPacket, ShowCreditsPacket, CameraPresetsPacket, ResourcePackChunkRequestPacket, UnlockedRecipesPacket, TransferPacket, PlaySoundPacket, SetTitlePacket, PlayerSkinPacket, NpcRequestPacket, OpenSignPacket, CameraShakePacket, PlayerFogPacket, ModalFormRequestPacket, ModalFormResponsePacket, ServerSettingsResponsePacket, ShowProfilePacket, RemoveObjectivePacket, SetDisplayObjectivePacket, SetScorePacket, MoveActorDeltaPacket, SetScoreboardIdentityPacket, NetworkStackLatencyPacket, AvailableActorIdentifiersPacket, SpawnParticleEffectPacket, SetLocalPlayerAsInitializedPacket, NetworkChunkPublisherUpdatePacket, BiomeDefinitionListPacket, LevelSoundEventPacket, LevelEventGenericPacket, OnScreenTextureAnimationPacket, StopSoundPacket, EmotePacket, NetworkSettingsPacket, PlayerAuthInputPacket, CreativeContentPacket, PlayerEnchantOptionsPacket, SyncActorPropertyPacket, ItemStackRequestPacket, ItemStackResponsePacket, EmoteListPacket, DebugInfoPacket, PacketViolationWarningPacket, AnimateEntityPacket, CorrectPlayerMovePredictionPacket, ClientBoundMapItemDataPacket, MapInfoRequestPacket, ItemRegistryPacket, ClientBoundDebugRendererPacket, UpdateTradePacket, NpcDialoguePacket, SubChunkPacket, SubChunkRequestPacket, ScriptMessagePacket, RequestPermissionsPacket, ToastRequestPacket, UpdateAbilitiesPacket, UpdateAdventureSettingsPacket, DeathInfoPacket, RequestNetworkSettingsPacket, SetPlayerInventoryOptionsPacket, SetHudPacket, AwardAchievementPacket, ClientboundCloseFormPacket, ServerboundLoadingScreenPacketPacket, UpdateClientInputLocksPacket, CurrectStructureFeaturePacket, ServerboundDiagnosticsPacket, MovementEffectPacket, UpdateSubchunkBlocksPacket, UpdateBlockSyncPacket, SetLastHurtByPacket, UpdatePlayerGameTypePacket, SetDefaultGamemodePacket, MotionPredictHintsPacket, ClientCacheStatusPacket, AddPaintingPacket, PlayerUpdateEntityOverridesPacket, ServerScriptDebugDrawerPacket, MaterialRenderMethod, EntityPropertyType, WearableSlot, ContainerType, ContainerId, CreativeItemCategory, CreativeItemGroup, ItemUseMethod, Vector3f, BlockFace, NetworkItemInstanceDescriptor, NetworkItemStackDescriptor, Enchantment, EquipmentSlot, EffectType, Color, DimensionType, IPosition, UpdateBlockLayerType, ScoreboardIdentityType, ObjectiveSortOrder, DisplaySlotType, GameRule, Gamemode, Difficulty, ModalFormType, BossEventColor, ActorDataId, DataItem, ActorFlag, AttributeName, Attribute, AbilityIndex, PropertySyncData, HudElement, DeviceOS, MemoryTier, InputMode, InteractionMode, PlayMode, Rotation, SerializedSkin, BlockPosition, DisconnectReason, ContainerName, Vector2f, ActorDamageCause, ChunkCoords, NetworkBlockTypeDefinition, CompressionMethod, InventoryAction, ItemUseInventoryTransaction, ItemUseOnEntityInventoryTransaction, LoginTokens, LoginTokenData, InputData, PlayerBlockActionData, ItemStackRequestActionMineBlock, RequestedResourcePack } from '@serenityjs/protocol';
|
|
5
5
|
import { CompoundTag, TagType, BaseTag, ListTag, IntTag, StringTag, ByteTag, LongTag } from '@serenityjs/nbt';
|
|
6
6
|
import { BinaryStream } from '@serenityjs/binarystream';
|
|
7
7
|
import * as readline from 'readline';
|
|
@@ -38,6 +38,10 @@ declare class NetworkHandler {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
declare class ResourcePack {
|
|
41
|
+
/**
|
|
42
|
+
* The information about the resource pack.
|
|
43
|
+
*/
|
|
44
|
+
static packInformation: string;
|
|
41
45
|
/**
|
|
42
46
|
* The path to the main directory of the resource pack.
|
|
43
47
|
*/
|
|
@@ -117,6 +121,7 @@ declare class ResourcePack {
|
|
|
117
121
|
* @returns The hash as a Buffer.
|
|
118
122
|
*/
|
|
119
123
|
generateHash(): Buffer;
|
|
124
|
+
getSize(): number;
|
|
120
125
|
getDescriptor(): ResourcePackDescriptor;
|
|
121
126
|
}
|
|
122
127
|
|
|
@@ -3312,6 +3317,8 @@ interface NetworkEvents {
|
|
|
3312
3317
|
];
|
|
3313
3318
|
[Packet.UpdateTrade]: [NetworkPacketEvent<UpdateTradePacket>];
|
|
3314
3319
|
[Packet.NpcDialogue]: [NetworkPacketEvent<NpcDialoguePacket>];
|
|
3320
|
+
[Packet.SubChunk]: [NetworkPacketEvent<SubChunkPacket>];
|
|
3321
|
+
[Packet.SubChunkRequest]: [NetworkPacketEvent<SubChunkRequestPacket>];
|
|
3315
3322
|
[Packet.ScriptMessage]: [NetworkPacketEvent<ScriptMessagePacket>];
|
|
3316
3323
|
[Packet.RequestPermissions]: [NetworkPacketEvent<RequestPermissionsPacket>];
|
|
3317
3324
|
[Packet.ToastRequest]: [NetworkPacketEvent<ToastRequestPacket>];
|
|
@@ -11142,11 +11149,11 @@ declare class TickSchedule {
|
|
|
11142
11149
|
/**
|
|
11143
11150
|
* The amount of ticks to wait before the schedule is complete.
|
|
11144
11151
|
*/
|
|
11145
|
-
|
|
11152
|
+
scheduledTick: bigint;
|
|
11146
11153
|
/**
|
|
11147
11154
|
* The tick at which the schedule will be complete.
|
|
11148
11155
|
*/
|
|
11149
|
-
|
|
11156
|
+
completeTick: bigint;
|
|
11150
11157
|
/**
|
|
11151
11158
|
* The callbacks to call when the schedule is complete.
|
|
11152
11159
|
*/
|
|
@@ -17627,8 +17634,16 @@ declare class EmoteHandler extends NetworkHandler {
|
|
|
17627
17634
|
handle(packet: EmotePacket, connection: Connection): void;
|
|
17628
17635
|
}
|
|
17629
17636
|
|
|
17637
|
+
interface PlayerPackQueue {
|
|
17638
|
+
packs: Array<RequestedResourcePack>;
|
|
17639
|
+
schedule?: TickSchedule;
|
|
17640
|
+
}
|
|
17630
17641
|
declare class ResourcePackChunkRequestHandler extends NetworkHandler {
|
|
17631
17642
|
static readonly packet = Packet.ResourcePackChunkRequest;
|
|
17643
|
+
/**
|
|
17644
|
+
* A queue to keep track of resource pack chunk requests.
|
|
17645
|
+
*/
|
|
17646
|
+
readonly queue: Map<Player, PlayerPackQueue>;
|
|
17632
17647
|
handle(packet: ResourcePackChunkRequestPacket, connection: Connection): void;
|
|
17633
17648
|
/**
|
|
17634
17649
|
* Starts sending the resource pack to the player.
|
|
@@ -17636,6 +17651,7 @@ declare class ResourcePackChunkRequestHandler extends NetworkHandler {
|
|
|
17636
17651
|
* @param player The player to send the pack to.
|
|
17637
17652
|
* @param chunk The chunk index to start sending from.
|
|
17638
17653
|
*/
|
|
17654
|
+
private sendQueuedPacks;
|
|
17639
17655
|
private sendResourcePack;
|
|
17640
17656
|
}
|
|
17641
17657
|
|