@minecraft/server-editor 0.1.0-beta.1.21.70-preview.21 → 0.1.0-beta.1.21.70-preview.23

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 +229 -36
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -95,6 +95,14 @@ export declare enum ComboBoxPropertyItemDataType {
95
95
  Entity = 2,
96
96
  }
97
97
 
98
+ export enum ContiguousSelectionType {
99
+ SameBlock = 0,
100
+ SameBlockAndStates = 1,
101
+ SolidBlocks = 2,
102
+ AllBlocks = 3,
103
+ Custom = 4,
104
+ }
105
+
98
106
  /**
99
107
  * Execution state of the continuous action
100
108
  */
@@ -1019,6 +1027,7 @@ export declare enum PropertyItemType {
1019
1027
  BlockTable = 'editorUI:BlockTable',
1020
1028
  Boolean = 'editorUI:Boolean',
1021
1029
  Button = 'editorUI:Button',
1030
+ ButtonPane = 'editorUI:ButtonPane',
1022
1031
  ColorPicker = 'editorUI:ColorPicker',
1023
1032
  ComboBox = 'editorUI:ComboBox',
1024
1033
  Divider = 'editorUI:Divider',
@@ -1172,6 +1181,11 @@ export type ActivationFunctionType<PerPlayerStorageType> = (
1172
1181
  uiSession: IPlayerUISession<PerPlayerStorageType>,
1173
1182
  ) => IDisposable[];
1174
1183
 
1184
+ /**
1185
+ * All possible button item action types
1186
+ */
1187
+ export type ButtonPropertyItemSupportedActionTypes = (() => void) | RegisteredAction<NoArgsAction>;
1188
+
1175
1189
  /**
1176
1190
  * An action that continues to execute after activation
1177
1191
  */
@@ -1614,6 +1628,31 @@ export class BlockUtilities {
1614
1628
  volume: minecraftserver.BlockVolumeBase | minecraftserver.CompoundBlockVolume | Selection,
1615
1629
  block?: minecraftserver.BlockPermutation | minecraftserver.BlockType | string,
1616
1630
  ): void;
1631
+ /**
1632
+ * @remarks
1633
+ * This function can't be called in read-only mode.
1634
+ *
1635
+ * @throws This function can throw errors.
1636
+ *
1637
+ * {@link minecraftserver.Error}
1638
+ */
1639
+ getContiguousSelection(properties?: ContiguousSelectionProperties): minecraftserver.CompoundBlockVolume;
1640
+ /**
1641
+ * @remarks
1642
+ * This function can't be called in read-only mode.
1643
+ *
1644
+ * @throws This function can throw errors.
1645
+ *
1646
+ * {@link minecraftserver.Error}
1647
+ */
1648
+ getFacePreviewSelection(properties?: QuickExtrudeProperties): minecraftserver.ListBlockVolume;
1649
+ /**
1650
+ * @remarks
1651
+ * This function can't be called in read-only mode.
1652
+ *
1653
+ * @throws This function can throw errors.
1654
+ */
1655
+ quickExtrude(properties?: QuickExtrudeProperties): void;
1617
1656
  }
1618
1657
 
1619
1658
  export class BrushShapeManager {
@@ -4187,6 +4226,17 @@ export interface ClipboardWriteOptions {
4187
4226
  rotation?: minecraftserver.StructureRotation;
4188
4227
  }
4189
4228
 
4229
+ export interface ContiguousSelectionProperties {
4230
+ checkForAdjacentFace?: boolean;
4231
+ contiguousSelectionBlockList?: string[];
4232
+ contiguousSelectionType?: ContiguousSelectionType;
4233
+ fullSelectionToleranceLevel?: number;
4234
+ isFace?: boolean;
4235
+ selectionDirection?: number;
4236
+ size?: number;
4237
+ startingLocation?: minecraftserver.Vector3;
4238
+ }
4239
+
4190
4240
  export interface CursorPosition {
4191
4241
  FaceDirection: number;
4192
4242
  Position: minecraftserver.Vector3;
@@ -4650,6 +4700,36 @@ export interface IBoolPropertyItemOptions extends IPropertyItemOptionsBase {
4650
4700
  variant?: BoolPropertyItemVariant;
4651
4701
  }
4652
4702
 
4703
+ /**
4704
+ * A property item pane which supports multiple buttons
4705
+ */
4706
+ // @ts-ignore Class inheritance allowed for native defined classes
4707
+ export interface IButtonPanePropertyItem extends IPropertyItemBase, IPane {
4708
+ /**
4709
+ * @remarks
4710
+ * Adds a button to the pane and binds the specified action to
4711
+ * the button interaction.
4712
+ *
4713
+ */
4714
+ addButton(
4715
+ action: ButtonPropertyItemSupportedActionTypes,
4716
+ options?: IButtonPropertyItemOptions,
4717
+ ): IButtonPropertyItem;
4718
+ }
4719
+
4720
+ /**
4721
+ * Optional properties for Button Pane property item
4722
+ */
4723
+ export interface IButtonPanePropertyItemOptions {
4724
+ /**
4725
+ * @remarks
4726
+ * Minimum width for each item within the layout. If undefined,
4727
+ * it will default to 6.
4728
+ *
4729
+ */
4730
+ itemMinWidth?: number;
4731
+ }
4732
+
4653
4733
  /**
4654
4734
  * A property item which supports Button properties
4655
4735
  */
@@ -5280,6 +5360,72 @@ export interface IMenuCreationParams {
5280
5360
  uniqueId?: string;
5281
5361
  }
5282
5362
 
5363
+ /**
5364
+ * A sub pane for modal control elements.
5365
+ */
5366
+ // @ts-ignore Class inheritance allowed for native defined classes
5367
+ export interface IModalControlPane extends IPane {
5368
+ /**
5369
+ * @remarks
5370
+ * Adds a togglable boolean item to the pane.
5371
+ *
5372
+ */
5373
+ addBool(value: IObservableProp<boolean>, options?: IBoolPropertyItemOptions): IBoolPropertyItem;
5374
+ /**
5375
+ * @remarks
5376
+ * Adds a button to the pane and binds the specified action to
5377
+ * the button activation.
5378
+ *
5379
+ */
5380
+ addButton(
5381
+ action: ButtonPropertyItemSupportedActionTypes,
5382
+ options?: IButtonPropertyItemOptions,
5383
+ ): IButtonPropertyItem;
5384
+ /**
5385
+ * @remarks
5386
+ * Adds a pane for grouped button layout.
5387
+ *
5388
+ */
5389
+ addButtonPane(options?: IButtonPanePropertyItemOptions): IButtonPanePropertyItem;
5390
+ /**
5391
+ * @remarks
5392
+ * Adds an divider item to the pane.
5393
+ *
5394
+ */
5395
+ addDivider(): IPropertyItemBase;
5396
+ }
5397
+
5398
+ /**
5399
+ * A modal overlay pane is displayed over a root pane.
5400
+ */
5401
+ // @ts-ignore Class inheritance allowed for native defined classes
5402
+ export interface IModalOverlayPane extends IPane {
5403
+ /**
5404
+ * @remarks
5405
+ * A sub pane that represents content of the modal overlay.
5406
+ *
5407
+ */
5408
+ contentPane: ISubPanePropertyItem;
5409
+ /**
5410
+ * @remarks
5411
+ * A pane that represent modal control elements.
5412
+ *
5413
+ */
5414
+ controlPane: IModalControlPane;
5415
+ }
5416
+
5417
+ /**
5418
+ * The options to create a modal overlay pane.
5419
+ */
5420
+ export interface IModalOverlayPaneOptions {
5421
+ /**
5422
+ * @remarks
5423
+ * Localized title of the modal overlay.
5424
+ *
5425
+ */
5426
+ title?: LocalizedString;
5427
+ }
5428
+
5283
5429
  export interface IModalTool {
5284
5430
  /**
5285
5431
  * @remarks
@@ -5442,6 +5588,36 @@ export interface IObservable<T> {
5442
5588
  set(newValue: T): boolean;
5443
5589
  }
5444
5590
 
5591
+ /**
5592
+ * Pane represents a container for UI components.
5593
+ */
5594
+ export interface IPane {
5595
+ /**
5596
+ * @remarks
5597
+ * Unique identifier for the pane.
5598
+ *
5599
+ */
5600
+ readonly id: string;
5601
+ /**
5602
+ * @remarks
5603
+ * Check visibility of the pane
5604
+ *
5605
+ */
5606
+ visible: boolean;
5607
+ /**
5608
+ * @remarks
5609
+ * Hide the pane.
5610
+ *
5611
+ */
5612
+ hide(): void;
5613
+ /**
5614
+ * @remarks
5615
+ * Show the pane and all of its items.
5616
+ *
5617
+ */
5618
+ show(): void;
5619
+ }
5620
+
5445
5621
  /**
5446
5622
  * Log helper interface for Player.
5447
5623
  */
@@ -5781,31 +5957,20 @@ export interface IPropertyItemOptionsVector3 extends IPropertyItemOptions {
5781
5957
  * with an object and presented with different kind of
5782
5958
  * controls.
5783
5959
  */
5784
- export interface IPropertyPane {
5960
+ // @ts-ignore Class inheritance allowed for native defined classes
5961
+ export interface IPropertyPane extends IPane {
5785
5962
  /**
5786
5963
  * @remarks
5787
5964
  * Pane state for being expanded or collapsed.
5788
5965
  *
5789
5966
  */
5790
5967
  collapsed: boolean;
5791
- /**
5792
- * @remarks
5793
- * Unique ID for the property pane.
5794
- *
5795
- */
5796
- readonly id: string;
5797
5968
  /**
5798
5969
  * @remarks
5799
5970
  * Provides visibility change events
5800
5971
  *
5801
5972
  */
5802
5973
  onPropertyPaneVisibilityUpdated: EventSink<PropertyPaneVisibilityUpdate>;
5803
- /**
5804
- * @remarks
5805
- * Check visibility of the pane
5806
- *
5807
- */
5808
- visible: boolean;
5809
5974
  /**
5810
5975
  * @remarks
5811
5976
  * Adds a block list to the pane.
@@ -5825,6 +5990,8 @@ export interface IPropertyPane {
5825
5990
  addBlockTable(options?: IBlockTablePropertyItemOptions): IBlockTablePropertyItem;
5826
5991
  /**
5827
5992
  * @remarks
5993
+ * Adds a togglable boolean item to the pane.
5994
+ *
5828
5995
  */
5829
5996
  addBool(value: IObservableProp<boolean>, options?: IBoolPropertyItemOptions): IBoolPropertyItem;
5830
5997
  /**
@@ -5840,13 +6007,19 @@ export interface IPropertyPane {
5840
6007
  /**
5841
6008
  * @remarks
5842
6009
  * Adds a button to the pane and binds the specified action to
5843
- * the button activate.
6010
+ * the button interaction.
5844
6011
  *
5845
6012
  */
5846
6013
  addButton(
5847
- action: (() => void) | RegisteredAction<NoArgsAction>,
6014
+ action: ButtonPropertyItemSupportedActionTypes,
5848
6015
  options?: IButtonPropertyItemOptions,
5849
6016
  ): IButtonPropertyItem;
6017
+ /**
6018
+ * @remarks
6019
+ * Adds a pane for grouped button layout.
6020
+ *
6021
+ */
6022
+ addButtonPane(options?: IButtonPanePropertyItemOptions): IButtonPanePropertyItem;
5850
6023
  /**
5851
6024
  * @remarks
5852
6025
  * Adds a color picker item to the pane.
@@ -5910,7 +6083,7 @@ export interface IPropertyPane {
5910
6083
  ): IImagePropertyItem;
5911
6084
  /**
5912
6085
  * @remarks
5913
- * Adds a multiline Text item to the pane.
6086
+ * Adds a Link item to the pane.
5914
6087
  *
5915
6088
  */
5916
6089
  addLink(value: IObservableProp<string>, options?: ILinkPropertyItemOptions): ILinkPropertyItem;
@@ -5938,6 +6111,8 @@ export interface IPropertyPane {
5938
6111
  addProgressIndicator(options?: IProgressIndicatorPropertyItemOptions): IProgressIndicatorPropertyItem;
5939
6112
  /**
5940
6113
  * @remarks
6114
+ * Adds an editable string item to the pane
6115
+ *
5941
6116
  */
5942
6117
  addString(value: IObservableProp<string>, options?: IStringPropertyItemOptions): IStringPropertyItem;
5943
6118
  /**
@@ -6006,22 +6181,10 @@ export interface IPropertyPane {
6006
6181
  createSubPane(options: ISubPanePropertyItemOptions): ISubPanePropertyItem;
6007
6182
  /**
6008
6183
  * @remarks
6009
- * Expand the pane.
6010
- *
6011
- */
6012
- expand(): void;
6013
- /**
6014
- * @remarks
6015
- * Returns property pane title.
6184
+ * Returns pane title.
6016
6185
  *
6017
6186
  */
6018
6187
  getTitle(): LocalizedString | undefined;
6019
- /**
6020
- * @remarks
6021
- * Hide the pane.
6022
- *
6023
- */
6024
- hide(): void;
6025
6188
  /**
6026
6189
  * @remarks
6027
6190
  * Removes an existing sub pane.
@@ -6030,18 +6193,12 @@ export interface IPropertyPane {
6030
6193
  removeSubPane(paneToRemove: IPropertyPane): boolean;
6031
6194
  /**
6032
6195
  * @remarks
6033
- * Updates title of property pane.
6196
+ * Updates title of pane.
6034
6197
  *
6035
6198
  * @param newTitle
6036
6199
  * New title
6037
6200
  */
6038
6201
  setTitle(newTitle: LocalizedString | undefined): void;
6039
- /**
6040
- * @remarks
6041
- * Show the pane and all of its property items.
6042
- *
6043
- */
6044
- show(): void;
6045
6202
  }
6046
6203
 
6047
6204
  /**
@@ -6123,12 +6280,37 @@ export interface IRegisterExtensionOptionalParameters {
6123
6280
  */
6124
6281
  // @ts-ignore Class inheritance allowed for native defined classes
6125
6282
  export interface IRootPropertyPane extends IPropertyPane {
6283
+ /**
6284
+ * @remarks
6285
+ * Register a modal overlay to the root pane. It will be hidden
6286
+ * by default, when shown it will display over the root pane
6287
+ * content. Only one modal overlay can be shown at a time.
6288
+ *
6289
+ * @param options
6290
+ * Creation parameters for modal overlay pane.
6291
+ */
6292
+ createModalOverlayPane(options?: IModalOverlayPaneOptions): IModalOverlayPane;
6293
+ /**
6294
+ * @remarks
6295
+ * @returns
6296
+ * Unique identifier of the active modal overlay
6297
+ */
6298
+ getActiveModalOverlayId(): string | undefined;
6126
6299
  /**
6127
6300
  * @remarks
6128
6301
  * @returns
6129
6302
  * Current visibility state of header action
6130
6303
  */
6131
6304
  isHeaderActionVisible(): boolean;
6305
+ /**
6306
+ * @remarks
6307
+ * Sets registered modal overlay as active, if not found it
6308
+ * will hide the current.
6309
+ *
6310
+ * @param id
6311
+ * Unique id for modal overlay pane.
6312
+ */
6313
+ setActiveModalOverlay(id: string | undefined): void;
6132
6314
  /**
6133
6315
  * @remarks
6134
6316
  * If a header action exists, updates visibility of the button.
@@ -7217,6 +7399,17 @@ export interface ProjectExportOptions {
7217
7399
  initialTimOfDay?: number;
7218
7400
  }
7219
7401
 
7402
+ export interface QuickExtrudeProperties {
7403
+ checkForAdjacentFace?: boolean;
7404
+ contiguousSelectionBlockList?: string[];
7405
+ contiguousSelectionType?: ContiguousSelectionType;
7406
+ isShrink?: boolean;
7407
+ layerCount?: number;
7408
+ selectionDirection?: number;
7409
+ size?: number;
7410
+ startingLocation?: minecraftserver.Vector3;
7411
+ }
7412
+
7220
7413
  export interface SettingsUIElementOptions {
7221
7414
  dropdownItems?: string[];
7222
7415
  max?: 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.70-preview.21",
3
+ "version": "0.1.0-beta.1.21.70-preview.23",
4
4
  "description": "",
5
5
  "contributors": [
6
6
  {
@@ -14,7 +14,7 @@
14
14
  ],
15
15
  "dependencies": {
16
16
  "@minecraft/common": "^1.0.0",
17
- "@minecraft/server": "^2.0.0-beta.1.21.70-preview.21"
17
+ "@minecraft/server": "^2.0.0-beta.1.21.70-preview.23"
18
18
  },
19
19
  "license": "MIT"
20
20
  }