@minecraft/server-editor 0.1.0-beta.1.21.0-preview.20 → 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 +19 -20
  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.0-preview.20"
17
+ * "version": "0.1.0-beta.1.21.0-preview.21"
18
18
  * }
19
19
  * ```
20
20
  *
@@ -675,19 +675,6 @@ export class BlockPaletteManager {
675
675
  setSelectedBlockType(block: minecraftserver.BlockType): void;
676
676
  }
677
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
678
  export class BrushShapeManager {
692
679
  private constructor();
693
680
  readonly activeBrushShape?: BrushShape;
@@ -713,14 +700,19 @@ export class BrushShapeManager {
713
700
  *
714
701
  * @throws This function can throw errors.
715
702
  */
716
- registerBrushShape(brushShape: BrushShape): void;
703
+ registerBrushShape(
704
+ name: string,
705
+ icon: string,
706
+ rebuild: () => minecraftserver.CompoundBlockVolume,
707
+ getSettingsUIElements: () => SettingsUIElement[],
708
+ ): void;
717
709
  /**
718
710
  * @remarks
719
711
  * This function can't be called in read-only mode.
720
712
  *
721
713
  * @throws This function can throw errors.
722
714
  */
723
- uiSettingValueChanged(elementName: string, newValue: boolean | number): void;
715
+ uiSettingValueChanged(elementName: string, newValue: boolean | number | string | minecraftserver.Vector3): boolean;
724
716
  }
725
717
 
726
718
  /**
@@ -1745,17 +1737,19 @@ export class SettingsManager {
1745
1737
  }
1746
1738
 
1747
1739
  export class SettingsUIElement {
1748
- readonly initialValue: boolean | number;
1740
+ readonly initialValue: boolean | number | string | minecraftserver.Vector3;
1749
1741
  readonly max?: number;
1750
1742
  readonly min?: number;
1751
1743
  readonly name: string;
1752
- readonly valueChanged?: (arg: variant) => void;
1744
+ readonly onChange: (arg: variant) => boolean;
1745
+ readonly options?: string[];
1753
1746
  constructor(
1754
1747
  name: string,
1755
- initialValue: boolean | number,
1748
+ initialValue: boolean | number | string | minecraftserver.Vector3,
1749
+ onChange: (arg: variant) => boolean,
1756
1750
  min?: number,
1757
1751
  max?: number,
1758
- valueChanged?: (arg: variant) => void,
1752
+ options?: string[],
1759
1753
  );
1760
1754
  }
1761
1755
 
@@ -2175,6 +2169,11 @@ export class WidgetStateChangeEventData {
2175
2169
  readonly widget: Widget;
2176
2170
  }
2177
2171
 
2172
+ export interface BrushShape {
2173
+ icon: string;
2174
+ name: string;
2175
+ }
2176
+
2178
2177
  /**
2179
2178
  * Interface used to specify the options when a clipboard item
2180
2179
  * is being written to the world
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minecraft/server-editor",
3
- "version": "0.1.0-beta.1.21.0-preview.20",
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.12.0-beta.1.21.0-preview.20"
17
+ "@minecraft/server": "^1.12.0-beta.1.21.0-preview.21"
18
18
  },
19
19
  "license": "MIT"
20
20
  }