@minecraft/server-editor 0.1.0-beta.1.21.130-preview.25 → 0.1.0-beta.1.21.130-preview.27

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 +125 -14
  2. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -93,10 +93,15 @@ export enum BrushDirectionalPlacementMode {
93
93
  Random3Axes = 14,
94
94
  }
95
95
 
96
+ export enum BrushElevationMode {
97
+ Raise = 0,
98
+ Lower = 1,
99
+ }
100
+
96
101
  /**
97
102
  * The possible variants of a Button property item.
98
103
  */
99
- export declare enum ButtonPropertyItemVariant {
104
+ export declare enum ButtonVariant {
100
105
  Primary = 0,
101
106
  Secondary = 1,
102
107
  Confirmation = 2,
@@ -1081,6 +1086,7 @@ export enum PaintMode {
1081
1086
  Smooth = 2,
1082
1087
  Roughen = 3,
1083
1088
  Flatten = 4,
1089
+ Elevation = 5,
1084
1090
  }
1085
1091
 
1086
1092
  export enum Plane {
@@ -1474,7 +1480,7 @@ export type ListPaneButtonEntryParams = {
1474
1480
  onClick: (entry: IListPaneButtonEntry) => void;
1475
1481
  title?: LocalizedString;
1476
1482
  tooltip?: BasicTooltipContent;
1477
- variant?: ButtonPropertyItemVariant;
1483
+ variant?: ButtonVariant;
1478
1484
  icon?: string;
1479
1485
  enabled?: boolean;
1480
1486
  visible?: boolean;
@@ -2183,6 +2189,30 @@ export class BrushShapeManager {
2183
2189
  *
2184
2190
  */
2185
2191
  setDirectionalPlacementMode(directionalPlacementMode: BrushDirectionalPlacementMode): void;
2192
+ /**
2193
+ * @remarks
2194
+ * This function can't be called in read-only mode.
2195
+ *
2196
+ */
2197
+ setElevationBrushRadius(elevationBrushRadius: number): void;
2198
+ /**
2199
+ * @remarks
2200
+ * This function can't be called in read-only mode.
2201
+ *
2202
+ */
2203
+ setElevationFalloff(elevationFalloff: number): void;
2204
+ /**
2205
+ * @remarks
2206
+ * This function can't be called in read-only mode.
2207
+ *
2208
+ */
2209
+ setElevationMode(elevationMode: BrushElevationMode): void;
2210
+ /**
2211
+ * @remarks
2212
+ * This function can't be called in read-only mode.
2213
+ *
2214
+ */
2215
+ setElevationSampleLayers(elevationSampleLayers: number): void;
2186
2216
  /**
2187
2217
  * @remarks
2188
2218
  * This function can't be called in read-only mode.
@@ -2503,6 +2533,10 @@ export class Cursor {
2503
2533
  * @throws This property can throw when used.
2504
2534
  */
2505
2535
  readonly isVisible: boolean;
2536
+ /**
2537
+ * @throws This property can throw when used.
2538
+ */
2539
+ readonly maxViewBlockDistance: number;
2506
2540
  /**
2507
2541
  * @remarks
2508
2542
  * Get the world position of the 3D block cursor
@@ -3161,7 +3195,7 @@ export class Logger {
3161
3195
  * The message string to send to the log window
3162
3196
  * @throws This function can throw errors.
3163
3197
  */
3164
- debug(message: string, properties?: LogProperties): void;
3198
+ debug(message: LocalizationEntry | string, properties?: LogProperties): void;
3165
3199
  /**
3166
3200
  * @remarks
3167
3201
  * The error channel is generally used when the editor
@@ -3176,7 +3210,7 @@ export class Logger {
3176
3210
  * The message string to send to the log window
3177
3211
  * @throws This function can throw errors.
3178
3212
  */
3179
- error(message: string, properties?: LogProperties): void;
3213
+ error(message: LocalizationEntry | string, properties?: LogProperties): void;
3180
3214
  /**
3181
3215
  * @remarks
3182
3216
  * The info channel is intended to communicate general,
@@ -3189,7 +3223,7 @@ export class Logger {
3189
3223
  * The message string to send to the log window
3190
3224
  * @throws This function can throw errors.
3191
3225
  */
3192
- info(message: string, properties?: LogProperties): void;
3226
+ info(message: LocalizationEntry | string, properties?: LogProperties): void;
3193
3227
  /**
3194
3228
  * @remarks
3195
3229
  * The warning channel is intended to inform the user of
@@ -3203,7 +3237,7 @@ export class Logger {
3203
3237
  * The message string to send to the log window
3204
3238
  * @throws This function can throw errors.
3205
3239
  */
3206
- warning(message: string, properties?: LogProperties): void;
3240
+ warning(message: LocalizationEntry | string, properties?: LogProperties): void;
3207
3241
  }
3208
3242
 
3209
3243
  /**
@@ -3589,6 +3623,30 @@ export class SelectionManager {
3589
3623
  private constructor();
3590
3624
  readonly entity: SelectionContainerEntity;
3591
3625
  readonly volume: SelectionContainerVolume;
3626
+ /**
3627
+ * @remarks
3628
+ * This function can't be called in read-only mode.
3629
+ *
3630
+ */
3631
+ deselectBlocks(blockIdentifier: string): Promise<number>;
3632
+ /**
3633
+ * @remarks
3634
+ * This function can't be called in read-only mode.
3635
+ *
3636
+ */
3637
+ generateManifest(): Promise<SelectionManifestData>;
3638
+ /**
3639
+ * @remarks
3640
+ * This function can't be called in read-only mode.
3641
+ *
3642
+ */
3643
+ getCurrentManifest(): SelectionManifestData | undefined;
3644
+ /**
3645
+ * @remarks
3646
+ * This function can't be called in read-only mode.
3647
+ *
3648
+ */
3649
+ replaceBlocks(fromBlockIdentifier: string, toBlockIdentifier: string): Promise<number>;
3592
3650
  }
3593
3651
 
3594
3652
  /**
@@ -4147,7 +4205,7 @@ export class Widget {
4147
4205
  */
4148
4206
  addClipboardComponent(
4149
4207
  componentName: string,
4150
- clipboardItem?: ClipboardItem,
4208
+ clipboardItem?: ClipboardItem | EditorStructure,
4151
4209
  options?: WidgetComponentClipboardOptions,
4152
4210
  ): WidgetComponentClipboard;
4153
4211
  /**
@@ -5627,6 +5685,12 @@ export interface IButtonPropertyItemOptions extends IPropertyItemOptionsBase {
5627
5685
  *
5628
5686
  */
5629
5687
  icon?: string;
5688
+ /**
5689
+ * @remarks
5690
+ * Shrinks button to icon size if button has an icon.
5691
+ *
5692
+ */
5693
+ shrinkToIcon?: boolean;
5630
5694
  /**
5631
5695
  * @remarks
5632
5696
  * Localized title of the property item.
@@ -5644,7 +5708,7 @@ export interface IButtonPropertyItemOptions extends IPropertyItemOptionsBase {
5644
5708
  * The variant for the button. By default it is Primary.
5645
5709
  *
5646
5710
  */
5647
- variant?: ButtonPropertyItemVariant;
5711
+ variant?: ButtonVariant;
5648
5712
  }
5649
5713
 
5650
5714
  /**
@@ -6159,6 +6223,13 @@ export interface IDropdownPropertyItemOptions extends IPropertyItemOptionsBase {
6159
6223
  *
6160
6224
  */
6161
6225
  hiddenLabel?: boolean;
6226
+ /**
6227
+ * @remarks
6228
+ * Determines how many entries can be displayed before
6229
+ * scrolling is enabled, based on available space.
6230
+ *
6231
+ */
6232
+ maxVisibleEntries?: number;
6162
6233
  /**
6163
6234
  * @remarks
6164
6235
  * This callback is called when UI control value is changed.
@@ -7608,7 +7679,7 @@ export interface IPlayerLogger {
7608
7679
  * @param props
7609
7680
  * Optional player log properties
7610
7681
  */
7611
- debug(message: string, props?: IPlayerLoggerProperties): void;
7682
+ debug(message: LocalizedString, props?: IPlayerLoggerProperties): void;
7612
7683
  /**
7613
7684
  * @remarks
7614
7685
  * Dispatch a player log message with Error log level
@@ -7618,7 +7689,7 @@ export interface IPlayerLogger {
7618
7689
  * @param props
7619
7690
  * Optional player log properties
7620
7691
  */
7621
- error(message: string, props?: IPlayerLoggerProperties): void;
7692
+ error(message: LocalizedString, props?: IPlayerLoggerProperties): void;
7622
7693
  /**
7623
7694
  * @remarks
7624
7695
  * Dispatch a player log message with Info log level
@@ -7628,7 +7699,7 @@ export interface IPlayerLogger {
7628
7699
  * @param props
7629
7700
  * Optional player log properties
7630
7701
  */
7631
- info(message: string, props?: IPlayerLoggerProperties): void;
7702
+ info(message: LocalizedString, props?: IPlayerLoggerProperties): void;
7632
7703
  /**
7633
7704
  * @remarks
7634
7705
  * Dispatch a player log message with Warning log level
@@ -7638,7 +7709,7 @@ export interface IPlayerLogger {
7638
7709
  * @param props
7639
7710
  * Optional player log properties
7640
7711
  */
7641
- warning(message: string, props?: IPlayerLoggerProperties): void;
7712
+ warning(message: LocalizedString, props?: IPlayerLoggerProperties): void;
7642
7713
  }
7643
7714
 
7644
7715
  /**
@@ -7656,7 +7727,7 @@ export interface IPlayerLoggerProperties {
7656
7727
  * A player log sub message for the toast channel
7657
7728
  *
7658
7729
  */
7659
- subMessage?: string;
7730
+ subMessage?: LocalizedString;
7660
7731
  }
7661
7732
 
7662
7733
  /**
@@ -8438,6 +8509,14 @@ export interface ITextPropertyItem extends IPropertyItemBase {
8438
8509
  *
8439
8510
  */
8440
8511
  setTitle(title: LocalizedString | undefined): void;
8512
+ /**
8513
+ * @remarks
8514
+ * Updates tooltip description of property item.
8515
+ *
8516
+ * @param tooltip
8517
+ * New tooltip.
8518
+ */
8519
+ setTooltip(tooltip: BasicTooltipContent | undefined): void;
8441
8520
  }
8442
8521
 
8443
8522
  /**
@@ -8465,6 +8544,12 @@ export interface ITextPropertyItemOptions extends IPropertyItemOptionsBase {
8465
8544
  *
8466
8545
  */
8467
8546
  title?: LocalizedString;
8547
+ /**
8548
+ * @remarks
8549
+ * Tooltip description of the property item.
8550
+ *
8551
+ */
8552
+ tooltip?: BasicTooltipContent;
8468
8553
  }
8469
8554
 
8470
8555
  /**
@@ -8527,6 +8612,13 @@ export interface IToggleGroupPropertyItem extends IPropertyItemBase {
8527
8612
  * Properties of toggle group property item list entry
8528
8613
  */
8529
8614
  export interface IToggleGroupPropertyItemEntry {
8615
+ /**
8616
+ * @remarks
8617
+ * Optional enabled state of the entry. If undefined it will be
8618
+ * true.
8619
+ *
8620
+ */
8621
+ readonly enabled?: boolean;
8530
8622
  /**
8531
8623
  * @remarks
8532
8624
  * Optional icon of the dropdown entry.
@@ -8775,6 +8867,11 @@ export interface IVector3PropertyItemOptions extends IPropertyItemOptionsBase {
8775
8867
  tooltip?: BasicTooltipContent;
8776
8868
  }
8777
8869
 
8870
+ export interface LocalizationEntry {
8871
+ id: string;
8872
+ props?: string[];
8873
+ }
8874
+
8778
8875
  /**
8779
8876
  * A properties class for the global instance of the logger
8780
8877
  * object.
@@ -8804,7 +8901,7 @@ export interface LogProperties {
8804
8901
  * selected.
8805
8902
  *
8806
8903
  */
8807
- subMessage?: string;
8904
+ subMessage?: LocalizationEntry | string;
8808
8905
  /**
8809
8906
  * @remarks
8810
8907
  * Add additional tags to the log message which can be used by
@@ -8908,6 +9005,20 @@ export interface QuickExtrudeProperties {
8908
9005
  startingLocation?: minecraftserver.Vector3;
8909
9006
  }
8910
9007
 
9008
+ export interface SelectionManifestData {
9009
+ entries: SelectionManifestEntry[];
9010
+ generationId: number;
9011
+ inProgress: boolean;
9012
+ processedBlocks: number;
9013
+ progress: number;
9014
+ totalBlocks: number;
9015
+ }
9016
+
9017
+ export interface SelectionManifestEntry {
9018
+ blockIdentifier: string;
9019
+ count: number;
9020
+ }
9021
+
8911
9022
  export interface WeightedBlock {
8912
9023
  block: minecraftserver.BlockType;
8913
9024
  weight: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-editor",
3
- "version": "0.1.0-beta.1.21.130-preview.25",
3
+ "version": "0.1.0-beta.1.21.130-preview.27",
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.5.0-beta.1.21.130-preview.25",
18
- "@minecraft/vanilla-data": ">=1.20.70 || 1.21.130-preview.25"
17
+ "@minecraft/server": "^2.5.0-beta.1.21.130-preview.27",
18
+ "@minecraft/vanilla-data": ">=1.20.70 || 1.21.130-preview.27"
19
19
  },
20
20
  "license": "MIT"
21
21
  }