diff --git a/dye-brush/dye-brush.ts b/dye-brush/dye-brush.ts index 429b8da..48cc010 100644 --- a/dye-brush/dye-brush.ts +++ b/dye-brush/dye-brush.ts @@ -3,7 +3,6 @@ import { ActionTypes, ColorPickerPropertyItemVariant, - CursorProperties, CursorTargetMode, IDropdownItem, IModalTool, @@ -139,7 +138,6 @@ interface DyeBrushStorage { currentColor: EntityColor; brushColor: IObservable; brushSize: number; - backedUpCursorProps: CursorProperties | undefined; } type DyeBrushSession = IPlayerUISession; @@ -164,11 +162,12 @@ function addDyeBrushPane(uiSession: DyeBrushSession, tool: IModalTool) { const pane = uiSession.createPropertyPane({ title: 'sample.dyeBrush.pane.title', - infoTooltip: { description: ['sample.dyebrush.tool.tooltip'] }, }); const entityBrush = makeObservable(EntityColor.White); + onColorUpdated(brushColor.value, uiSession); + pane.addDropdown(entityBrush, { title: 'Brush', entries: Object.values(EntityColor).reduce((list, dye, index) => { @@ -313,15 +312,7 @@ function addDyeBrushPane(uiSession: DyeBrushSession, tool: IModalTool) { tool.onModalToolActivation.subscribe((evt: ModalToolLifecycleEventPayload) => { if (evt.isActiveTool) { - if (uiSession.scratchStorage && !uiSession.scratchStorage.backedUpCursorProps) { - uiSession.scratchStorage.backedUpCursorProps = uiSession.extensionContext.cursor.getProperties(); - } onColorUpdated(brushColor.value, uiSession); - } else { - if (uiSession.scratchStorage && uiSession.scratchStorage.backedUpCursorProps) { - uiSession.extensionContext.cursor.setProperties(uiSession.scratchStorage.backedUpCursorProps); - uiSession.scratchStorage.backedUpCursorProps = undefined; - } } uiSession.scratchStorage?.previewSelection?.clear(); }); @@ -354,7 +345,6 @@ export function registerDyeBrushExtension() { currentColor: EntityColor.White, brushColor: makeObservable({ red: 1, green: 1, blue: 1, alpha: 0.5 }), brushSize: 4, - backedUpCursorProps: undefined, }; uiSession.scratchStorage = storage; diff --git a/editor-samples.mceditoraddon b/editor-samples.mceditoraddon index 6388496..05c43af 100644 Binary files a/editor-samples.mceditoraddon and b/editor-samples.mceditoraddon differ diff --git a/tree-generator/tree-generator.ts b/tree-generator/tree-generator.ts index 128a420..bc2d29f 100644 --- a/tree-generator/tree-generator.ts +++ b/tree-generator/tree-generator.ts @@ -220,49 +220,43 @@ export class SimpleTree implements ITree { } } +function createLeaf1Block(leafType: string): BlockPermutation { + return BlockPermutation.resolve(MinecraftBlockTypes.Leaves, { + old_leaf_type: leafType, + }); +} + +function createLeaf2Block(leafType: string): BlockPermutation { + return BlockPermutation.resolve(MinecraftBlockTypes.Leaves2, { + new_leaf_type: leafType, + }); +} + const TreeTypes = [ { name: 'Oak', - type: new SimpleTree( - BlockPermutation.resolve(MinecraftBlockTypes.OakLog), - BlockPermutation.resolve(MinecraftBlockTypes.OakLeaves) - ), + type: new SimpleTree(BlockPermutation.resolve(MinecraftBlockTypes.OakLog), createLeaf1Block('oak')), }, { name: 'Spruce', - type: new SimpleTree( - BlockPermutation.resolve(MinecraftBlockTypes.SpruceLog), - BlockPermutation.resolve(MinecraftBlockTypes.SpruceLeaves) - ), + type: new SimpleTree(BlockPermutation.resolve(MinecraftBlockTypes.SpruceLog), createLeaf1Block('spruce')), }, { name: 'Birch', - type: new SimpleTree( - BlockPermutation.resolve(MinecraftBlockTypes.BirchLog), - BlockPermutation.resolve(MinecraftBlockTypes.BirchLeaves) - ), + type: new SimpleTree(BlockPermutation.resolve(MinecraftBlockTypes.BirchLog), createLeaf1Block('birch')), }, { name: 'Jungle', - type: new SimpleTree( - BlockPermutation.resolve(MinecraftBlockTypes.JungleLog), - BlockPermutation.resolve(MinecraftBlockTypes.JungleLeaves) - ), + type: new SimpleTree(BlockPermutation.resolve(MinecraftBlockTypes.JungleLog), createLeaf1Block('jungle')), }, { name: 'Acacia', - type: new SimpleTree( - BlockPermutation.resolve(MinecraftBlockTypes.AcaciaLog), - BlockPermutation.resolve(MinecraftBlockTypes.AcaciaLeaves) - ), + type: new SimpleTree(BlockPermutation.resolve(MinecraftBlockTypes.AcaciaLog), createLeaf2Block('acacia')), }, { name: 'Dark Oak', - type: new SimpleTree( - BlockPermutation.resolve(MinecraftBlockTypes.DarkOakLog), - BlockPermutation.resolve(MinecraftBlockTypes.DarkOakLeaves) - ), + type: new SimpleTree(BlockPermutation.resolve(MinecraftBlockTypes.DarkOakLog), createLeaf2Block('dark_oak')), }, ];