@minecraft/server-editor 0.1.0-beta.1.21.60-preview.24 → 0.1.0-beta.1.21.60-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 +188 -28
  2. package/package.json +2 -2
package/index.d.ts CHANGED
@@ -27,8 +27,10 @@ import * as minecraftserver from '@minecraft/server';
27
27
  * onExecute handler of an action.
28
28
  */
29
29
  export declare enum ActionTypes {
30
+ ContinuousAction = 'ContinuousAction',
30
31
  MouseRayCastAction = 'MouseRayCastAction',
31
32
  NoArgsAction = 'NoArgsAction',
33
+ StatefulAction = 'StatefulAction',
32
34
  }
33
35
 
34
36
  export enum Axis {
@@ -48,6 +50,15 @@ export enum BlockPaletteItemType {
48
50
  Probability = 1,
49
51
  }
50
52
 
53
+ /**
54
+ * The possible operation types supported by BlockTable
55
+ * property item.
56
+ */
57
+ export declare enum BlockTableOperationType {
58
+ Deselect = 'deselect',
59
+ Replace = 'replace',
60
+ }
61
+
51
62
  /**
52
63
  * The possible variants of a bool.
53
64
  */
@@ -84,11 +95,24 @@ export declare enum ComboBoxPropertyItemDataType {
84
95
  Entity = 2,
85
96
  }
86
97
 
98
+ /**
99
+ * Execution state of the continuous action
100
+ */
101
+ export declare enum ContinuousActionState {
102
+ Begin = 0,
103
+ Repeat = 1,
104
+ End = 2,
105
+ }
106
+
87
107
  /**
88
108
  * Predefined action bar items
89
109
  */
90
110
  export declare enum CoreActionBarItemType {
111
+ Export = 'editor:actionBarItem:export',
112
+ Locate = 'editor:actionBarItem:locate',
113
+ Playtest = 'editor:actionBarItem:playtest',
91
114
  Redo = 'editor:actionBarItem:redo',
115
+ Settings = 'editor:actionBarItem:settings',
92
116
  Undo = 'editor:actionBarItem:undo',
93
117
  }
94
118
 
@@ -234,6 +258,7 @@ export enum GamePublishSetting {
234
258
  * properties.
235
259
  */
236
260
  export enum GraphicsSettingsProperty {
261
+ NightVision = 'NightVision',
237
262
  ShowChunkBoundaries = 'ShowChunkBoundaries',
238
263
  ShowCompass = 'ShowCompass',
239
264
  /**
@@ -958,6 +983,7 @@ export enum ProjectExportType {
958
983
  */
959
984
  export declare enum PropertyItemType {
960
985
  BlockList = 'editorUI:BlockList',
986
+ BlockTable = 'editorUI:BlockTable',
961
987
  Boolean = 'editorUI:Boolean',
962
988
  Button = 'editorUI:Button',
963
989
  ColorPicker = 'editorUI:ColorPicker',
@@ -1091,7 +1117,7 @@ export enum WidgetMouseButtonActionType {
1091
1117
  /**
1092
1118
  * Full set of all possible raw actions
1093
1119
  */
1094
- export type Action = NoArgsAction | MouseRayCastAction;
1120
+ export type Action = NoArgsAction | MouseRayCastAction | StatefulAction | ContinuousAction;
1095
1121
 
1096
1122
  /**
1097
1123
  * All actions have a unique identifier. Identifiers are
@@ -1111,6 +1137,16 @@ export type ActivationFunctionType<PerPlayerStorageType> = (
1111
1137
  uiSession: IPlayerUISession<PerPlayerStorageType>,
1112
1138
  ) => IDisposable[];
1113
1139
 
1140
+ /**
1141
+ * An action that continues to execute after activation
1142
+ */
1143
+ export type ContinuousAction = {
1144
+ readonly actionType: ActionTypes.ContinuousAction;
1145
+ readonly onExecute: (state: ContinuousActionState, repeatCount: number) => void;
1146
+ repeatDelay?: number;
1147
+ repeatInterval?: number;
1148
+ };
1149
+
1114
1150
  /**
1115
1151
  * A generic handler for an event sink.
1116
1152
  */
@@ -1123,6 +1159,7 @@ export type GraphicsSettingsPropertyTypeMap = {
1123
1159
  [GraphicsSettingsProperty.ShowInvisibleBlocks]?: boolean;
1124
1160
  [GraphicsSettingsProperty.ShowChunkBoundaries]?: boolean;
1125
1161
  [GraphicsSettingsProperty.ShowCompass]?: boolean;
1162
+ [GraphicsSettingsProperty.NightVision]?: boolean;
1126
1163
  };
1127
1164
 
1128
1165
  /**
@@ -1265,7 +1302,7 @@ export declare type MouseProps = {
1265
1302
  * from the users mouse click in the viewport.
1266
1303
  */
1267
1304
  export type MouseRayCastAction = {
1268
- actionType: ActionTypes.MouseRayCastAction;
1305
+ readonly actionType: ActionTypes.MouseRayCastAction;
1269
1306
  readonly onExecute: (mouseRay: Ray, mouseProps: MouseProps) => void;
1270
1307
  };
1271
1308
 
@@ -1274,7 +1311,7 @@ export type MouseRayCastAction = {
1274
1311
  * execute
1275
1312
  */
1276
1313
  export type NoArgsAction = {
1277
- actionType: ActionTypes.NoArgsAction;
1314
+ readonly actionType: ActionTypes.NoArgsAction;
1278
1315
  readonly onExecute: () => void;
1279
1316
  };
1280
1317
 
@@ -1330,10 +1367,21 @@ export type SpeedSettingsPropertyTypeMap = {
1330
1367
  [SpeedSettingsProperty.FlySpeedMultiplier]?: number;
1331
1368
  };
1332
1369
 
1370
+ /**
1371
+ * An action which returns the activation state.
1372
+ */
1373
+ export type StatefulAction = {
1374
+ readonly actionType: ActionTypes.StatefulAction;
1375
+ readonly onExecute: (active: boolean) => void;
1376
+ };
1377
+
1333
1378
  /**
1334
1379
  * Full set of all possible keyboard actions
1335
1380
  */
1336
- export type SupportedKeyboardActionTypes = RegisteredAction<NoArgsAction>;
1381
+ export type SupportedKeyboardActionTypes =
1382
+ | RegisteredAction<NoArgsAction>
1383
+ | RegisteredAction<StatefulAction>
1384
+ | RegisteredAction<ContinuousAction>;
1337
1385
 
1338
1386
  /**
1339
1387
  * Full set of all possible mouse actions
@@ -1542,7 +1590,7 @@ export class BrushShapeManager {
1542
1590
  *
1543
1591
  * {@link Error}
1544
1592
  */
1545
- beginPainting(onComplete: (arg: PaintCompletionState) => void): void;
1593
+ beginPainting(onComplete: (arg0: PaintCompletionState) => void): void;
1546
1594
  /**
1547
1595
  * @remarks
1548
1596
  * This function can't be called in read-only mode.
@@ -1640,7 +1688,7 @@ export class BrushShapeManager {
1640
1688
  *
1641
1689
  * {@link Error}
1642
1690
  */
1643
- singlePaint(onComplete: (arg: PaintCompletionState) => void): void;
1691
+ singlePaint(onComplete: (arg0: PaintCompletionState) => void): void;
1644
1692
  /**
1645
1693
  * @remarks
1646
1694
  * This function can't be called in read-only mode.
@@ -1682,7 +1730,7 @@ export class ClipboardChangeAfterEventSignal {
1682
1730
  * This function can be called in early-execution mode.
1683
1731
  *
1684
1732
  */
1685
- subscribe(callback: (arg: ClipboardChangeAfterEvent) => void): (arg: ClipboardChangeAfterEvent) => void;
1733
+ subscribe(callback: (arg0: ClipboardChangeAfterEvent) => void): (arg0: ClipboardChangeAfterEvent) => void;
1686
1734
  /**
1687
1735
  * @remarks
1688
1736
  * This function can't be called in read-only mode.
@@ -1690,7 +1738,7 @@ export class ClipboardChangeAfterEventSignal {
1690
1738
  * This function can be called in early-execution mode.
1691
1739
  *
1692
1740
  */
1693
- unsubscribe(callback: (arg: ClipboardChangeAfterEvent) => void): void;
1741
+ unsubscribe(callback: (arg0: ClipboardChangeAfterEvent) => void): void;
1694
1742
  }
1695
1743
 
1696
1744
  /**
@@ -1885,7 +1933,7 @@ export class CurrentThemeChangeAfterEventSignal {
1885
1933
  * This function can be called in early-execution mode.
1886
1934
  *
1887
1935
  */
1888
- subscribe(callback: (arg: CurrentThemeChangeAfterEvent) => void): (arg: CurrentThemeChangeAfterEvent) => void;
1936
+ subscribe(callback: (arg0: CurrentThemeChangeAfterEvent) => void): (arg0: CurrentThemeChangeAfterEvent) => void;
1889
1937
  /**
1890
1938
  * @remarks
1891
1939
  * This function can't be called in read-only mode.
@@ -1893,7 +1941,7 @@ export class CurrentThemeChangeAfterEventSignal {
1893
1941
  * This function can be called in early-execution mode.
1894
1942
  *
1895
1943
  */
1896
- unsubscribe(callback: (arg: CurrentThemeChangeAfterEvent) => void): void;
1944
+ unsubscribe(callback: (arg0: CurrentThemeChangeAfterEvent) => void): void;
1897
1945
  }
1898
1946
 
1899
1947
  export class CurrentThemeColorChangeAfterEvent {
@@ -1912,8 +1960,8 @@ export class CurrentThemeColorChangeAfterEventSignal {
1912
1960
  *
1913
1961
  */
1914
1962
  subscribe(
1915
- callback: (arg: CurrentThemeColorChangeAfterEvent) => void,
1916
- ): (arg: CurrentThemeColorChangeAfterEvent) => void;
1963
+ callback: (arg0: CurrentThemeColorChangeAfterEvent) => void,
1964
+ ): (arg0: CurrentThemeColorChangeAfterEvent) => void;
1917
1965
  /**
1918
1966
  * @remarks
1919
1967
  * This function can't be called in read-only mode.
@@ -1921,7 +1969,7 @@ export class CurrentThemeColorChangeAfterEventSignal {
1921
1969
  * This function can be called in early-execution mode.
1922
1970
  *
1923
1971
  */
1924
- unsubscribe(callback: (arg: CurrentThemeColorChangeAfterEvent) => void): void;
1972
+ unsubscribe(callback: (arg0: CurrentThemeColorChangeAfterEvent) => void): void;
1925
1973
  }
1926
1974
 
1927
1975
  /**
@@ -2058,6 +2106,7 @@ export class Cursor {
2058
2106
 
2059
2107
  export class CursorPropertiesChangeAfterEvent {
2060
2108
  private constructor();
2109
+ readonly position?: CursorPosition;
2061
2110
  readonly properties: CursorProperties;
2062
2111
  }
2063
2112
 
@@ -2071,8 +2120,8 @@ export class CursorPropertyChangeAfterEventSignal {
2071
2120
  *
2072
2121
  */
2073
2122
  subscribe(
2074
- callback: (arg: CursorPropertiesChangeAfterEvent) => void,
2075
- ): (arg: CursorPropertiesChangeAfterEvent) => void;
2123
+ callback: (arg0: CursorPropertiesChangeAfterEvent) => void,
2124
+ ): (arg0: CursorPropertiesChangeAfterEvent) => void;
2076
2125
  /**
2077
2126
  * @remarks
2078
2127
  * This function can't be called in read-only mode.
@@ -2080,7 +2129,7 @@ export class CursorPropertyChangeAfterEventSignal {
2080
2129
  * This function can be called in early-execution mode.
2081
2130
  *
2082
2131
  */
2083
- unsubscribe(callback: (arg: CursorPropertiesChangeAfterEvent) => void): void;
2132
+ unsubscribe(callback: (arg0: CursorPropertiesChangeAfterEvent) => void): void;
2084
2133
  }
2085
2134
 
2086
2135
  export class EditorStructureManager {
@@ -2518,7 +2567,7 @@ export class ModeChangeAfterEventSignal {
2518
2567
  * This function can be called in early-execution mode.
2519
2568
  *
2520
2569
  */
2521
- subscribe(callback: (arg: ModeChangeAfterEvent) => void): (arg: ModeChangeAfterEvent) => void;
2570
+ subscribe(callback: (arg0: ModeChangeAfterEvent) => void): (arg0: ModeChangeAfterEvent) => void;
2522
2571
  /**
2523
2572
  * @remarks
2524
2573
  * Removes the specified callback from an editor mode change
@@ -2529,7 +2578,7 @@ export class ModeChangeAfterEventSignal {
2529
2578
  * This function can be called in early-execution mode.
2530
2579
  *
2531
2580
  */
2532
- unsubscribe(callback: (arg: ModeChangeAfterEvent) => void): void;
2581
+ unsubscribe(callback: (arg0: ModeChangeAfterEvent) => void): void;
2533
2582
  }
2534
2583
 
2535
2584
  /**
@@ -2600,7 +2649,7 @@ export class PrimarySelectionChangeAfterEventSignal {
2600
2649
  * This function can be called in early-execution mode.
2601
2650
  *
2602
2651
  */
2603
- subscribe(callback: (arg: SelectionEventAfterEvent) => void): (arg: SelectionEventAfterEvent) => void;
2652
+ subscribe(callback: (arg0: SelectionEventAfterEvent) => void): (arg0: SelectionEventAfterEvent) => void;
2604
2653
  /**
2605
2654
  * @remarks
2606
2655
  * This function can't be called in read-only mode.
@@ -2608,7 +2657,7 @@ export class PrimarySelectionChangeAfterEventSignal {
2608
2657
  * This function can be called in early-execution mode.
2609
2658
  *
2610
2659
  */
2611
- unsubscribe(callback: (arg: SelectionEventAfterEvent) => void): void;
2660
+ unsubscribe(callback: (arg0: SelectionEventAfterEvent) => void): void;
2612
2661
  }
2613
2662
 
2614
2663
  export class PrimarySelectionChangedEvent {
@@ -2909,12 +2958,12 @@ export class SettingsManager {
2909
2958
  export class SettingsUIElement {
2910
2959
  readonly initialValue: boolean | number | string | minecraftserver.Vector3;
2911
2960
  readonly name: string;
2912
- readonly onChange: (arg: boolean | number | string | minecraftserver.Vector3) => void;
2961
+ readonly onChange: (arg0: boolean | number | string | minecraftserver.Vector3) => void;
2913
2962
  readonly options: SettingsUIElementOptions;
2914
2963
  constructor(
2915
2964
  name: string,
2916
2965
  initialValue: boolean | number | string | minecraftserver.Vector3,
2917
- onChange: (arg: boolean | number | string | minecraftserver.Vector3) => void,
2966
+ onChange: (arg0: boolean | number | string | minecraftserver.Vector3) => void,
2918
2967
  options?: SettingsUIElementOptions,
2919
2968
  );
2920
2969
  }
@@ -3135,8 +3184,8 @@ export class TransactionManager {
3135
3184
  * @throws This function can throw errors.
3136
3185
  */
3137
3186
  createUserDefinedTransactionHandler(
3138
- undoClosure: (arg: string) => void,
3139
- redoClosure: (arg: string) => void,
3187
+ undoClosure: (arg0: string) => void,
3188
+ redoClosure: (arg0: string) => void,
3140
3189
  ): UserDefinedTransactionHandlerId;
3141
3190
  /**
3142
3191
  * @remarks
@@ -3576,7 +3625,7 @@ export class Widget {
3576
3625
  *
3577
3626
  * {@link InvalidWidgetError}
3578
3627
  */
3579
- setStateChangeEvent(eventFunction?: (arg: WidgetStateChangeEventData) => void): void;
3628
+ setStateChangeEvent(eventFunction?: (arg0: WidgetStateChangeEventData) => void): void;
3580
3629
  }
3581
3630
 
3582
3631
  export class WidgetComponentBase {
@@ -3636,7 +3685,7 @@ export class WidgetComponentBase {
3636
3685
  *
3637
3686
  * {@link InvalidWidgetComponentError}
3638
3687
  */
3639
- setStateChangeEvent(eventFunction?: (arg: WidgetComponentStateChangeEventData) => void): void;
3688
+ setStateChangeEvent(eventFunction?: (arg0: WidgetComponentStateChangeEventData) => void): void;
3640
3689
  }
3641
3690
 
3642
3691
  // @ts-ignore Class inheritance allowed for native defined classes
@@ -4093,6 +4142,11 @@ export interface ClipboardWriteOptions {
4093
4142
  rotation?: minecraftserver.StructureRotation;
4094
4143
  }
4095
4144
 
4145
+ export interface CursorPosition {
4146
+ FaceDirection: number;
4147
+ Position: minecraftserver.Vector3;
4148
+ }
4149
+
4096
4150
  /**
4097
4151
  * The CursorProperties interface is used to describe the
4098
4152
  * properties of the Editor 3D block cursor construct.
@@ -4381,6 +4435,106 @@ export interface IActionBarItemCreationParams {
4381
4435
  tooltipTitle?: string;
4382
4436
  }
4383
4437
 
4438
+ /**
4439
+ * Block Table Entry info for block table property item
4440
+ */
4441
+ export interface IBlockTableEntryInfo {
4442
+ /**
4443
+ * @remarks
4444
+ * The quantity number of the same block in the selection.
4445
+ *
4446
+ */
4447
+ count?: number;
4448
+ }
4449
+
4450
+ /**
4451
+ * A property item which supports Block Table properties
4452
+ */
4453
+ // @ts-ignore Class inheritance allowed for native defined classes
4454
+ export interface IBlockTablePropertyItem extends IPropertyItemBase {
4455
+ /**
4456
+ * @remarks
4457
+ * Create new or update an existing entry in the block table
4458
+ *
4459
+ * @param block
4460
+ * a new entry in the block table.
4461
+ * @param blockInfo
4462
+ * block info for the entry in the block table.
4463
+ */
4464
+ addOrUpdateEntry(block: string | minecraftserver.BlockType, blockInfo: IBlockTableEntryInfo): void;
4465
+ /**
4466
+ * @remarks
4467
+ * Delete entry in the block table, by block name
4468
+ *
4469
+ * @param block
4470
+ * an entry in the block table.
4471
+ */
4472
+ deleteEntry(block: string): void;
4473
+ /**
4474
+ * @remarks
4475
+ * Read entry from the block table, by block name
4476
+ *
4477
+ * @param block
4478
+ * an entry in the block table.
4479
+ */
4480
+ getEntry(block: string | minecraftserver.BlockType): IBlockTableEntryInfo | undefined;
4481
+ /**
4482
+ * @remarks
4483
+ * Updates title of the property item.
4484
+ *
4485
+ * @param title
4486
+ * New title.
4487
+ */
4488
+ setTitle(title: LocalizedString): void;
4489
+ /**
4490
+ * @remarks
4491
+ * Update the block table entries
4492
+ *
4493
+ * @param entries
4494
+ * The new value for the block table.
4495
+ */
4496
+ updateEntries(entries: Map<string, IBlockTableEntryInfo>): void;
4497
+ }
4498
+
4499
+ /**
4500
+ * Properties of block table item
4501
+ */
4502
+ // @ts-ignore Class inheritance allowed for native defined classes
4503
+ export interface IBlockTablePropertyItemOptions extends IPropertyItemOptionsBase {
4504
+ /**
4505
+ * @remarks
4506
+ * Map of block entries in the block table.
4507
+ *
4508
+ */
4509
+ entries?: Map<string, IBlockTableEntryInfo>;
4510
+ /**
4511
+ * @remarks
4512
+ * If true label text will be hidden. It will be visible by
4513
+ * default.
4514
+ *
4515
+ */
4516
+ hiddenLabel?: boolean;
4517
+ /**
4518
+ * @remarks
4519
+ * This callback is called when UI control operation is
4520
+ * selected from the UI.
4521
+ *
4522
+ */
4523
+ onOperationClick?: (block: string, operation: BlockTableOperationType) => void;
4524
+ /**
4525
+ * @remarks
4526
+ * Localized title of the property item.
4527
+ *
4528
+ */
4529
+ title?: LocalizedString;
4530
+ /**
4531
+ * @remarks
4532
+ * Tooltip description of the property item.
4533
+ *
4534
+ */
4535
+ tooltip?: LocalizedString;
4536
+ }
4537
+
4384
4538
  /**
4385
4539
  * A property item which supports Vector3 properties
4386
4540
  */
@@ -5490,6 +5644,12 @@ export interface IPropertyPane {
5490
5644
  },
5491
5645
  'EMPTY'
5492
5646
  >;
5647
+ /**
5648
+ * @remarks
5649
+ * Adds a block table to the pane.
5650
+ *
5651
+ */
5652
+ addBlockTable(options?: IBlockTablePropertyItemOptions): IBlockTablePropertyItem;
5493
5653
  /**
5494
5654
  * @remarks
5495
5655
  */
@@ -6860,7 +7020,7 @@ export interface WeightedBlock {
6860
7020
  export interface WidgetComponentBaseOptions {
6861
7021
  lockToSurface?: boolean;
6862
7022
  offset?: minecraftserver.Vector3;
6863
- stateChangeEvent?: (arg: WidgetComponentStateChangeEventData) => void;
7023
+ stateChangeEvent?: (arg0: WidgetComponentStateChangeEventData) => void;
6864
7024
  visible?: boolean;
6865
7025
  }
6866
7026
 
@@ -6912,7 +7072,7 @@ export interface WidgetCreateOptions {
6912
7072
  lockToSurface?: boolean;
6913
7073
  selectable?: boolean;
6914
7074
  snapToBlockLocation?: boolean;
6915
- stateChangeEvent?: (arg: WidgetStateChangeEventData) => void;
7075
+ stateChangeEvent?: (arg0: WidgetStateChangeEventData) => void;
6916
7076
  visible?: boolean;
6917
7077
  }
6918
7078
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-editor",
3
- "version": "0.1.0-beta.1.21.60-preview.24",
3
+ "version": "0.1.0-beta.1.21.60-preview.27",
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": "^1.18.0-beta.1.21.60-preview.24"
17
+ "@minecraft/server": "^1.18.0-beta.1.21.60-preview.27"
18
18
  },
19
19
  "license": "MIT"
20
20
  }