From 9a56c04d444542612003787014638c179d442070 Mon Sep 17 00:00:00 2001 From: Ella-AWS <111664173+EllaCoat@users.noreply.github.com> Date: Sat, 29 Aug 2026 06:40:44 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E7=84=A1=E5=8A=B9=E5=9B=9E?= =?UTF-8?q?=E8=BB=A2=E3=81=AE=E3=83=9D=E3=83=83=E3=83=97=E3=82=A2=E3=83=83?= =?UTF-8?q?=E3=83=97=E3=82=92=E5=BB=83=E6=AD=A2=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/mods/cube.ts | 29 --------------------------- src/pluginPackage/changelog.json | 17 ++++++++++++++++ src/tests/cubeRotationOutline.test.ts | 13 ++++++++++++ 4 files changed, 31 insertions(+), 30 deletions(-) create mode 100644 src/tests/cubeRotationOutline.test.ts 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)') + }) +})