@minecraft/server-editor 0.1.0-beta.1.26.40-preview.29 → 0.1.0-beta.1.26.40-preview.30

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.
Files changed (2) hide show
  1. package/index.d.ts +181 -128
  2. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -2298,7 +2298,7 @@ export class BlockUtilities {
2298
2298
  * @throws This function can throw errors.
2299
2299
  */
2300
2300
  fillVolume(
2301
- volume: minecraftserver.BlockVolumeBase | minecraftserver.CompoundBlockVolume | RelativeVolumeListBlockVolume,
2301
+ volume: minecraftserver.BlockVolumeBase | RelativeVolumeListBlockVolume,
2302
2302
  block?: minecraftserver.BlockPermutation | minecraftserver.BlockType | string,
2303
2303
  ): void;
2304
2304
  /**
@@ -2315,7 +2315,7 @@ export class BlockUtilities {
2315
2315
  *
2316
2316
  * @throws This function can throw errors.
2317
2317
  */
2318
- getContiguousSelection(properties?: ContiguousSelectionProperties): minecraftserver.CompoundBlockVolume;
2318
+ getContiguousSelection(properties?: ContiguousSelectionProperties): RelativeVolumeListBlockVolume;
2319
2319
  /**
2320
2320
  * @remarks
2321
2321
  * This function can't be called in restricted-execution mode.
@@ -2383,6 +2383,77 @@ export class BlockUtilities {
2383
2383
  ): RelativeVolumeListBlockVolume;
2384
2384
  }
2385
2385
 
2386
+ export class BlockUtilityTasks {
2387
+ private constructor();
2388
+ /**
2389
+ * @remarks
2390
+ * This function can't be called in restricted-execution mode.
2391
+ *
2392
+ * @throws This function can throw errors.
2393
+ */
2394
+ fillVolume(
2395
+ volume: minecraftserver.BlockVolumeBase | RelativeVolumeListBlockVolume,
2396
+ block?: minecraftserver.BlockPermutation | minecraftserver.BlockType | string,
2397
+ maxBlocksPerTick?: number,
2398
+ ): Promise<number>;
2399
+ /**
2400
+ * @remarks
2401
+ * This function can't be called in restricted-execution mode.
2402
+ *
2403
+ * @throws This function can throw errors.
2404
+ */
2405
+ findObscuredBlocksWithinVolume(
2406
+ volume: minecraftserver.BlockVolumeBase | RelativeVolumeListBlockVolume,
2407
+ maxBlocksPerTick?: number,
2408
+ ): Promise<RelativeVolumeListBlockVolume>;
2409
+ /**
2410
+ * @remarks
2411
+ * This function can't be called in restricted-execution mode.
2412
+ *
2413
+ * @throws This function can throw errors.
2414
+ */
2415
+ generateManifest(
2416
+ volume: minecraftserver.BlockVolumeBase | RelativeVolumeListBlockVolume,
2417
+ maxBlocksPerTick?: number,
2418
+ ): Promise<BlockUtilityManifest>;
2419
+ /**
2420
+ * @remarks
2421
+ * This function can't be called in restricted-execution mode.
2422
+ *
2423
+ * @throws This function can throw errors.
2424
+ */
2425
+ replaceBlocksInSelection(
2426
+ volume: minecraftserver.BlockVolumeBase | RelativeVolumeListBlockVolume,
2427
+ fromBlockIdentifier: string,
2428
+ toBlock?: minecraftserver.BlockPermutation | minecraftserver.BlockType | string,
2429
+ maxBlocksPerTick?: number,
2430
+ ): Promise<number>;
2431
+ /**
2432
+ * @remarks
2433
+ * This function can't be called in restricted-execution mode.
2434
+ *
2435
+ * @throws This function can throw errors.
2436
+ */
2437
+ shrinkWrapVolume(
2438
+ volume: minecraftserver.BlockVolumeBase | RelativeVolumeListBlockVolume,
2439
+ maxBlocksPerTick?: number,
2440
+ ): Promise<RelativeVolumeListBlockVolume>;
2441
+ /**
2442
+ * @remarks
2443
+ * This function can't be called in restricted-execution mode.
2444
+ *
2445
+ * @throws This function can throw errors.
2446
+ */
2447
+ trimVolumeToFitContents(
2448
+ volume: minecraftserver.BlockVolumeBase | RelativeVolumeListBlockVolume,
2449
+ retainMarqueeAfterTrimming: boolean,
2450
+ ignoreLiquid: boolean,
2451
+ ignoreNoCollision: boolean,
2452
+ blockMask?: BlockMaskList,
2453
+ maxBlocksPerTick?: number,
2454
+ ): Promise<RelativeVolumeListBlockVolume>;
2455
+ }
2456
+
2386
2457
  /**
2387
2458
  * Base for creating new brush shapes
2388
2459
  */
@@ -2613,6 +2684,12 @@ export class BrushShapeManager {
2613
2684
  *
2614
2685
  */
2615
2686
  setInverseEraseMode(inverseEraseMode: boolean): void;
2687
+ /**
2688
+ * @remarks
2689
+ * This function can't be called in restricted-execution mode.
2690
+ *
2691
+ */
2692
+ setPendingTransaction(pendingTransaction?: PendingTransaction): void;
2616
2693
  /**
2617
2694
  * @remarks
2618
2695
  * This function can't be called in restricted-execution mode.
@@ -2733,7 +2810,11 @@ export class ClipboardItem {
2733
2810
  * Success or Failure
2734
2811
  * @throws This function can throw errors.
2735
2812
  */
2736
- writeToWorld(location: minecraftserver.Vector3, options?: ClipboardWriteOptions): boolean;
2813
+ writeToWorld(
2814
+ location: minecraftserver.Vector3,
2815
+ options?: ClipboardWriteOptions,
2816
+ transaction?: PendingTransaction,
2817
+ ): boolean;
2737
2818
  }
2738
2819
 
2739
2820
  /**
@@ -3471,6 +3552,7 @@ export class ExtensionContext {
3471
3552
  readonly afterEvents: ExtensionContextAfterEvents;
3472
3553
  readonly blockPalette: BlockPaletteManager;
3473
3554
  readonly blockUtilities: BlockUtilities;
3555
+ readonly blockUtilityTasks: BlockUtilityTasks;
3474
3556
  readonly brushShapeManager: BrushShapeManager;
3475
3557
  /**
3476
3558
  * @remarks
@@ -4118,6 +4200,83 @@ export declare abstract class ObservableValidator<T> {
4118
4200
  abstract validate(newValue: T): T | undefined;
4119
4201
  }
4120
4202
 
4203
+ export class PendingTransaction {
4204
+ private constructor();
4205
+ /**
4206
+ * @remarks
4207
+ * This function can't be called in restricted-execution mode.
4208
+ *
4209
+ * @throws This function can throw errors.
4210
+ */
4211
+ addEntityOperation(entity: minecraftserver.Entity, type: EntityOperationType): boolean;
4212
+ /**
4213
+ * @remarks
4214
+ * This function can't be called in restricted-execution mode.
4215
+ *
4216
+ * @throws This function can throw errors.
4217
+ */
4218
+ addUserDefinedOperation(
4219
+ transactionHandlerId: UserDefinedTransactionHandlerId,
4220
+ operationData: string,
4221
+ operationName?: string,
4222
+ ): void;
4223
+ /**
4224
+ * @remarks
4225
+ * This function can't be called in restricted-execution mode.
4226
+ *
4227
+ * @throws This function can throw errors.
4228
+ */
4229
+ commitTrackedChanges(): number;
4230
+ /**
4231
+ * @remarks
4232
+ * This function can't be called in restricted-execution mode.
4233
+ *
4234
+ * @throws This function can throw errors.
4235
+ */
4236
+ discard(): void;
4237
+ /**
4238
+ * @remarks
4239
+ * This function can't be called in restricted-execution mode.
4240
+ *
4241
+ * @throws This function can throw errors.
4242
+ */
4243
+ discardTrackedChanges(): number;
4244
+ /**
4245
+ * @remarks
4246
+ * This function can't be called in restricted-execution mode.
4247
+ *
4248
+ */
4249
+ isValid(): boolean;
4250
+ /**
4251
+ * @remarks
4252
+ * This function can't be called in restricted-execution mode.
4253
+ *
4254
+ * @throws This function can throw errors.
4255
+ */
4256
+ submit(): void;
4257
+ /**
4258
+ * @remarks
4259
+ * This function can't be called in restricted-execution mode.
4260
+ *
4261
+ * @throws This function can throw errors.
4262
+ */
4263
+ trackBlockChangeArea(from: minecraftserver.Vector3, to: minecraftserver.Vector3): boolean;
4264
+ /**
4265
+ * @remarks
4266
+ * This function can't be called in restricted-execution mode.
4267
+ *
4268
+ * @throws This function can throw errors.
4269
+ */
4270
+ trackBlockChangeList(locations: minecraftserver.Vector3[]): boolean;
4271
+ /**
4272
+ * @remarks
4273
+ * This function can't be called in restricted-execution mode.
4274
+ *
4275
+ * @throws This function can throw errors.
4276
+ */
4277
+ trackBlockChangeVolume(blockVolume: minecraftserver.BlockVolumeBase): boolean;
4278
+ }
4279
+
4121
4280
  export class PlaytestManager {
4122
4281
  private constructor();
4123
4282
  /**
@@ -4613,49 +4772,7 @@ export class TransactionManager {
4613
4772
  *
4614
4773
  * @throws This function can throw errors.
4615
4774
  */
4616
- addEntityOperation(entity: minecraftserver.Entity, type: EntityOperationType): boolean;
4617
- /**
4618
- * @remarks
4619
- * This function can't be called in restricted-execution mode.
4620
- *
4621
- * @throws This function can throw errors.
4622
- */
4623
- addUserDefinedOperation(
4624
- transactionHandlerId: UserDefinedTransactionHandlerId,
4625
- operationData: string,
4626
- operationName?: string,
4627
- ): void;
4628
- /**
4629
- * @remarks
4630
- * Commit all of the transaction operations currently attached
4631
- * to the open transaction record to the manager. These will
4632
- * be added as a single transaction manager entry.
4633
- * The open record will be closed and all tracking operations
4634
- * will cease.
4635
- *
4636
- * This function can't be called in restricted-execution mode.
4637
- *
4638
- * @throws This function can throw errors.
4639
- */
4640
- commitOpenTransaction(): boolean;
4641
- /**
4642
- * @remarks
4643
- * This function will commit the pending changes caused by any
4644
- * of the track changes variants. The changes will be
4645
- * committed to the currently open transaction, but the
4646
- * transaction will remain open for further records.
4647
- * Pending block changes from tracking operations will be added
4648
- * to the transaction record before submission to the
4649
- * transaction manager
4650
- *
4651
- * This function can't be called in restricted-execution mode.
4652
- *
4653
- * @returns
4654
- * Returns the number of change requests that were being
4655
- * tracked
4656
- * @throws This function can throw errors.
4657
- */
4658
- commitTrackedChanges(): number;
4775
+ createPendingTransaction(name: string): PendingTransaction;
4659
4776
  /**
4660
4777
  * @remarks
4661
4778
  * This function can't be called in restricted-execution mode.
@@ -4666,52 +4783,6 @@ export class TransactionManager {
4666
4783
  undoClosure: (arg0: string) => void,
4667
4784
  redoClosure: (arg0: string) => void,
4668
4785
  ): UserDefinedTransactionHandlerId;
4669
- /**
4670
- * @remarks
4671
- * Discard the currently open transaction without committing it
4672
- * to the transaction manager stack.
4673
- * All records within the transaction will be discarded, and
4674
- * any tracking requests currently active will be stopped
4675
- *
4676
- * This function can't be called in restricted-execution mode.
4677
- *
4678
- * @throws This function can throw errors.
4679
- */
4680
- discardOpenTransaction(): boolean;
4681
- /**
4682
- * @remarks
4683
- * Discard any pending tracked changes. This does not affect
4684
- * the current open transaction contents, only the pending
4685
- * tracked block operations
4686
- *
4687
- * This function can't be called in restricted-execution mode.
4688
- *
4689
- * @returns
4690
- * Returns the number of change requests that were discarded
4691
- * @throws This function can throw errors.
4692
- */
4693
- discardTrackedChanges(): number;
4694
- /**
4695
- * @remarks
4696
- * This function can't be called in restricted-execution mode.
4697
- *
4698
- * @throws This function can throw errors.
4699
- */
4700
- isBusy(): boolean;
4701
- /**
4702
- * @remarks
4703
- * Open a transaction record which will be a container for any
4704
- * number of transaction operations.
4705
- * All transaction operations within a record are grouped and
4706
- * treated as a single atomic unit
4707
- *
4708
- * This function can't be called in restricted-execution mode.
4709
- *
4710
- * @param name
4711
- * Give the transaction record a name
4712
- * @throws This function can throw errors.
4713
- */
4714
- openTransaction(name: string): boolean;
4715
4786
  /**
4716
4787
  * @remarks
4717
4788
  * Perform an redo operation. This will take the last
@@ -4737,41 +4808,6 @@ export class TransactionManager {
4737
4808
  * @throws This function can throw errors.
4738
4809
  */
4739
4810
  redoSize(): number;
4740
- /**
4741
- * @remarks
4742
- * Begin tracking block changes in a specified area. These
4743
- * will be added to a pending changes list.
4744
- * The pending list will be added to the open transaction
4745
- * record when a commit has been issued.
4746
- *
4747
- * This function can't be called in restricted-execution mode.
4748
- *
4749
- * @param from
4750
- * Min block location of a bounding area
4751
- * @param to
4752
- * Max block location of a bounding area
4753
- * @throws This function can throw errors.
4754
- */
4755
- trackBlockChangeArea(from: minecraftserver.Vector3, to: minecraftserver.Vector3): boolean;
4756
- /**
4757
- * @remarks
4758
- * Begin tracking block changes in a list of specified block
4759
- * locations.
4760
- *
4761
- * This function can't be called in restricted-execution mode.
4762
- *
4763
- * @param locations
4764
- * An array of block locations to monitor for changes
4765
- * @throws This function can throw errors.
4766
- */
4767
- trackBlockChangeList(locations: minecraftserver.Vector3[]): boolean;
4768
- /**
4769
- * @remarks
4770
- * This function can't be called in restricted-execution mode.
4771
- *
4772
- * @throws This function can throw errors.
4773
- */
4774
- trackBlockChangeVolume(blockVolume: minecraftserver.BlockVolumeBase): boolean;
4775
4811
  /**
4776
4812
  * @remarks
4777
4813
  * Perform an undo operation. This will take the last
@@ -4841,7 +4877,7 @@ export declare class UserDefinedTransactionHandle<T> {
4841
4877
  * @param transactionName
4842
4878
  * A string name that will be associated with this operation
4843
4879
  */
4844
- addUserDefinedOperation(payload: T, transactionName: string): void;
4880
+ addUserDefinedOperation(payload: T, transactionName: string, pendingTransaction: PendingTransaction): void;
4845
4881
  }
4846
4882
 
4847
4883
  export class UserDefinedTransactionHandlerId {
@@ -6170,6 +6206,16 @@ export interface BlockMaskList {
6170
6206
  maskType: BlockMaskListType;
6171
6207
  }
6172
6208
 
6209
+ export interface BlockUtilityManifest {
6210
+ entries: BlockUtilityManifestEntry[];
6211
+ totalBlocks: number;
6212
+ }
6213
+
6214
+ export interface BlockUtilityManifestEntry {
6215
+ blockIdentifier: string;
6216
+ count: number;
6217
+ }
6218
+
6173
6219
  /**
6174
6220
  * Represents a UI session for a given player
6175
6221
  */
@@ -11314,6 +11360,13 @@ export interface ITimelinePlayerOptions extends IPropertyItemOptionsBase {
11314
11360
  *
11315
11361
  */
11316
11362
  groups?: ITimelinePlayerGroup[];
11363
+ /**
11364
+ * @remarks
11365
+ * Callback triggered when the total duration changes (e.g. via
11366
+ * the timeline drag handle).
11367
+ *
11368
+ */
11369
+ onDurationChanged?: (duration: number) => void;
11317
11370
  /**
11318
11371
  * @remarks
11319
11372
  * Callback triggered when the group selection changes.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-editor",
3
- "version": "0.1.0-beta.1.26.40-preview.29",
3
+ "version": "0.1.0-beta.1.26.40-preview.30",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -14,8 +14,8 @@
14
14
  ],
15
15
  "peerDependencies": {
16
16
  "@minecraft/common": "^1.0.0",
17
- "@minecraft/server": "^2.10.0-beta.1.26.40-preview.29",
18
- "@minecraft/vanilla-data": ">=1.20.70 || 1.26.40-preview.29"
17
+ "@minecraft/server": "^2.10.0-beta.1.26.40-preview.30",
18
+ "@minecraft/vanilla-data": ">=1.20.70 || 1.26.40-preview.30"
19
19
  },
20
20
  "license": "MIT"
21
21
  }