pw-js-api 0.3.14-dev.78e6b0c → 0.3.14-dev.92445dd

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.
@@ -173,6 +173,18 @@ export type WorldPacket = Message<"WorldPackets.WorldPacket"> & {
173
173
  */
174
174
  value: PlayerMagicPacket;
175
175
  case: "playerMagicPacket";
176
+ } | {
177
+ /**
178
+ * @generated from field: WorldPackets.GameTicksSyncRequestPacket game_ticks_sync_request_packet = 42;
179
+ */
180
+ value: GameTicksSyncRequestPacket;
181
+ case: "gameTicksSyncRequestPacket";
182
+ } | {
183
+ /**
184
+ * @generated from field: WorldPackets.GameTicksSyncResponsePacket game_ticks_sync_response_packet = 43;
185
+ */
186
+ value: GameTicksSyncResponsePacket;
187
+ case: "gameTicksSyncResponsePacket";
176
188
  } | {
177
189
  /**
178
190
  * World packets - Mostly send out by the server
@@ -344,15 +356,44 @@ export type SystemMessagePacket = Message<"WorldPackets.SystemMessagePacket"> &
344
356
  */
345
357
  message: string;
346
358
  /**
347
- * @generated from field: bool is_dialog = 3;
359
+ * @generated from field: WorldPackets.SystemMessagePacket.Type type = 3;
348
360
  */
349
- isDialog: boolean;
361
+ type: SystemMessagePacket_Type;
362
+ /**
363
+ * @generated from field: bool is_broadcast = 4;
364
+ */
365
+ isBroadcast: boolean;
366
+ /**
367
+ * @generated from field: optional string icon = 5;
368
+ */
369
+ icon?: string;
350
370
  };
351
371
  /**
352
372
  * Describes the message WorldPackets.SystemMessagePacket.
353
373
  * Use `create(SystemMessagePacketSchema)` to create a new message.
354
374
  */
355
375
  export declare const SystemMessagePacketSchema: GenMessage<SystemMessagePacket>;
376
+ /**
377
+ * @generated from enum WorldPackets.SystemMessagePacket.Type
378
+ */
379
+ export declare enum SystemMessagePacket_Type {
380
+ /**
381
+ * @generated from enum value: CHAT = 0;
382
+ */
383
+ CHAT = 0,
384
+ /**
385
+ * @generated from enum value: TOAST = 1;
386
+ */
387
+ TOAST = 1,
388
+ /**
389
+ * @generated from enum value: DIALOG = 2;
390
+ */
391
+ DIALOG = 2
392
+ }
393
+ /**
394
+ * Describes the enum WorldPackets.SystemMessagePacket.Type.
395
+ */
396
+ export declare const SystemMessagePacket_TypeSchema: GenEnum<SystemMessagePacket_Type>;
356
397
  /**
357
398
  * @generated from message WorldPackets.OldChatMessagesPacket
358
399
  */
@@ -454,9 +495,23 @@ export declare const PlayerCounterTransactionPacketSchema: GenMessage<PlayerCoun
454
495
  */
455
496
  export type WorldReloadedPacket = Message<"WorldPackets.WorldReloadedPacket"> & {
456
497
  /**
457
- * @generated from field: bytes world_data = 1;
498
+ * New structured world data format (same as PlayerInitPacket)
499
+ *
500
+ * @generated from field: repeated WorldPackets.BlockDataInfo block_data_palette = 1;
501
+ */
502
+ blockDataPalette: BlockDataInfo[];
503
+ /**
504
+ * @generated from field: bytes background_layer_data = 2;
458
505
  */
459
- worldData: Uint8Array;
506
+ backgroundLayerData: Uint8Array;
507
+ /**
508
+ * @generated from field: bytes foreground_layer_data = 3;
509
+ */
510
+ foregroundLayerData: Uint8Array;
511
+ /**
512
+ * @generated from field: bytes overlay_layer_data = 4;
513
+ */
514
+ overlayLayerData: Uint8Array;
460
515
  };
461
516
  /**
462
517
  * Describes the message WorldPackets.WorldReloadedPacket.
@@ -474,6 +529,55 @@ export type WorldClearedPacket = Message<"WorldPackets.WorldClearedPacket"> & {}
474
529
  * Use `create(WorldClearedPacketSchema)` to create a new message.
475
530
  */
476
531
  export declare const WorldClearedPacketSchema: GenMessage<WorldClearedPacket>;
532
+ /**
533
+ * Block field value that can hold different types
534
+ *
535
+ * @generated from message WorldPackets.BlockFieldValue
536
+ */
537
+ export type BlockFieldValue = Message<"WorldPackets.BlockFieldValue"> & {
538
+ /**
539
+ * @generated from oneof WorldPackets.BlockFieldValue.value
540
+ */
541
+ value: {
542
+ /**
543
+ * @generated from field: int32 int32_value = 1;
544
+ */
545
+ value: number;
546
+ case: "int32Value";
547
+ } | {
548
+ /**
549
+ * @generated from field: uint32 uint32_value = 2;
550
+ */
551
+ value: number;
552
+ case: "uint32Value";
553
+ } | {
554
+ /**
555
+ * @generated from field: string string_value = 3;
556
+ */
557
+ value: string;
558
+ case: "stringValue";
559
+ } | {
560
+ /**
561
+ * @generated from field: bool bool_value = 4;
562
+ */
563
+ value: boolean;
564
+ case: "boolValue";
565
+ } | {
566
+ /**
567
+ * @generated from field: bytes byte_array_value = 5;
568
+ */
569
+ value: Uint8Array;
570
+ case: "byteArrayValue";
571
+ } | {
572
+ case: undefined;
573
+ value?: undefined;
574
+ };
575
+ };
576
+ /**
577
+ * Describes the message WorldPackets.BlockFieldValue.
578
+ * Use `create(BlockFieldValueSchema)` to create a new message.
579
+ */
580
+ export declare const BlockFieldValueSchema: GenMessage<BlockFieldValue>;
477
581
  /**
478
582
  * @generated from message WorldPackets.WorldBlockPlacedPacket
479
583
  */
@@ -497,11 +601,13 @@ export type WorldBlockPlacedPacket = Message<"WorldPackets.WorldBlockPlacedPacke
497
601
  */
498
602
  blockId: number;
499
603
  /**
500
- * Legacy? Holds a byte[] that can hold extra information
604
+ * Structured block fields
501
605
  *
502
- * @generated from field: bytes extra_fields = 5;
606
+ * @generated from field: map<string, WorldPackets.BlockFieldValue> fields = 5;
503
607
  */
504
- extraFields: Uint8Array;
608
+ fields: {
609
+ [key: string]: BlockFieldValue;
610
+ };
505
611
  };
506
612
  /**
507
613
  * Describes the message WorldPackets.WorldBlockPlacedPacket.
@@ -529,11 +635,13 @@ export type WorldBlockFilledPacket = Message<"WorldPackets.WorldBlockFilledPacke
529
635
  */
530
636
  blockId: number;
531
637
  /**
532
- * Legacy? Holds a byte[] that can hold extra information
638
+ * Structured block fields
533
639
  *
534
- * @generated from field: bytes extra_fields = 5;
640
+ * @generated from field: map<string, WorldPackets.BlockFieldValue> fields = 5;
535
641
  */
536
- extraFields: Uint8Array;
642
+ fields: {
643
+ [key: string]: BlockFieldValue;
644
+ };
537
645
  };
538
646
  /**
539
647
  * Describes the message WorldPackets.WorldBlockFilledPacket.
@@ -587,28 +695,70 @@ export type PlayerInitPacket = Message<"WorldPackets.PlayerInitPacket"> & {
587
695
  * @generated from field: bytes global_switch_state = 5;
588
696
  */
589
697
  globalSwitchState: Uint8Array;
590
- /**
591
- * @generated from field: bytes world_data = 6;
592
- */
593
- worldData: Uint8Array;
594
698
  /**
595
699
  * Did player woot?
596
700
  *
597
- * @generated from field: WorldPackets.PlayerWoot player_woot = 7;
701
+ * @generated from field: WorldPackets.PlayerWoot player_woot = 6;
598
702
  */
599
703
  playerWoot?: PlayerWoot;
600
704
  /**
601
705
  * Text labels to display in the world
602
706
  *
603
- * @generated from field: repeated WorldPackets.TextLabel text_labels = 8;
707
+ * @generated from field: repeated WorldPackets.TextLabel text_labels = 7;
604
708
  */
605
709
  textLabels: TextLabel[];
710
+ /**
711
+ * Structured world data format
712
+ *
713
+ * @generated from field: repeated WorldPackets.BlockDataInfo block_data_palette = 8;
714
+ */
715
+ blockDataPalette: BlockDataInfo[];
716
+ /**
717
+ * @generated from field: bytes background_layer_data = 9;
718
+ */
719
+ backgroundLayerData: Uint8Array;
720
+ /**
721
+ * @generated from field: bytes foreground_layer_data = 10;
722
+ */
723
+ foregroundLayerData: Uint8Array;
724
+ /**
725
+ * @generated from field: bytes overlay_layer_data = 11;
726
+ */
727
+ overlayLayerData: Uint8Array;
728
+ /**
729
+ * Elapsed ticks since game started (100 ticks per second) - clients use this as reference point (0)
730
+ *
731
+ * @generated from field: int64 game_elapsed_time = 12;
732
+ */
733
+ gameElapsedTime: bigint;
606
734
  };
607
735
  /**
608
736
  * Describes the message WorldPackets.PlayerInitPacket.
609
737
  * Use `create(PlayerInitPacketSchema)` to create a new message.
610
738
  */
611
739
  export declare const PlayerInitPacketSchema: GenMessage<PlayerInitPacket>;
740
+ /**
741
+ * Information about a block data type for the palette
742
+ *
743
+ * @generated from message WorldPackets.BlockDataInfo
744
+ */
745
+ export type BlockDataInfo = Message<"WorldPackets.BlockDataInfo"> & {
746
+ /**
747
+ * @generated from field: int32 block_id = 1;
748
+ */
749
+ blockId: number;
750
+ /**
751
+ * @generated from field: map<string, WorldPackets.BlockFieldValue> fields = 2;
752
+ */
753
+ fields: {
754
+ [key: string]: BlockFieldValue;
755
+ };
756
+ };
757
+ /**
758
+ * Describes the message WorldPackets.BlockDataInfo.
759
+ * Use `create(BlockDataInfoSchema)` to create a new message.
760
+ */
761
+ export declare const BlockDataInfoSchema: GenMessage<BlockDataInfo>;
612
762
  /**
613
763
  * Pong back to the server that init has been done.
614
764
  *
@@ -1175,6 +1325,35 @@ export type PlayerWoot = Message<"WorldPackets.PlayerWoot"> & {
1175
1325
  * Use `create(PlayerWootSchema)` to create a new message.
1176
1326
  */
1177
1327
  export declare const PlayerWootSchema: GenMessage<PlayerWoot>;
1328
+ /**
1329
+ * Empty - client requests current game ticks
1330
+ *
1331
+ * @generated from message WorldPackets.GameTicksSyncRequestPacket
1332
+ */
1333
+ export type GameTicksSyncRequestPacket = Message<"WorldPackets.GameTicksSyncRequestPacket"> & {};
1334
+ /**
1335
+ * Describes the message WorldPackets.GameTicksSyncRequestPacket.
1336
+ * Use `create(GameTicksSyncRequestPacketSchema)` to create a new message.
1337
+ */
1338
+ export declare const GameTicksSyncRequestPacketSchema: GenMessage<GameTicksSyncRequestPacket>;
1339
+ /**
1340
+ * @generated from message WorldPackets.GameTicksSyncResponsePacket
1341
+ */
1342
+ export type GameTicksSyncResponsePacket = Message<"WorldPackets.GameTicksSyncResponsePacket"> & {
1343
+ /**
1344
+ * @generated from field: int64 game_elapsed_time = 1;
1345
+ */
1346
+ gameElapsedTime: bigint;
1347
+ /**
1348
+ * @generated from field: bool is_paused = 2;
1349
+ */
1350
+ isPaused: boolean;
1351
+ };
1352
+ /**
1353
+ * Describes the message WorldPackets.GameTicksSyncResponsePacket.
1354
+ * Use `create(GameTicksSyncResponsePacketSchema)` to create a new message.
1355
+ */
1356
+ export declare const GameTicksSyncResponsePacketSchema: GenMessage<GameTicksSyncResponsePacket>;
1178
1357
  /**
1179
1358
  *
1180
1359
  * ============================================