diff --git a/package.json b/package.json index 0c0a20e0..fd9595fe 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "title": "Animated Java (TSB)", "icon": "icon.svg", "description": "Effortlessly craft complex animations for Minecraft: Java Edition", - "version": "1.10.2", + "version": "1.10.3", "min_blockbench_version": "5.1.4", "variant": "desktop", "tags": [ diff --git a/src/mods/cube.ts b/src/mods/cube.ts index 2e4d0239..47708eac 100644 --- a/src/mods/cube.ts +++ b/src/mods/cube.ts @@ -1,7 +1,6 @@ import { overrideAccessors, registerPatch } from 'blockbench-patch-manager' import { activeProjectIsBlueprintFormat, projectTargetVersionIsAtLeast } from '../formats/blueprint' import { isCubeValid } from '../systems/util' -import { localize as translate } from '../util/lang' declare global { // @ts-expect-error - Broken BB types @@ -25,33 +24,6 @@ function updateCubeValidity(cube: Cube, isValid: boolean) { cube.isRotationValid = isValid } -let toastNotification: Deletable | null = null - -function showToastNotification() { - if (!toastNotification) { - toastNotification = Blockbench.showToastNotification({ - text: translate( - projectTargetVersionIsAtLeast('1.21.6') - ? 'toast.invalid_rotations_post_1_21_6' - : 'toast.invalid_rotations' - ), - color: 'var(--color-error)', - click: () => false, - }) - const intervalId = setInterval(() => { - if ( - Cube.all.some(cube => isCubeValid(cube) === 'invalid') && - document.querySelector('li.toast_notification') - ) - return - clearInterval(intervalId) - toastNotification?.delete() - toastNotification = null - requestAnimationFrame(updateAllCubeOutlines) - }, 1000) - } -} - registerPatch({ id: `animated_java:cube-outline-mod`, @@ -75,7 +47,6 @@ registerPatch({ } case 'invalid': { updateCubeValidity(cube, false) - showToastNotification() break } } diff --git a/src/pluginPackage/changelog.json b/src/pluginPackage/changelog.json index 5338cd34..f13a984a 100644 --- a/src/pluginPackage/changelog.json +++ b/src/pluginPackage/changelog.json @@ -880,5 +880,22 @@ ] } ] + }, + "1.10.3": { + "title": "v1.10.3", + "author": "EllaCoat", + "date": "2026-08-29", + "categories": [ + { + "title": "Changes", + "list": ["Removed the recurring invalid cube rotation popup from the editor."] + }, + { + "title": "Fixes", + "list": [ + "Invalid cube rotations remain outlined in red without interrupting the editor." + ] + } + ] } } diff --git a/src/tests/cubeRotationOutline.test.ts b/src/tests/cubeRotationOutline.test.ts new file mode 100644 index 00000000..f5fe16d8 --- /dev/null +++ b/src/tests/cubeRotationOutline.test.ts @@ -0,0 +1,13 @@ +import { readFileSync } from 'node:fs' +import { describe, expect, it } from 'vitest' + +const CUBE_MOD_SOURCE = readFileSync(new URL('../mods/cube.ts', import.meta.url), 'utf8') + +describe('cube rotation outline contract', () => { + it('keeps the red invalid-rotation outline without showing a toast', () => { + expect(CUBE_MOD_SOURCE).not.toContain('Blockbench.showToastNotification') + expect(CUBE_MOD_SOURCE).not.toContain('showToastNotification') + expect(CUBE_MOD_SOURCE).toContain("ERROR_OUTLINE_MATERIAL.color.set('#ff0000')") + expect(CUBE_MOD_SOURCE).toContain('updateCubeValidity(cube, false)') + }) +})