@minecraft/server-editor 0.1.0-beta.1.20.80-preview.24 → 0.1.0-beta.1.21.0-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.
Files changed (2) hide show
  1. package/index.d.ts +141 -5
  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.20.80-preview.24"
17
+ * "version": "0.1.0-beta.1.21.0-preview.21"
18
18
  * }
19
19
  * ```
20
20
  *
@@ -627,6 +627,39 @@ export declare class BedrockEventSubscriptionCache {
627
627
  teardown(): void;
628
628
  }
629
629
 
630
+ export class BlockPalette {
631
+ /**
632
+ * @throws This function can throw errors.
633
+ *
634
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
635
+ */
636
+ getItem(index: number): IBlockPaletteItem;
637
+ /**
638
+ * @remarks
639
+ * This function can't be called in read-only mode.
640
+ *
641
+ * @throws This function can throw errors.
642
+ *
643
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
644
+ */
645
+ removeItemAt(index: number): void;
646
+ /**
647
+ * @remarks
648
+ * This function can't be called in read-only mode.
649
+ *
650
+ */
651
+ removeItems(): void;
652
+ /**
653
+ * @remarks
654
+ * This function can't be called in read-only mode.
655
+ *
656
+ * @throws This function can throw errors.
657
+ *
658
+ * {@link minecraftcommon.ArgumentOutOfBoundsError}
659
+ */
660
+ setItem(blockPaletteItem: IBlockPaletteItem, index: number): void;
661
+ }
662
+
630
663
  export class BlockPaletteManager {
631
664
  private constructor();
632
665
  /**
@@ -642,6 +675,46 @@ export class BlockPaletteManager {
642
675
  setSelectedBlockType(block: minecraftserver.BlockType): void;
643
676
  }
644
677
 
678
+ export class BrushShapeManager {
679
+ private constructor();
680
+ readonly activeBrushShape?: BrushShape;
681
+ readonly activeBrushVolume?: minecraftserver.CompoundBlockVolume;
682
+ readonly brushShapeNames: string[];
683
+ /**
684
+ * @remarks
685
+ * This function can't be called in read-only mode.
686
+ *
687
+ * @throws This function can throw errors.
688
+ */
689
+ activateBrushShape(name: string): minecraftserver.CompoundBlockVolume;
690
+ /**
691
+ * @remarks
692
+ * This function can't be called in read-only mode.
693
+ *
694
+ * @throws This function can throw errors.
695
+ */
696
+ getSettingsUIElements(brushName: string): SettingsUIElement[];
697
+ /**
698
+ * @remarks
699
+ * This function can't be called in read-only mode.
700
+ *
701
+ * @throws This function can throw errors.
702
+ */
703
+ registerBrushShape(
704
+ name: string,
705
+ icon: string,
706
+ rebuild: () => minecraftserver.CompoundBlockVolume,
707
+ getSettingsUIElements: () => SettingsUIElement[],
708
+ ): void;
709
+ /**
710
+ * @remarks
711
+ * This function can't be called in read-only mode.
712
+ *
713
+ * @throws This function can throw errors.
714
+ */
715
+ uiSettingValueChanged(elementName: string, newValue: boolean | number | string | minecraftserver.Vector3): boolean;
716
+ }
717
+
645
718
  /**
646
719
  * A ClipboardItem is a handle to an object which represents a
647
720
  * set of blocks in a contained bounding area (most likely
@@ -954,7 +1027,6 @@ export class CursorPropertyChangeAfterEventSignal {
954
1027
  * @remarks
955
1028
  * This function can't be called in read-only mode.
956
1029
  *
957
- * @throws This function can throw errors.
958
1030
  */
959
1031
  unsubscribe(callback: (arg: CursorPropertiesChangeAfterEvent) => void): void;
960
1032
  }
@@ -966,6 +1038,12 @@ export class CustomWidget extends Widget {
966
1038
  readonly rotation: minecraftserver.Vector2;
967
1039
  readonly showTextOnlyWhenSelected: boolean;
968
1040
  getText(): string;
1041
+ /**
1042
+ * @remarks
1043
+ * This function can't be called in read-only mode.
1044
+ *
1045
+ */
1046
+ moveBy(delta: minecraftserver.Vector3): void;
969
1047
  /**
970
1048
  * @remarks
971
1049
  * This function can't be called in read-only mode.
@@ -1051,6 +1129,7 @@ export class ExtensionContext {
1051
1129
  */
1052
1130
  readonly afterEvents: ExtensionContextAfterEvents;
1053
1131
  readonly blockPalette: BlockPaletteManager;
1132
+ readonly brushShapeManager: BrushShapeManager;
1054
1133
  /**
1055
1134
  * @remarks
1056
1135
  * This is used to access the players Clipboard Manager and the
@@ -1327,7 +1406,6 @@ export class ModeChangeAfterEventSignal {
1327
1406
  *
1328
1407
  * This function can't be called in read-only mode.
1329
1408
  *
1330
- * @throws This function can throw errors.
1331
1409
  */
1332
1410
  unsubscribe(callback: (arg: ModeChangeAfterEvent) => void): void;
1333
1411
  }
@@ -1362,7 +1440,6 @@ export class PrimarySelectionChangeAfterEventSignal {
1362
1440
  * @remarks
1363
1441
  * This function can't be called in read-only mode.
1364
1442
  *
1365
- * @throws This function can throw errors.
1366
1443
  */
1367
1444
  unsubscribe(callback: (arg: SelectionEventAfterEvent) => void): void;
1368
1445
  }
@@ -1659,6 +1736,23 @@ export class SettingsManager {
1659
1736
  readonly graphics: GraphicsSettings;
1660
1737
  }
1661
1738
 
1739
+ export class SettingsUIElement {
1740
+ readonly initialValue: boolean | number | string | minecraftserver.Vector3;
1741
+ readonly max?: number;
1742
+ readonly min?: number;
1743
+ readonly name: string;
1744
+ readonly onChange: (arg: variant) => boolean;
1745
+ readonly options?: string[];
1746
+ constructor(
1747
+ name: string,
1748
+ initialValue: boolean | number | string | minecraftserver.Vector3,
1749
+ onChange: (arg: variant) => boolean,
1750
+ min?: number,
1751
+ max?: number,
1752
+ options?: string[],
1753
+ );
1754
+ }
1755
+
1662
1756
  // @ts-ignore Class inheritance allowed for native defined classes
1663
1757
  export class SimpleBlockPaletteItem extends IBlockPaletteItem {
1664
1758
  constructor(displayName?: string);
@@ -1966,8 +2060,21 @@ export class UserDefinedTransactionHandlerId {
1966
2060
  export class Widget {
1967
2061
  private constructor();
1968
2062
  readonly valid: boolean;
2063
+ /**
2064
+ * @remarks
2065
+ * This function can't be called in read-only mode.
2066
+ *
2067
+ */
2068
+ deleteWidget(): void;
1969
2069
  getIsSelected(): boolean;
1970
2070
  getIsVisible(): boolean;
2071
+ /**
2072
+ * @remarks
2073
+ * This function can't be called in read-only mode.
2074
+ *
2075
+ * @throws This function can throw errors.
2076
+ */
2077
+ setIsSelected(isSelected: boolean): void;
1971
2078
  /**
1972
2079
  * @remarks
1973
2080
  * This function can't be called in read-only mode.
@@ -1979,6 +2086,12 @@ export class Widget {
1979
2086
  export class WidgetGroup {
1980
2087
  private constructor();
1981
2088
  readonly valid: boolean;
2089
+ /**
2090
+ * @remarks
2091
+ * This function can't be called in read-only mode.
2092
+ *
2093
+ */
2094
+ areAnySelected(): boolean;
1982
2095
  /**
1983
2096
  * @remarks
1984
2097
  * This function can't be called in read-only mode.
@@ -1998,12 +2111,30 @@ export class WidgetGroup {
1998
2111
  * @throws This function can throw errors.
1999
2112
  */
2000
2113
  deleteWidget(widgetToDelete: Widget): void;
2114
+ /**
2115
+ * @remarks
2116
+ * This function can't be called in read-only mode.
2117
+ *
2118
+ */
2119
+ deselectAllWidgets(): void;
2001
2120
  /**
2002
2121
  * @remarks
2003
2122
  * This function can't be called in read-only mode.
2004
2123
  *
2005
2124
  */
2006
2125
  getIsVisible(): boolean;
2126
+ /**
2127
+ * @remarks
2128
+ * This function can't be called in read-only mode.
2129
+ *
2130
+ */
2131
+ moveSelectedWidgets(delta: minecraftserver.Vector3): void;
2132
+ /**
2133
+ * @remarks
2134
+ * This function can't be called in read-only mode.
2135
+ *
2136
+ */
2137
+ selectAllWidgets(): void;
2007
2138
  /**
2008
2139
  * @remarks
2009
2140
  * This function can't be called in read-only mode.
@@ -2038,6 +2169,11 @@ export class WidgetStateChangeEventData {
2038
2169
  readonly widget: Widget;
2039
2170
  }
2040
2171
 
2172
+ export interface BrushShape {
2173
+ icon: string;
2174
+ name: string;
2175
+ }
2176
+
2041
2177
  /**
2042
2178
  * Interface used to specify the options when a clipboard item
2043
2179
  * is being written to the world
@@ -2517,7 +2653,7 @@ export interface IModalToolContainer {
2517
2653
  *
2518
2654
  */
2519
2655
  readonly selectedOptionId?: string;
2520
- addTool(params: ModalToolCreationParameters): IModalTool;
2656
+ addTool(params: ModalToolCreationParameters, action?: RegisteredAction<NoArgsAction>): IModalTool;
2521
2657
  dispose(): void;
2522
2658
  hide(): void;
2523
2659
  removeTool(id: string): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-editor",
3
- "version": "0.1.0-beta.1.20.80-preview.24",
3
+ "version": "0.1.0-beta.1.21.0-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.11.0-beta.1.20.80-preview.24"
17
+ "@minecraft/server": "^1.12.0-beta.1.21.0-preview.21"
18
18
  },
19
19
  "license": "MIT"
20
20
  }