@minecraft/server-editor 0.1.0-beta.1.21.10-preview.20 → 0.1.0-beta.1.21.10-preview.22
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.
- package/index.d.ts +178 -2
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* ```json
|
|
15
15
|
* {
|
|
16
16
|
* "module_name": "@minecraft/server-editor",
|
|
17
|
-
* "version": "0.1.0-beta.1.21.10-preview.
|
|
17
|
+
* "version": "0.1.0-beta.1.21.10-preview.22"
|
|
18
18
|
* }
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
@@ -36,6 +36,19 @@ export enum BlockPaletteItemType {
|
|
|
36
36
|
Probability = 1,
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
export enum BrushPipelineOperationType {
|
|
40
|
+
Include = 0,
|
|
41
|
+
Exclude = 1,
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Predefined action bar items
|
|
46
|
+
*/
|
|
47
|
+
export declare enum CoreActionBarItemType {
|
|
48
|
+
Redo = 'editor:actionBarItem:redo',
|
|
49
|
+
Undo = 'editor:actionBarItem:undo',
|
|
50
|
+
}
|
|
51
|
+
|
|
39
52
|
/**
|
|
40
53
|
* Predefined top level menus for core editor
|
|
41
54
|
*/
|
|
@@ -122,6 +135,7 @@ export declare enum EDITOR_PANE_PROPERTY_ITEM_TYPE {
|
|
|
122
135
|
Action = 'editorUI:Action',
|
|
123
136
|
BlockPicker = 'editorUI:BlockPicker',
|
|
124
137
|
Boolean = 'editorUI:Boolean',
|
|
138
|
+
ColorPicker = 'editorUI:ColorPicker',
|
|
125
139
|
Divider = 'editorUI:Divider',
|
|
126
140
|
Dropdown = 'editorUI:Dropdown',
|
|
127
141
|
Image = 'editorUI:Image',
|
|
@@ -488,6 +502,7 @@ export type IPlayerUISession<PerPlayerStorage = Record<string, never>> = {
|
|
|
488
502
|
readonly actionManager: ActionManager;
|
|
489
503
|
readonly inputManager: IGlobalInputManager;
|
|
490
504
|
readonly menuBar: IMenuContainer;
|
|
505
|
+
readonly actionBar: IActionBar;
|
|
491
506
|
readonly toolRail: IModalToolContainer;
|
|
492
507
|
readonly log: IPlayerLogger;
|
|
493
508
|
readonly extensionContext: ExtensionContext;
|
|
@@ -699,17 +714,52 @@ export class BlockPalette {
|
|
|
699
714
|
|
|
700
715
|
export class BlockPaletteManager {
|
|
701
716
|
private constructor();
|
|
717
|
+
/**
|
|
718
|
+
* @remarks
|
|
719
|
+
* This function can't be called in read-only mode.
|
|
720
|
+
*
|
|
721
|
+
*/
|
|
722
|
+
addOrReplacePalette(paletteId: string, palette: BlockPalette): void;
|
|
723
|
+
getPalette(paletteId: string): BlockPalette | undefined;
|
|
724
|
+
getPaletteIdList(): string[];
|
|
725
|
+
/**
|
|
726
|
+
* @throws This function can throw errors.
|
|
727
|
+
*/
|
|
728
|
+
getPaletteItem(paletteId: string, index: number): IBlockPaletteItem;
|
|
729
|
+
getPrimaryPalette(): BlockPalette;
|
|
702
730
|
/**
|
|
703
731
|
* @throws This function can throw errors.
|
|
704
732
|
*/
|
|
705
733
|
getSelectedBlockType(): minecraftserver.BlockType;
|
|
734
|
+
getSelectedItem(): IBlockPaletteItem;
|
|
735
|
+
/**
|
|
736
|
+
* @remarks
|
|
737
|
+
* This function can't be called in read-only mode.
|
|
738
|
+
*
|
|
739
|
+
* @throws This function can throw errors.
|
|
740
|
+
*/
|
|
741
|
+
removePalette(paletteId: string): void;
|
|
742
|
+
/**
|
|
743
|
+
* @remarks
|
|
744
|
+
* This function can't be called in read-only mode.
|
|
745
|
+
*
|
|
746
|
+
* @throws This function can throw errors.
|
|
747
|
+
*/
|
|
748
|
+
setPaletteItem(paletteId: string, index: number, item: IBlockPaletteItem): void;
|
|
749
|
+
/**
|
|
750
|
+
* @remarks
|
|
751
|
+
* This function can't be called in read-only mode.
|
|
752
|
+
*
|
|
753
|
+
* @throws This function can throw errors.
|
|
754
|
+
*/
|
|
755
|
+
setPrimaryPalette(paletteId: string): void;
|
|
706
756
|
/**
|
|
707
757
|
* @remarks
|
|
708
758
|
* This function can't be called in read-only mode.
|
|
709
759
|
*
|
|
710
760
|
* @throws This function can throw errors.
|
|
711
761
|
*/
|
|
712
|
-
|
|
762
|
+
setSelectedItem(item: IBlockPaletteItem): void;
|
|
713
763
|
}
|
|
714
764
|
|
|
715
765
|
export class BrushShapeManager {
|
|
@@ -724,6 +774,15 @@ export class BrushShapeManager {
|
|
|
724
774
|
* @throws This function can throw errors.
|
|
725
775
|
*/
|
|
726
776
|
activateBrushShape(name: string): minecraftserver.CompoundBlockVolume;
|
|
777
|
+
/**
|
|
778
|
+
* @remarks
|
|
779
|
+
* This function can't be called in read-only mode.
|
|
780
|
+
*
|
|
781
|
+
*/
|
|
782
|
+
getBrushVolume(
|
|
783
|
+
origin: minecraftserver.Vector3,
|
|
784
|
+
pipeline: BrushPipelineOperation[],
|
|
785
|
+
): minecraftserver.CompoundBlockVolume | undefined;
|
|
727
786
|
/**
|
|
728
787
|
* @remarks
|
|
729
788
|
* This function can't be called in read-only mode.
|
|
@@ -2337,6 +2396,11 @@ export class WidgetStateChangeEventData {
|
|
|
2337
2396
|
readonly widget: Widget;
|
|
2338
2397
|
}
|
|
2339
2398
|
|
|
2399
|
+
export interface BrushPipelineOperation {
|
|
2400
|
+
blockTypes: minecraftserver.BlockType[];
|
|
2401
|
+
operation: BrushPipelineOperationType;
|
|
2402
|
+
}
|
|
2403
|
+
|
|
2340
2404
|
export interface BrushShape {
|
|
2341
2405
|
icon: string;
|
|
2342
2406
|
name: string;
|
|
@@ -2666,6 +2730,103 @@ export declare interface EventSink<T> {
|
|
|
2666
2730
|
subscribe(handler: EventHandler<T>): IEventToken;
|
|
2667
2731
|
}
|
|
2668
2732
|
|
|
2733
|
+
/**
|
|
2734
|
+
* Manager for IActionBarItem objects.
|
|
2735
|
+
*/
|
|
2736
|
+
export interface IActionBar {
|
|
2737
|
+
/**
|
|
2738
|
+
* @remarks
|
|
2739
|
+
* Add a new action bar item to the collection.
|
|
2740
|
+
*
|
|
2741
|
+
* @param id
|
|
2742
|
+
* Unique item identifier.
|
|
2743
|
+
* @param action
|
|
2744
|
+
* Action to be invoked.
|
|
2745
|
+
* @param props
|
|
2746
|
+
* Configuration for the item to create.
|
|
2747
|
+
*/
|
|
2748
|
+
registerItem(
|
|
2749
|
+
id: string,
|
|
2750
|
+
action: RegisteredAction<NoArgsAction>,
|
|
2751
|
+
props: IActionBarItemCreationParams,
|
|
2752
|
+
): IActionBarItem;
|
|
2753
|
+
/**
|
|
2754
|
+
* @remarks
|
|
2755
|
+
* Remove an action item from the collection.
|
|
2756
|
+
*
|
|
2757
|
+
* @param id
|
|
2758
|
+
* Unique item identifier.
|
|
2759
|
+
*/
|
|
2760
|
+
unregisterItem(id: string): void;
|
|
2761
|
+
}
|
|
2762
|
+
|
|
2763
|
+
/**
|
|
2764
|
+
* Registered item handle in the Action Bar collection.
|
|
2765
|
+
*/
|
|
2766
|
+
export interface IActionBarItem {
|
|
2767
|
+
/**
|
|
2768
|
+
* @remarks
|
|
2769
|
+
* Returns the current enabled state of the item.
|
|
2770
|
+
*
|
|
2771
|
+
*/
|
|
2772
|
+
getEnabled: () => boolean;
|
|
2773
|
+
/**
|
|
2774
|
+
* @remarks
|
|
2775
|
+
* Unique identifier of the item.
|
|
2776
|
+
*
|
|
2777
|
+
*/
|
|
2778
|
+
readonly id: string;
|
|
2779
|
+
/**
|
|
2780
|
+
* @remarks
|
|
2781
|
+
* Text label of the item.
|
|
2782
|
+
*
|
|
2783
|
+
*/
|
|
2784
|
+
readonly label: string;
|
|
2785
|
+
/**
|
|
2786
|
+
* @remarks
|
|
2787
|
+
* Modify enabled state of the item.
|
|
2788
|
+
*
|
|
2789
|
+
*/
|
|
2790
|
+
setEnabled: (enabled: boolean) => void;
|
|
2791
|
+
}
|
|
2792
|
+
|
|
2793
|
+
/**
|
|
2794
|
+
* Properties required to create an Action Bar item.
|
|
2795
|
+
*/
|
|
2796
|
+
export interface IActionBarItemCreationParams {
|
|
2797
|
+
/**
|
|
2798
|
+
* @remarks
|
|
2799
|
+
* Initial enabled state of the item. If not defined, default
|
|
2800
|
+
* is true.
|
|
2801
|
+
*
|
|
2802
|
+
*/
|
|
2803
|
+
enabled?: boolean;
|
|
2804
|
+
/**
|
|
2805
|
+
* @remarks
|
|
2806
|
+
* Icon resource for the item.
|
|
2807
|
+
*
|
|
2808
|
+
*/
|
|
2809
|
+
icon: string;
|
|
2810
|
+
/**
|
|
2811
|
+
* @remarks
|
|
2812
|
+
* Text label for item.
|
|
2813
|
+
*
|
|
2814
|
+
*/
|
|
2815
|
+
label: string;
|
|
2816
|
+
/**
|
|
2817
|
+
* @remarks
|
|
2818
|
+
* Tooltip description for the item.
|
|
2819
|
+
*
|
|
2820
|
+
*/
|
|
2821
|
+
tooltipDescription?: string;
|
|
2822
|
+
/**
|
|
2823
|
+
* @remarks
|
|
2824
|
+
* Tooltip title for the item.
|
|
2825
|
+
*
|
|
2826
|
+
*/
|
|
2827
|
+
tooltipTitle?: string;
|
|
2828
|
+
}
|
|
2829
|
+
|
|
2669
2830
|
/**
|
|
2670
2831
|
* Simple abstraction for disposable objects.
|
|
2671
2832
|
*/
|
|
@@ -3016,6 +3177,11 @@ export interface IPropertyItemOptionsButton extends IPropertyItemOptions {
|
|
|
3016
3177
|
variant?: ButtonVariant;
|
|
3017
3178
|
}
|
|
3018
3179
|
|
|
3180
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
3181
|
+
export interface IPropertyItemOptionsColorPicker extends IPropertyItemOptions {
|
|
3182
|
+
showAlpha?: boolean;
|
|
3183
|
+
}
|
|
3184
|
+
|
|
3019
3185
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
3020
3186
|
export interface IPropertyItemOptionsDataPicker extends IPropertyItemOptions {
|
|
3021
3187
|
/**
|
|
@@ -3225,6 +3391,16 @@ export interface IPropertyPane {
|
|
|
3225
3391
|
},
|
|
3226
3392
|
'EMPTY'
|
|
3227
3393
|
>;
|
|
3394
|
+
/**
|
|
3395
|
+
* @remarks
|
|
3396
|
+
* Adds a color picker item to the pane.
|
|
3397
|
+
*
|
|
3398
|
+
*/
|
|
3399
|
+
addColorPicker<T extends PropertyBag, Prop extends keyof T & string>(
|
|
3400
|
+
obj: T,
|
|
3401
|
+
property: Prop,
|
|
3402
|
+
options?: IPropertyItemOptionsColorPicker,
|
|
3403
|
+
): IPropertyItem<T, Prop>;
|
|
3228
3404
|
/**
|
|
3229
3405
|
* @remarks
|
|
3230
3406
|
* Adds an divider item to the pane.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minecraft/server-editor",
|
|
3
|
-
"version": "0.1.0-beta.1.21.10-preview.
|
|
3
|
+
"version": "0.1.0-beta.1.21.10-preview.22",
|
|
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.13.0-beta.1.21.10-preview.
|
|
17
|
+
"@minecraft/server": "^1.13.0-beta.1.21.10-preview.22"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT"
|
|
20
20
|
}
|