@minecraft/server-editor 0.1.0-beta.1.20.80-preview.24 → 0.1.0-beta.1.21.0-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 +142 -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.20"
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,54 @@ export class BlockPaletteManager {
642
675
  setSelectedBlockType(block: minecraftserver.BlockType): void;
643
676
  }
644
677
 
678
+ export class BrushShape {
679
+ readonly getSettingsUIElements: () => SettingsUIElement[];
680
+ readonly icon: string;
681
+ readonly name: string;
682
+ readonly rebuild: () => minecraftserver.CompoundBlockVolume;
683
+ constructor(
684
+ name: string,
685
+ icon: string,
686
+ rebuild: () => minecraftserver.CompoundBlockVolume,
687
+ getSettingsUI: () => SettingsUIElement[],
688
+ );
689
+ }
690
+
691
+ export class BrushShapeManager {
692
+ private constructor();
693
+ readonly activeBrushShape?: BrushShape;
694
+ readonly activeBrushVolume?: minecraftserver.CompoundBlockVolume;
695
+ readonly brushShapeNames: string[];
696
+ /**
697
+ * @remarks
698
+ * This function can't be called in read-only mode.
699
+ *
700
+ * @throws This function can throw errors.
701
+ */
702
+ activateBrushShape(name: string): minecraftserver.CompoundBlockVolume;
703
+ /**
704
+ * @remarks
705
+ * This function can't be called in read-only mode.
706
+ *
707
+ * @throws This function can throw errors.
708
+ */
709
+ getSettingsUIElements(brushName: string): SettingsUIElement[];
710
+ /**
711
+ * @remarks
712
+ * This function can't be called in read-only mode.
713
+ *
714
+ * @throws This function can throw errors.
715
+ */
716
+ registerBrushShape(brushShape: BrushShape): void;
717
+ /**
718
+ * @remarks
719
+ * This function can't be called in read-only mode.
720
+ *
721
+ * @throws This function can throw errors.
722
+ */
723
+ uiSettingValueChanged(elementName: string, newValue: boolean | number): void;
724
+ }
725
+
645
726
  /**
646
727
  * A ClipboardItem is a handle to an object which represents a
647
728
  * set of blocks in a contained bounding area (most likely
@@ -954,7 +1035,6 @@ export class CursorPropertyChangeAfterEventSignal {
954
1035
  * @remarks
955
1036
  * This function can't be called in read-only mode.
956
1037
  *
957
- * @throws This function can throw errors.
958
1038
  */
959
1039
  unsubscribe(callback: (arg: CursorPropertiesChangeAfterEvent) => void): void;
960
1040
  }
@@ -966,6 +1046,12 @@ export class CustomWidget extends Widget {
966
1046
  readonly rotation: minecraftserver.Vector2;
967
1047
  readonly showTextOnlyWhenSelected: boolean;
968
1048
  getText(): string;
1049
+ /**
1050
+ * @remarks
1051
+ * This function can't be called in read-only mode.
1052
+ *
1053
+ */
1054
+ moveBy(delta: minecraftserver.Vector3): void;
969
1055
  /**
970
1056
  * @remarks
971
1057
  * This function can't be called in read-only mode.
@@ -1051,6 +1137,7 @@ export class ExtensionContext {
1051
1137
  */
1052
1138
  readonly afterEvents: ExtensionContextAfterEvents;
1053
1139
  readonly blockPalette: BlockPaletteManager;
1140
+ readonly brushShapeManager: BrushShapeManager;
1054
1141
  /**
1055
1142
  * @remarks
1056
1143
  * This is used to access the players Clipboard Manager and the
@@ -1327,7 +1414,6 @@ export class ModeChangeAfterEventSignal {
1327
1414
  *
1328
1415
  * This function can't be called in read-only mode.
1329
1416
  *
1330
- * @throws This function can throw errors.
1331
1417
  */
1332
1418
  unsubscribe(callback: (arg: ModeChangeAfterEvent) => void): void;
1333
1419
  }
@@ -1362,7 +1448,6 @@ export class PrimarySelectionChangeAfterEventSignal {
1362
1448
  * @remarks
1363
1449
  * This function can't be called in read-only mode.
1364
1450
  *
1365
- * @throws This function can throw errors.
1366
1451
  */
1367
1452
  unsubscribe(callback: (arg: SelectionEventAfterEvent) => void): void;
1368
1453
  }
@@ -1659,6 +1744,21 @@ export class SettingsManager {
1659
1744
  readonly graphics: GraphicsSettings;
1660
1745
  }
1661
1746
 
1747
+ export class SettingsUIElement {
1748
+ readonly initialValue: boolean | number;
1749
+ readonly max?: number;
1750
+ readonly min?: number;
1751
+ readonly name: string;
1752
+ readonly valueChanged?: (arg: variant) => void;
1753
+ constructor(
1754
+ name: string,
1755
+ initialValue: boolean | number,
1756
+ min?: number,
1757
+ max?: number,
1758
+ valueChanged?: (arg: variant) => void,
1759
+ );
1760
+ }
1761
+
1662
1762
  // @ts-ignore Class inheritance allowed for native defined classes
1663
1763
  export class SimpleBlockPaletteItem extends IBlockPaletteItem {
1664
1764
  constructor(displayName?: string);
@@ -1966,8 +2066,21 @@ export class UserDefinedTransactionHandlerId {
1966
2066
  export class Widget {
1967
2067
  private constructor();
1968
2068
  readonly valid: boolean;
2069
+ /**
2070
+ * @remarks
2071
+ * This function can't be called in read-only mode.
2072
+ *
2073
+ */
2074
+ deleteWidget(): void;
1969
2075
  getIsSelected(): boolean;
1970
2076
  getIsVisible(): boolean;
2077
+ /**
2078
+ * @remarks
2079
+ * This function can't be called in read-only mode.
2080
+ *
2081
+ * @throws This function can throw errors.
2082
+ */
2083
+ setIsSelected(isSelected: boolean): void;
1971
2084
  /**
1972
2085
  * @remarks
1973
2086
  * This function can't be called in read-only mode.
@@ -1979,6 +2092,12 @@ export class Widget {
1979
2092
  export class WidgetGroup {
1980
2093
  private constructor();
1981
2094
  readonly valid: boolean;
2095
+ /**
2096
+ * @remarks
2097
+ * This function can't be called in read-only mode.
2098
+ *
2099
+ */
2100
+ areAnySelected(): boolean;
1982
2101
  /**
1983
2102
  * @remarks
1984
2103
  * This function can't be called in read-only mode.
@@ -1998,12 +2117,30 @@ export class WidgetGroup {
1998
2117
  * @throws This function can throw errors.
1999
2118
  */
2000
2119
  deleteWidget(widgetToDelete: Widget): void;
2120
+ /**
2121
+ * @remarks
2122
+ * This function can't be called in read-only mode.
2123
+ *
2124
+ */
2125
+ deselectAllWidgets(): void;
2001
2126
  /**
2002
2127
  * @remarks
2003
2128
  * This function can't be called in read-only mode.
2004
2129
  *
2005
2130
  */
2006
2131
  getIsVisible(): boolean;
2132
+ /**
2133
+ * @remarks
2134
+ * This function can't be called in read-only mode.
2135
+ *
2136
+ */
2137
+ moveSelectedWidgets(delta: minecraftserver.Vector3): void;
2138
+ /**
2139
+ * @remarks
2140
+ * This function can't be called in read-only mode.
2141
+ *
2142
+ */
2143
+ selectAllWidgets(): void;
2007
2144
  /**
2008
2145
  * @remarks
2009
2146
  * This function can't be called in read-only mode.
@@ -2517,7 +2654,7 @@ export interface IModalToolContainer {
2517
2654
  *
2518
2655
  */
2519
2656
  readonly selectedOptionId?: string;
2520
- addTool(params: ModalToolCreationParameters): IModalTool;
2657
+ addTool(params: ModalToolCreationParameters, action?: RegisteredAction<NoArgsAction>): IModalTool;
2521
2658
  dispose(): void;
2522
2659
  hide(): void;
2523
2660
  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.20",
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.20"
18
18
  },
19
19
  "license": "MIT"
20
20
  }