@minecraft/server-editor 0.1.0-beta.1.20.70-preview.25 → 0.1.0-beta.1.20.80-preview.21
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 +273 -1
- 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.20.
|
|
17
|
+
* "version": "0.1.0-beta.1.20.80-preview.21"
|
|
18
18
|
* }
|
|
19
19
|
* ```
|
|
20
20
|
*
|
|
@@ -107,6 +107,7 @@ export declare enum EDITOR_PANE_PROPERTY_ITEM_TYPE {
|
|
|
107
107
|
Boolean = 'editorUI:Boolean',
|
|
108
108
|
Divider = 'editorUI:Divider',
|
|
109
109
|
Dropdown = 'editorUI:Dropdown',
|
|
110
|
+
Image = 'editorUI:Image',
|
|
110
111
|
Number = 'editorUI:Number',
|
|
111
112
|
String = 'editorUI:String',
|
|
112
113
|
SubPane = 'editorUI:SubPane',
|
|
@@ -289,6 +290,14 @@ export declare enum KeyInputType {
|
|
|
289
290
|
Release = 2,
|
|
290
291
|
}
|
|
291
292
|
|
|
293
|
+
/**
|
|
294
|
+
* Layout directions for property panes.
|
|
295
|
+
*/
|
|
296
|
+
export declare enum LayoutDirection {
|
|
297
|
+
Vertical = 0,
|
|
298
|
+
Horizontal = 1,
|
|
299
|
+
}
|
|
300
|
+
|
|
292
301
|
/**
|
|
293
302
|
* Mouse device action categories
|
|
294
303
|
*/
|
|
@@ -351,6 +360,12 @@ export enum PlaytestSessionResult {
|
|
|
351
360
|
UnspecifiedError = 11,
|
|
352
361
|
}
|
|
353
362
|
|
|
363
|
+
export enum WidgetGroupSelectionMode {
|
|
364
|
+
Multiple = 'Multiple',
|
|
365
|
+
None = 'None',
|
|
366
|
+
Single = 'Single',
|
|
367
|
+
}
|
|
368
|
+
|
|
354
369
|
/**
|
|
355
370
|
* Defines type information for graphics settings properties.
|
|
356
371
|
*/
|
|
@@ -927,6 +942,131 @@ export class CursorPropertyChangeAfterEventSignal {
|
|
|
927
942
|
unsubscribe(callback: (arg: CursorPropertiesChangeAfterEvent) => void): void;
|
|
928
943
|
}
|
|
929
944
|
|
|
945
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
946
|
+
export class CustomWidget extends Widget {
|
|
947
|
+
private constructor();
|
|
948
|
+
readonly location: minecraftserver.Vector3;
|
|
949
|
+
readonly rotation: minecraftserver.Vector2;
|
|
950
|
+
readonly showTextOnlyWhenSelected: boolean;
|
|
951
|
+
getText(): string;
|
|
952
|
+
/**
|
|
953
|
+
* @remarks
|
|
954
|
+
* This function can't be called in read-only mode.
|
|
955
|
+
*
|
|
956
|
+
*/
|
|
957
|
+
setText(text: string): void;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
export class CustomWidgetMoveEventData {
|
|
961
|
+
private constructor();
|
|
962
|
+
readonly group: WidgetGroup;
|
|
963
|
+
readonly location?: minecraftserver.Vector3;
|
|
964
|
+
readonly rotation?: minecraftserver.Vector2;
|
|
965
|
+
readonly widget: CustomWidget;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
export class DataStore {
|
|
969
|
+
private constructor();
|
|
970
|
+
readonly actionContainer: DataStoreActionContainer;
|
|
971
|
+
readonly afterEvents: DataStoreAfterEvents;
|
|
972
|
+
readonly menuContainer: DataStoreMenuContainer;
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
export class DataStoreActionContainer {
|
|
976
|
+
private constructor();
|
|
977
|
+
/**
|
|
978
|
+
* @remarks
|
|
979
|
+
* This function can't be called in read-only mode.
|
|
980
|
+
*
|
|
981
|
+
* @throws This function can throw errors.
|
|
982
|
+
*/
|
|
983
|
+
bindActionToControl(controlId: string, actionPayload: string): void;
|
|
984
|
+
/**
|
|
985
|
+
* @remarks
|
|
986
|
+
* This function can't be called in read-only mode.
|
|
987
|
+
*
|
|
988
|
+
* @throws This function can throw errors.
|
|
989
|
+
*/
|
|
990
|
+
removeActionFromControl(controlId: string, actionPayload?: string): void;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
export class DataStoreAfterEvents {
|
|
994
|
+
private constructor();
|
|
995
|
+
readonly payloadReceived: DataStorePayloadAfterEventSignal;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
export class DataStoreMenuContainer {
|
|
999
|
+
private constructor();
|
|
1000
|
+
/**
|
|
1001
|
+
* @remarks
|
|
1002
|
+
* This function can't be called in read-only mode.
|
|
1003
|
+
*
|
|
1004
|
+
* @throws This function can throw errors.
|
|
1005
|
+
*/
|
|
1006
|
+
createItem(id: string, payload: string): void;
|
|
1007
|
+
/**
|
|
1008
|
+
* @remarks
|
|
1009
|
+
* This function can't be called in read-only mode.
|
|
1010
|
+
*
|
|
1011
|
+
* @throws This function can throw errors.
|
|
1012
|
+
*/
|
|
1013
|
+
destroyItem(id: string): void;
|
|
1014
|
+
/**
|
|
1015
|
+
* @remarks
|
|
1016
|
+
* This function can't be called in read-only mode.
|
|
1017
|
+
*
|
|
1018
|
+
*/
|
|
1019
|
+
getPayload(id: string): string;
|
|
1020
|
+
/**
|
|
1021
|
+
* @remarks
|
|
1022
|
+
* This function can't be called in read-only mode.
|
|
1023
|
+
*
|
|
1024
|
+
*/
|
|
1025
|
+
getProperty(id: string, property: string): boolean | number | string | undefined;
|
|
1026
|
+
/**
|
|
1027
|
+
* @remarks
|
|
1028
|
+
* This function can't be called in read-only mode.
|
|
1029
|
+
*
|
|
1030
|
+
*/
|
|
1031
|
+
hasPayload(id: string): boolean;
|
|
1032
|
+
/**
|
|
1033
|
+
* @remarks
|
|
1034
|
+
* This function can't be called in read-only mode.
|
|
1035
|
+
*
|
|
1036
|
+
*/
|
|
1037
|
+
hasProperty(id: string, property: string): boolean;
|
|
1038
|
+
/**
|
|
1039
|
+
* @remarks
|
|
1040
|
+
* This function can't be called in read-only mode.
|
|
1041
|
+
*
|
|
1042
|
+
* @throws This function can throw errors.
|
|
1043
|
+
*/
|
|
1044
|
+
updateItem(id: string, payload: string): void;
|
|
1045
|
+
}
|
|
1046
|
+
|
|
1047
|
+
export class DataStorePayloadAfterEvent {
|
|
1048
|
+
private constructor();
|
|
1049
|
+
readonly dataTag: string;
|
|
1050
|
+
readonly payload: string;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
export class DataStorePayloadAfterEventSignal {
|
|
1054
|
+
private constructor();
|
|
1055
|
+
/**
|
|
1056
|
+
* @remarks
|
|
1057
|
+
* This function can't be called in read-only mode.
|
|
1058
|
+
*
|
|
1059
|
+
*/
|
|
1060
|
+
subscribe(callback: (arg: DataStorePayloadAfterEvent) => void): (arg: DataStorePayloadAfterEvent) => void;
|
|
1061
|
+
/**
|
|
1062
|
+
* @remarks
|
|
1063
|
+
* This function can't be called in read-only mode.
|
|
1064
|
+
*
|
|
1065
|
+
* @throws This function can throw errors.
|
|
1066
|
+
*/
|
|
1067
|
+
unsubscribe(callback: (arg: DataStorePayloadAfterEvent) => void): void;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
930
1070
|
/**
|
|
931
1071
|
* Editor Extensions are the basis for all player specific,
|
|
932
1072
|
* editor specific functionality within the game. Almost all
|
|
@@ -1050,6 +1190,7 @@ export class ExtensionContext {
|
|
|
1050
1190
|
*
|
|
1051
1191
|
*/
|
|
1052
1192
|
readonly transactionManager: TransactionManager;
|
|
1193
|
+
readonly widgetManager: WidgetManager;
|
|
1053
1194
|
}
|
|
1054
1195
|
|
|
1055
1196
|
/**
|
|
@@ -1117,6 +1258,11 @@ export class GraphicsSettings {
|
|
|
1117
1258
|
setAll(properties: GraphicsSettingsPropertyTypeMap): void;
|
|
1118
1259
|
}
|
|
1119
1260
|
|
|
1261
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
1262
|
+
export class LineWidget extends Widget {
|
|
1263
|
+
private constructor();
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1120
1266
|
/**
|
|
1121
1267
|
* The logger class is a utility class which allows editor
|
|
1122
1268
|
* extensions to communicate with the player from the server to
|
|
@@ -1247,6 +1393,17 @@ export class MinecraftEditor {
|
|
|
1247
1393
|
): Extension;
|
|
1248
1394
|
}
|
|
1249
1395
|
|
|
1396
|
+
export class MinecraftEditorInternal {
|
|
1397
|
+
private constructor();
|
|
1398
|
+
/**
|
|
1399
|
+
* @remarks
|
|
1400
|
+
* This function can't be called in read-only mode.
|
|
1401
|
+
*
|
|
1402
|
+
* @throws This function can throw errors.
|
|
1403
|
+
*/
|
|
1404
|
+
getDataStore(player: minecraftserver.Player): DataStore;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1250
1407
|
/**
|
|
1251
1408
|
* Contains information related to changes in player editor
|
|
1252
1409
|
* mode.
|
|
@@ -1889,6 +2046,81 @@ export class UserDefinedTransactionHandlerId {
|
|
|
1889
2046
|
private constructor();
|
|
1890
2047
|
}
|
|
1891
2048
|
|
|
2049
|
+
export class Widget {
|
|
2050
|
+
private constructor();
|
|
2051
|
+
readonly valid: boolean;
|
|
2052
|
+
getIsSelected(): boolean;
|
|
2053
|
+
getIsVisible(): boolean;
|
|
2054
|
+
/**
|
|
2055
|
+
* @remarks
|
|
2056
|
+
* This function can't be called in read-only mode.
|
|
2057
|
+
*
|
|
2058
|
+
*/
|
|
2059
|
+
setIsVisible(isVisible: boolean): void;
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
export class WidgetGroup {
|
|
2063
|
+
private constructor();
|
|
2064
|
+
readonly valid: boolean;
|
|
2065
|
+
/**
|
|
2066
|
+
* @remarks
|
|
2067
|
+
* This function can't be called in read-only mode.
|
|
2068
|
+
*
|
|
2069
|
+
* @throws This function can throw errors.
|
|
2070
|
+
*/
|
|
2071
|
+
createCustomWidget(
|
|
2072
|
+
customEntityName: string,
|
|
2073
|
+
location: minecraftserver.Vector3,
|
|
2074
|
+
rotation?: minecraftserver.Vector2,
|
|
2075
|
+
options?: CustomWidgetCreateOptions,
|
|
2076
|
+
): CustomWidget;
|
|
2077
|
+
/**
|
|
2078
|
+
* @remarks
|
|
2079
|
+
* This function can't be called in read-only mode.
|
|
2080
|
+
*
|
|
2081
|
+
* @throws This function can throw errors.
|
|
2082
|
+
*/
|
|
2083
|
+
deleteWidget(widgetToDelete: Widget): void;
|
|
2084
|
+
/**
|
|
2085
|
+
* @remarks
|
|
2086
|
+
* This function can't be called in read-only mode.
|
|
2087
|
+
*
|
|
2088
|
+
*/
|
|
2089
|
+
getIsVisible(): boolean;
|
|
2090
|
+
/**
|
|
2091
|
+
* @remarks
|
|
2092
|
+
* This function can't be called in read-only mode.
|
|
2093
|
+
*
|
|
2094
|
+
*/
|
|
2095
|
+
setIsVisible(isVisible: boolean): void;
|
|
2096
|
+
}
|
|
2097
|
+
|
|
2098
|
+
export class WidgetManager {
|
|
2099
|
+
private constructor();
|
|
2100
|
+
/**
|
|
2101
|
+
* @remarks
|
|
2102
|
+
* This function can't be called in read-only mode.
|
|
2103
|
+
*
|
|
2104
|
+
* @throws This function can throw errors.
|
|
2105
|
+
*/
|
|
2106
|
+
createGroup(options?: WidgetGroupCreateOptions): WidgetGroup;
|
|
2107
|
+
/**
|
|
2108
|
+
* @remarks
|
|
2109
|
+
* This function can't be called in read-only mode.
|
|
2110
|
+
*
|
|
2111
|
+
* @throws This function can throw errors.
|
|
2112
|
+
*/
|
|
2113
|
+
deleteGroup(groupToDelete: WidgetGroup): void;
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
export class WidgetStateChangeEventData {
|
|
2117
|
+
private constructor();
|
|
2118
|
+
readonly group: WidgetGroup;
|
|
2119
|
+
readonly isSelected?: boolean;
|
|
2120
|
+
readonly isVisible?: boolean;
|
|
2121
|
+
readonly widget: Widget;
|
|
2122
|
+
}
|
|
2123
|
+
|
|
1892
2124
|
/**
|
|
1893
2125
|
* Interface used to specify the options when a clipboard item
|
|
1894
2126
|
* is being written to the world
|
|
@@ -2004,6 +2236,14 @@ export interface CursorProperties {
|
|
|
2004
2236
|
visible?: boolean;
|
|
2005
2237
|
}
|
|
2006
2238
|
|
|
2239
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
2240
|
+
export interface CustomWidgetCreateOptions extends WidgetCreateOptions {
|
|
2241
|
+
moveEvent?: (arg: CustomWidgetMoveEventData) => void;
|
|
2242
|
+
showTextOnlyWhenSelected?: boolean;
|
|
2243
|
+
text?: string;
|
|
2244
|
+
visualOffset?: minecraftserver.Vector3;
|
|
2245
|
+
}
|
|
2246
|
+
|
|
2007
2247
|
/**
|
|
2008
2248
|
* An interface which defines the set of optional parameters
|
|
2009
2249
|
* which can be used when calling the `registerEditorExtension`
|
|
@@ -2082,6 +2322,16 @@ export interface PlaytestGameOptions {
|
|
|
2082
2322
|
weather?: number;
|
|
2083
2323
|
}
|
|
2084
2324
|
|
|
2325
|
+
export interface WidgetCreateOptions {
|
|
2326
|
+
initialVisibility?: boolean;
|
|
2327
|
+
isSelectable?: boolean;
|
|
2328
|
+
stateChangeEvent?: (arg: WidgetStateChangeEventData) => void;
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2331
|
+
export interface WidgetGroupCreateOptions {
|
|
2332
|
+
groupSelectionMode?: WidgetGroupSelectionMode;
|
|
2333
|
+
}
|
|
2334
|
+
|
|
2085
2335
|
/**
|
|
2086
2336
|
* Binds actions to the client and manages their lifetime.
|
|
2087
2337
|
* Action managers are managed on a per player basis since
|
|
@@ -2465,6 +2715,7 @@ export interface IPropertyItemOptionsBool extends IPropertyItemOptions {
|
|
|
2465
2715
|
|
|
2466
2716
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
2467
2717
|
export interface IPropertyItemOptionsButton extends IPropertyItemOptions {
|
|
2718
|
+
icon?: string;
|
|
2468
2719
|
/**
|
|
2469
2720
|
* @remarks
|
|
2470
2721
|
* The variant for the button. By default it is "primary"
|
|
@@ -2493,6 +2744,12 @@ export interface IPropertyItemOptionsDropdown extends IPropertyItemOptions {
|
|
|
2493
2744
|
dropdownItems: IDropdownItem[];
|
|
2494
2745
|
}
|
|
2495
2746
|
|
|
2747
|
+
// @ts-ignore Class inheritance allowed for native defined classes
|
|
2748
|
+
export interface IPropertyItemOptionsImage extends IPropertyItemOptions {
|
|
2749
|
+
imageHeight: number;
|
|
2750
|
+
imageWidth: number;
|
|
2751
|
+
}
|
|
2752
|
+
|
|
2496
2753
|
// @ts-ignore Class inheritance allowed for native defined classes
|
|
2497
2754
|
export interface IPropertyItemOptionsNumber extends IPropertyItemOptions {
|
|
2498
2755
|
/**
|
|
@@ -2695,6 +2952,14 @@ export interface IPropertyPane {
|
|
|
2695
2952
|
property: Prop,
|
|
2696
2953
|
options?: IPropertyItemOptionsDataPicker,
|
|
2697
2954
|
): IPropertyItem<T, Prop>;
|
|
2955
|
+
/**
|
|
2956
|
+
* @remarks
|
|
2957
|
+
*/
|
|
2958
|
+
addImage<T extends PropertyBag, Prop extends keyof T & string>(
|
|
2959
|
+
obj: T,
|
|
2960
|
+
property: Prop,
|
|
2961
|
+
options?: IPropertyItemOptionsImage,
|
|
2962
|
+
): IPropertyItem<T, Prop>;
|
|
2698
2963
|
/**
|
|
2699
2964
|
* @remarks
|
|
2700
2965
|
* Adds a number item to the pane.
|
|
@@ -2778,6 +3043,12 @@ export interface IPropertyPane {
|
|
|
2778
3043
|
* The options to create a pane.
|
|
2779
3044
|
*/
|
|
2780
3045
|
export interface IPropertyPaneOptions {
|
|
3046
|
+
/**
|
|
3047
|
+
* @remarks
|
|
3048
|
+
* Layout direction for sub panes
|
|
3049
|
+
*
|
|
3050
|
+
*/
|
|
3051
|
+
direction?: LayoutDirection;
|
|
2781
3052
|
/**
|
|
2782
3053
|
* @remarks
|
|
2783
3054
|
* Fallback display text if no loc ID
|
|
@@ -2998,3 +3269,4 @@ export declare function registerUserDefinedTransactionHandler<T>(
|
|
|
2998
3269
|
*/
|
|
2999
3270
|
export declare function stringFromException(e: unknown): string;
|
|
3000
3271
|
export const editor: MinecraftEditor;
|
|
3272
|
+
export const editorInternal: MinecraftEditorInternal;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@minecraft/server-editor",
|
|
3
|
-
"version": "0.1.0-beta.1.20.
|
|
3
|
+
"version": "0.1.0-beta.1.20.80-preview.21",
|
|
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.
|
|
17
|
+
"@minecraft/server": "^1.11.0-beta.1.20.80-preview.21"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT"
|
|
20
20
|
}
|