@minecraft/server-editor 0.1.0-beta.1.26.0-preview.29 → 0.1.0-beta.1.26.10-preview.20

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 +140 -17
  2. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -983,6 +983,15 @@ export declare enum ListPaneEntryType {
983
983
  Text = 3,
984
984
  }
985
985
 
986
+ /**
987
+ * Determines theming variation for the list slot
988
+ */
989
+ export declare enum ListPaneSlotVariant {
990
+ Primary = 0,
991
+ Secondary = 1,
992
+ Muted = 2,
993
+ }
994
+
986
995
  /**
987
996
  * Determines how list pane slots will be sorted
988
997
  */
@@ -1562,6 +1571,15 @@ export type ListPaneImageEntryParams = {
1562
1571
  visible?: boolean;
1563
1572
  };
1564
1573
 
1574
+ export declare type ListPaneSlotConfiguration = {
1575
+ height: number;
1576
+ columns?: number;
1577
+ clickable?: boolean;
1578
+ outline?: boolean;
1579
+ variant?: ListPaneSlotVariant;
1580
+ entryLayout: ListPaneSlotLayoutEntry[] | ListPaneSlotLayoutSections;
1581
+ };
1582
+
1565
1583
  /**
1566
1584
  * Properties required to create a slot
1567
1585
  */
@@ -1570,20 +1588,17 @@ export type ListPaneSlotCreationProps = {
1570
1588
  options?: IListPaneSlotOptions;
1571
1589
  };
1572
1590
 
1573
- export declare type ListPaneSlotLayout = {
1574
- height: number;
1575
- columns?: number;
1576
- clickable?: boolean;
1577
- outline?: boolean;
1578
- entryLayout: ListPaneSlotLayoutEntry[];
1579
- };
1580
-
1581
1591
  export declare type ListPaneSlotLayoutEntry = {
1582
1592
  type: ListPaneEntryType;
1583
1593
  size?: number | LayoutSize | LayoutFlex;
1584
1594
  alignment?: LayoutAlignment;
1585
1595
  };
1586
1596
 
1597
+ export declare type ListPaneSlotLayoutSections = {
1598
+ mainSection: ListPaneSlotLayoutEntry[];
1599
+ outerSection: ListPaneSlotLayoutEntry[];
1600
+ };
1601
+
1587
1602
  /**
1588
1603
  * List Pane Text entry creation parameter
1589
1604
  */
@@ -2136,11 +2151,53 @@ export declare abstract class BrushShape {
2136
2151
  */
2137
2152
  constructor(_id: string, _displayName: string, _icon: string);
2138
2153
  abstract applySetting(brushSettings: BrushShapeSettings): void;
2154
+ /**
2155
+ * @remarks
2156
+ * Calculates the bounding box of the shape in local
2157
+ * coordinates. Used for region allocation before shape
2158
+ * placement.
2159
+ *
2160
+ * @returns
2161
+ * Object with min and max Vector3 bounds
2162
+ */
2163
+ abstract calculateBounds(): minecraftserver.BlockBoundingBox;
2139
2164
  abstract createSettingsPane(
2140
2165
  parentPane: IPropertyPane,
2141
2166
  onSettingsChange?: () => void,
2142
2167
  ): ISubPanePropertyItem | undefined;
2143
2168
  abstract createShape(): RelativeVolumeListBlockVolume;
2169
+ /**
2170
+ * @remarks
2171
+ * Asynchronously creates the shape, yielding control
2172
+ * periodically to avoid timeouts. Use this for large shapes
2173
+ * where createShape() may timeout.
2174
+ *
2175
+ * @param cancelToken
2176
+ * Optional token to cancel the operation. Set cancelled to
2177
+ * true to abort.
2178
+ * @param yieldInterval
2179
+ * Number of blocks to process before yielding. Default is
2180
+ * 10000.
2181
+ * @returns
2182
+ * Promise that resolves to the shape positions as Vector3
2183
+ * array.
2184
+ */
2185
+ abstract createShapeAsync(
2186
+ cancelToken?: {
2187
+ cancelled: boolean;
2188
+ },
2189
+ yieldInterval?: number,
2190
+ ): Promise<RelativeVolumeListBlockVolume>;
2191
+ /**
2192
+ * @remarks
2193
+ * Returns a mathematical estimate of the number of blocks in
2194
+ * the shape. Used for UI display and validation before shape
2195
+ * creation.
2196
+ *
2197
+ * @returns
2198
+ * Estimated block count
2199
+ */
2200
+ abstract estimateBlockCount(): number;
2144
2201
  abstract getSettings(): BrushShapeSettings;
2145
2202
  }
2146
2203
 
@@ -2481,8 +2538,16 @@ export declare class ConeBrushShape extends BrushShape {
2481
2538
  zRotation?: number;
2482
2539
  });
2483
2540
  applySetting(brushSettings: ConeBrushShapeSettings): void;
2541
+ calculateBounds(): minecraftserver.BlockBoundingBox;
2484
2542
  createSettingsPane(parentPane: IPropertyPane, onSettingsChange?: () => void): ISubPanePropertyItem;
2485
2543
  createShape(): RelativeVolumeListBlockVolume;
2544
+ createShapeAsync(
2545
+ cancelToken?: {
2546
+ cancelled: boolean;
2547
+ },
2548
+ yieldInterval?: number,
2549
+ ): Promise<RelativeVolumeListBlockVolume>;
2550
+ estimateBlockCount(): number;
2486
2551
  getSettings(): ConeBrushShapeSettings;
2487
2552
  }
2488
2553
 
@@ -2505,8 +2570,16 @@ export declare class CuboidBrushShape extends BrushShape {
2505
2570
  zRotation?: number;
2506
2571
  });
2507
2572
  applySetting(brushSettings: CuboidBrushShapeSettings): void;
2573
+ calculateBounds(): minecraftserver.BlockBoundingBox;
2508
2574
  createSettingsPane(parentPane: IPropertyPane, onSettingsChange?: () => void): ISubPanePropertyItem;
2509
2575
  createShape(): RelativeVolumeListBlockVolume;
2576
+ createShapeAsync(
2577
+ cancelToken?: {
2578
+ cancelled: boolean;
2579
+ },
2580
+ yieldInterval?: number,
2581
+ ): Promise<RelativeVolumeListBlockVolume>;
2582
+ estimateBlockCount(): number;
2510
2583
  getSettings(): CuboidBrushShapeSettings;
2511
2584
  }
2512
2585
 
@@ -2779,8 +2852,16 @@ export declare class CylinderBrushShape extends BrushShape {
2779
2852
  hideRotation?: boolean;
2780
2853
  });
2781
2854
  applySetting(brushSettings: CylinderBrushShapeSettings): void;
2855
+ calculateBounds(): minecraftserver.BlockBoundingBox;
2782
2856
  createSettingsPane(parentPane: IPropertyPane, onSettingsChange?: () => void): ISubPanePropertyItem;
2783
2857
  createShape(): RelativeVolumeListBlockVolume;
2858
+ createShapeAsync(
2859
+ cancelToken?: {
2860
+ cancelled: boolean;
2861
+ },
2862
+ yieldInterval?: number,
2863
+ ): Promise<RelativeVolumeListBlockVolume>;
2864
+ estimateBlockCount(): number;
2784
2865
  getSettings(): CylinderBrushShapeSettings;
2785
2866
  }
2786
2867
 
@@ -2972,8 +3053,16 @@ export declare class EllipsoidBrushShape extends BrushShape {
2972
3053
  zRotation?: number;
2973
3054
  });
2974
3055
  applySetting(brushSettings: EllipsoidBrushShapeSettings): void;
3056
+ calculateBounds(): minecraftserver.BlockBoundingBox;
2975
3057
  createSettingsPane(parentPane: IPropertyPane, onSettingsChange?: () => void): ISubPanePropertyItem;
2976
3058
  createShape(): RelativeVolumeListBlockVolume;
3059
+ createShapeAsync(
3060
+ cancelToken?: {
3061
+ cancelled: boolean;
3062
+ },
3063
+ yieldInterval?: number,
3064
+ ): Promise<RelativeVolumeListBlockVolume>;
3065
+ estimateBlockCount(): number;
2977
3066
  getSettings(): EllipsoidBrushShapeSettings;
2978
3067
  }
2979
3068
 
@@ -3625,6 +3714,8 @@ export class ProbabilityBlockPaletteItem extends IBlockPaletteItem {
3625
3714
  * @remarks
3626
3715
  * This function can't be called in restricted-execution mode.
3627
3716
  *
3717
+ * @param weight
3718
+ * Bounds: [1, 100]
3628
3719
  * @throws This function can throw errors.
3629
3720
  */
3630
3721
  addBlock(block: minecraftserver.BlockPermutation | minecraftserver.BlockType | string, weight: number): void;
@@ -3665,8 +3756,16 @@ export declare class PyramidBrushShape extends BrushShape {
3665
3756
  zRotation?: number;
3666
3757
  });
3667
3758
  applySetting(brushSettings: PyramidBrushShapeSettings): void;
3759
+ calculateBounds(): minecraftserver.BlockBoundingBox;
3668
3760
  createSettingsPane(parentPane: IPropertyPane, onSettingsChange?: () => void): ISubPanePropertyItem;
3669
3761
  createShape(): RelativeVolumeListBlockVolume;
3762
+ createShapeAsync(
3763
+ cancelToken?: {
3764
+ cancelled: boolean;
3765
+ },
3766
+ yieldInterval?: number,
3767
+ ): Promise<RelativeVolumeListBlockVolume>;
3768
+ estimateBlockCount(): number;
3670
3769
  getSettings(): PyramidBrushShapeSettings;
3671
3770
  }
3672
3771
 
@@ -3975,8 +4074,16 @@ export declare class SingleBlockBrushShape extends BrushShape {
3975
4074
  */
3976
4075
  constructor();
3977
4076
  applySetting(_settings: BrushShapeSettings): void;
4077
+ calculateBounds(): minecraftserver.BlockBoundingBox;
3978
4078
  createSettingsPane(): undefined;
3979
4079
  createShape(): RelativeVolumeListBlockVolume;
4080
+ createShapeAsync(
4081
+ _cancelToken?: {
4082
+ cancelled: boolean;
4083
+ },
4084
+ _yieldInterval?: number,
4085
+ ): Promise<RelativeVolumeListBlockVolume>;
4086
+ estimateBlockCount(): number;
3980
4087
  getSettings(): BrushShapeSettings;
3981
4088
  }
3982
4089
 
@@ -5568,6 +5675,7 @@ export interface GameOptions {
5568
5675
  immediateRespawn?: boolean;
5569
5676
  insomnia?: boolean;
5570
5677
  keepInventory?: boolean;
5678
+ keepPlayerData?: boolean;
5571
5679
  lanVisibility?: boolean;
5572
5680
  limitedCrafting?: boolean;
5573
5681
  locatorBar?: boolean;
@@ -6959,7 +7067,8 @@ export interface IListPanePropertyItem extends IPropertyItemBase, IPane {
6959
7067
  export interface IListPanePropertyItemOptions extends IPropertyItemOptionsBase {
6960
7068
  /**
6961
7069
  * @remarks
6962
- * This will be the height of the list withing the pane
7070
+ * Default slots to initialize the list with. If undefined, the
7071
+ * list will be empty.
6963
7072
  *
6964
7073
  */
6965
7074
  defaultSlots?: ListPaneSlotCreationProps[];
@@ -6972,17 +7081,10 @@ export interface IListPanePropertyItemOptions extends IPropertyItemOptionsBase {
6972
7081
  fixedHeight?: boolean;
6973
7082
  /**
6974
7083
  * @remarks
6975
- * This will be the height of the list withing the pane
7084
+ * This will be the height of the list within the pane
6976
7085
  *
6977
7086
  */
6978
7087
  height?: number;
6979
- /**
6980
- * @remarks
6981
- * Layout for the list will need to be predefined, and using
6982
- * wrong layout shape while creating slots will throw
6983
- *
6984
- */
6985
- layout: ListPaneSlotLayout;
6986
7088
  /**
6987
7089
  * @remarks
6988
7090
  * This callback is fired whenever a clickable slot is pressed
@@ -6996,6 +7098,14 @@ export interface IListPanePropertyItemOptions extends IPropertyItemOptionsBase {
6996
7098
  *
6997
7099
  */
6998
7100
  onSlotSelectionChange?: (slot: IListPaneSlot, state: boolean) => void;
7101
+ /**
7102
+ * @remarks
7103
+ * Slot configuration for the list. The slot entry layout must
7104
+ * be predefined, and using an incorrect layout while creating
7105
+ * slots will throw an error.
7106
+ *
7107
+ */
7108
+ slotConfig: ListPaneSlotConfiguration;
6999
7109
  /**
7000
7110
  * @remarks
7001
7111
  * Localized title of the property item.
@@ -8855,6 +8965,13 @@ export interface IStringPropertyItem extends IPropertyItemBase {
8855
8965
  */
8856
8966
  // @ts-ignore Class inheritance allowed for native defined classes
8857
8967
  export interface IStringPropertyItemOptions extends IPropertyItemOptionsBase {
8968
+ /**
8969
+ * @remarks
8970
+ * Shows clear button for the item. If undefined, it will be
8971
+ * true.
8972
+ *
8973
+ */
8974
+ hasClearButton?: boolean;
8858
8975
  /**
8859
8976
  * @remarks
8860
8977
  * If true label text will be hidden. If undefined, the label
@@ -8868,6 +8985,12 @@ export interface IStringPropertyItemOptions extends IPropertyItemOptionsBase {
8868
8985
  *
8869
8986
  */
8870
8987
  inlineLabel?: boolean;
8988
+ /**
8989
+ * @remarks
8990
+ * If defined, string will be handled as multiline input.
8991
+ *
8992
+ */
8993
+ multilineHeight?: number;
8871
8994
  /**
8872
8995
  * @remarks
8873
8996
  * This callback is called when UI control value is changed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-editor",
3
- "version": "0.1.0-beta.1.26.0-preview.29",
3
+ "version": "0.1.0-beta.1.26.10-preview.20",
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.6.0-beta.1.26.0-preview.29",
18
- "@minecraft/vanilla-data": ">=1.20.70 || 1.26.0-preview.29"
17
+ "@minecraft/server": "^2.7.0-beta.1.26.10-preview.20",
18
+ "@minecraft/vanilla-data": ">=1.20.70 || 1.26.10-preview.20"
19
19
  },
20
20
  "license": "MIT"
21
21
  }