Skip to content

Commit

Permalink
🚧 Squashed v1.6.0
Browse files Browse the repository at this point in the history
commit ddcea5a
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Wed Jan 8 13:33:09 2025 -0500

    🛠️ Add "has_changelog" to plugin packager

commit 2af409d
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Wed Jan 8 13:14:16 2025 -0500

    ❗ Forgot a changelog item

commit 3e2a0c2
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Wed Jan 8 13:11:09 2025 -0500

    🚧 v1.6.0

commit f54f807
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Wed Jan 8 11:52:58 2025 -0500

    🚧 Improved version handling

commit 02b1860
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Wed Jan 8 11:28:50 2025 -0500

    🚧 Version warning

    Added a warning when loading AJ data packs in versions they weren't exported for.

commit cc88b83
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Wed Jan 8 10:48:27 2025 -0500

    🛠️ Fix transparent texture and missing tags

    - Fix incorrect export location for transparent texture.
    - Fix tags getting cleared out in old exports.

commit 271a0f6
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Tue Jan 7 14:28:24 2025 -0500

    🚧 Add extraction confirmation

commit 0070b9c
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Mon Dec 30 12:35:17 2024 -0500

    🛠️ Slightly improved empty JSON text rendering

    #322

commit 5781f3f
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Mon Dec 30 11:58:35 2024 -0500

    🛠️ Fix #342

commit 83acc4f
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Mon Dec 30 11:45:52 2024 -0500

    🛠️ Fix #340

commit 339345e
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Mon Dec 30 11:44:04 2024 -0500

    🛠️ Fix #343

commit 9912d7c
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Mon Dec 30 11:33:24 2024 -0500

    🛠️ Fix #341

commit e3129d1
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Mon Dec 30 11:30:49 2024 -0500

    🛠️ Fix #345

commit 99446a5
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Mon Dec 30 11:14:42 2024 -0500

    🛠️ Fixed #347

commit 89369b1
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Mon Dec 30 11:06:52 2024 -0500

    🛠️ Fix #349

commit a7b1753
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Mon Dec 30 11:05:09 2024 -0500

    🛠️ Fix #348

commit 5d24c77
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Tue Dec 24 06:07:18 2024 -0500

    🚧 Add .mcb file compression.

commit d567389
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Tue Nov 26 17:52:04 2024 -0500

    Squashed commit of the following:

    commit 7aeec46
    Author: SnaveSutit <snavesutit@gmail.com>
    Date:   Thu Nov 21 14:14:15 2024 -0500

        🚧 1.21.4 Export

        - Added 1.21.4 target MC version.
        - Changed missing assets and data folder for resource and data pack folder settings errors into warnings.
        - Added an action to extract all of a blueprint's export files from a data pack / resource pack.
        - Added support for item definitions (1.21.4).
        - Changed default resource pack structure:
        `animated_java:textures/item/export_namespace/` -> `animated_java:textures/blueprint/export_namespace/`
        `animated_java:models/item/export_namespace/` -> `animated_java:models/blueprint/export_namespace/`

    commit efdc207
    Author: SnaveSutit <snavesutit@gmail.com>
    Date:   Sat Nov 16 11:18:07 2024 -0500

        🚧 Prevent exporting with invalid rotations.

        - Added a dialog and exception for exporting a blueprint with invalid cube rotations.

    commit fac53dc
    Author: SnaveSutit <snavesutit@gmail.com>
    Date:   Sat Nov 16 11:09:30 2024 -0500

        🚧 Enforce Per-Face UV when converting

    commit d285985
    Author: SnaveSutit <snavesutit@gmail.com>
    Date:   Sat Nov 2 17:37:32 2024 -0400

        🚧 Squashed v1.5.0, v1.5.1, and v1.5.2.

        commit bcbb6f8
        Author: SnaveSutit <snavesutit@gmail.com>
        Date:   Sat Nov 2 17:33:16 2024 -0400

            🛠️ Fix broken asset download on first startup.

        commit 9a3b525
        Author: SnaveSutit <snavesutit@gmail.com>
        Date:   Fri Nov 1 15:08:57 2024 -0400

            ✨ Improved tellraw messages

        commit d8dbdbd
        Author: SnaveSutit <snavesutit@gmail.com>
        Date:   Wed Oct 30 17:53:35 2024 -0400

            Fix production build script issues.

        commit 2dce027
        Author: SnaveSutit <snavesutit@gmail.com>
        Date:   Tue Oct 29 11:10:47 2024 -0400

            🛠️ Static Export Locator / Camera Fixes

            - Fixed use entity locators and cameras not summoning properly in static mode

        commit 66986b7
        Author: SnaveSutit <snavesutit@gmail.com>
        Date:   Wed Oct 23 09:58:02 2024 -0400

            🚧 v1.5.1

        commit 357bfa2
        Author: SnaveSutit <snavesutit@gmail.com>
        Date:   Wed Oct 23 09:57:52 2024 -0400

            🛠️ Fix broken passengers from summon tp command

    commit 7d95287
    Author: SnaveSutit <snavesutit@gmail.com>
    Date:   Wed Oct 23 09:58:29 2024 -0400

        🚧 Squashed v.1.5.1

        commit 66986b7
        Author: SnaveSutit <snavesutit@gmail.com>
        Date:   Wed Oct 23 09:58:02 2024 -0400

            🚧 v1.5.1

        commit 357bfa2
        Author: SnaveSutit <snavesutit@gmail.com>
        Date:   Wed Oct 23 09:57:52 2024 -0400

            🛠️ Fix broken passengers from summon tp command

commit bd7c6b1
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Sat Nov 9 04:03:22 2024 -0500

    ✨ Add a toast notification for invalid cubes

commit bcbb6f8
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Sat Nov 2 17:33:16 2024 -0400

    🛠️ Fix broken asset download on first startup.

commit 9a3b525
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Fri Nov 1 15:08:57 2024 -0400

    ✨ Improved tellraw messages

commit d8dbdbd
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Wed Oct 30 17:53:35 2024 -0400

    Fix production build script issues.

commit 2dce027
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Tue Oct 29 11:10:47 2024 -0400

    🛠️ Static Export Locator / Camera Fixes

    - Fixed use entity locators and cameras not summoning properly in static mode

commit 66986b7
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Wed Oct 23 09:58:02 2024 -0400

    🚧 v1.5.1

commit 357bfa2
Author: SnaveSutit <snavesutit@gmail.com>
Date:   Wed Oct 23 09:57:52 2024 -0400

    🛠️ Fix broken passengers from summon tp command
  • Loading branch information
SnaveSutit committed Jan 8, 2025
1 parent 7aeec46 commit 4482a54
Show file tree
Hide file tree
Showing 42 changed files with 4,025 additions and 258 deletions.
5 changes: 4 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"exporters/",
"tools/",
"svelte.config.ts",
"src/util/bufferGeometryUtils.ts"
"vitest.config.ts",
"src/util/bufferGeometryUtils.ts",
"tests/**/*"
],
"overrides": [
{
Expand Down Expand Up @@ -45,6 +47,7 @@
"@typescript-eslint/consistent-indexed-object-style": ["warn", "record"],
"@typescript-eslint/consistent-generic-constructors": "warn",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/naming-convention": [
"warn",
{
Expand Down
1 change: 1 addition & 0 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
- [x] Check for references to non-existant functions in merged function tags, and remove them.
- [ ] When applying variants, remove / replace any bones that have / had no elements with textured faces.

- [x] Add a toast notification for when the model has invalid rotations.
# Resource Pack

- [x] Warn the user when they have custom elements in their model, but have disabled the resource pack export.
Expand Down
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"title": "Animated Java",
"icon": "icon.svg",
"description": "A Blockbench plugin that makes complex animation a breeze in Minecraft: Java Edition.",
"version": "1.5.2",
"display_version": "1.5.2",
"version": "1.6.0",
"display_version": "1.6.0",
"min_blockbench_version": "4.11.1",
"variant": "desktop",
"tags": [
Expand Down Expand Up @@ -78,14 +78,17 @@
"build:scripts": "esbuild --bundle --platform=node --outfile=dist/build.cjs --packages=external ./tools/esbuild.ts",
"dev": "yarn build:scripts && node ./dist/build.cjs --mode=dev",
"prod": "node ./tools/cleanupDist.cjs && yarn build:scripts && node ./dist/build.cjs",
"format": "prettier --write ."
"format": "prettier --write .",
"test": "yarn build:scripts && vitest run",
"coverage": "yarn build:scripts && vitest run --coverage"
},
"devDependencies": {
"@novacbn/svelte-codejar": "^0.1.2",
"@types/download": "^8.0.5",
"@types/eslint": "^8.21.1",
"@types/js-yaml": "^4.0.5",
"@types/node": "^17.0.21",
"@types/websocket": "^1.0.10",
"@typescript-eslint/eslint-plugin": "^5.54.0",
"@typescript-eslint/parser": "^5.54.0",
"blockbench-types": "https://github.com/SnaveSutit/blockbench-types.git",
Expand All @@ -102,7 +105,8 @@
"svelte-awesome-color-picker": "^3.0.0-beta.7",
"svelte-preprocess": "^5.0.1",
"svelte-preprocess-esbuild": "^3.0.1",
"typescript": "^4.5.5"
"typescript": "^4.5.5",
"vitest": "^2.1.8"
},
"dependencies": {
"deepslate": "^0.19.2",
Expand All @@ -111,7 +115,7 @@
"generic-stream": "^1.2.6",
"marked": "^4.3.0",
"marked-gfm-heading-id": "^3.0.0",
"mc-build": "^3.4.3",
"mc-build": "^3.5.1",
"request-progress": "^3.0.0",
"svelte-ace": "^1.0.21",
"svelte-dnd-action": "^0.9.38"
Expand Down
2 changes: 2 additions & 0 deletions src/blockbenchTypeMods.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ declare global {
pluginMode: Valuable<boolean>
transparentTexture: Texture

showingInvalidCubeRotations: boolean

variants: Variant[]
textDisplays: TextDisplay[]
vanillaItemDisplays: VanillaItemDisplay[]
Expand Down
2 changes: 1 addition & 1 deletion src/blueprintFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ export function updateRotationLock() {
!!AnimatedJava.API.TextDisplay.selected.length ||
!!AnimatedJava.API.VanillaItemDisplay.selected.length ||
!!AnimatedJava.API.VanillaBlockDisplay.selected.length ||
!!(OutlinerElement.types.camera?.selected && OutlinerElement.types.camera?.selected.length)
!!(OutlinerElement.types.camera?.selected && OutlinerElement.types.camera?.selected)
)
BLUEPRINT_FORMAT.rotation_snap = BLUEPRINT_FORMAT.rotation_limit
}
Expand Down
2 changes: 0 additions & 2 deletions src/components/blueprintSettingsDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,6 @@
tooltip={translate('dialog.blueprint_settings.resource_pack_export_mode.description')}
options={{
raw: translate('dialog.blueprint_settings.resource_pack_export_mode.options.raw'),
// zip: translate('dialog.blueprint_settings.resource_pack_export_mode.options.zip'),
none: translate('dialog.blueprint_settings.resource_pack_export_mode.options.none'),
}}
defaultOption={'raw'}
Expand All @@ -587,7 +586,6 @@
tooltip={translate('dialog.blueprint_settings.data_pack_export_mode.description')}
options={{
raw: translate('dialog.blueprint_settings.data_pack_export_mode.options.raw'),
// zip: translate('dialog.blueprint_settings.data_pack_export_mode.options.zip'),
none: translate('dialog.blueprint_settings.data_pack_export_mode.options.none'),
}}
defaultOption={'raw'}
Expand Down
86 changes: 86 additions & 0 deletions src/components/changelogDialog.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<script lang="ts">
import changelog from '../pluginPackage/changelog.json'
function formatDateFull(date: string) {
// @ts-expect-error
return getDateDisplay(date).full
}
function formatDateShort(date: string) {
// @ts-expect-error
return getDateDisplay(date).short
}
const ISSUES_URL = 'https://api.github.com/repos/animated-java/animated-java/issues/'
async function formatMarkdown(text: string) {
const issues: Record<number, { title: string; url: string }> = {}
text = text.replace(/\[(.*?)\]\((.*?)\)/g, (match, title, url) => {
const issueMatch = url.match(/issues\/(\d+)/)
if (issueMatch) {
const issueNumber = parseInt(issueMatch[1])
issues[issueNumber] = { title, url }
return `$$$ISSUE${issueNumber}$$$`
}
return `<a href="${url}" target="_blank">${title}</a>`
})
for (const [issueNumber, { title, url }] of Object.entries(issues)) {
await fetch(`${ISSUES_URL}${issueNumber}`)
.then(response => response.json())
.then(data => {
text = text.replace(
`$$$ISSUE${issueNumber}$$$`,
`<a href="${url}" target="_blank">#${issueNumber} - ${data.title}</a>`,
)
})
}
// inline code blocks
text = text.replace(/`([^`]+?)`/g, '<code>$1</code>')
return text
}
</script>

<div class="content plugin_browser_tabbed_page" id="plugin_browser_changelog">
{#each Object.values(changelog) as versions}
<h3>
{versions.title}
</h3>
<!-- svelte-ignore a11y-label-has-associated-control -->
<label class="plugin_changelog_author">{versions.author}</label>
<!-- svelte-ignore a11y-label-has-associated-control -->
<label class="plugin_changelog_date" title={formatDateFull(versions.date)}>
<i class="material-icons icon">calendar_today</i>
<!-- svelte-ignore missing-declaration -->
{formatDateShort(versions.date)}
</label>
<ul>
{#each versions.categories as category}
<li>
<h4>{category.title}</h4>
<ul class="plugin_changelog_features">
{#each category.list as item}
<li>
{#await formatMarkdown(item) then data}
{@html data}
{/await}
</li>
{/each}
</ul>
</li>
{/each}
</ul>
<hr />
{/each}
</div>

<style>
.content {
max-height: 75vh;
overflow: auto;
}
:global(.plugin_browser_tabbed_page code) {
background-color: var(--color-back);
padding: 0.2em 0.4em;
border-radius: 3px;
font-size: 0.8em;
}
</style>
5 changes: 3 additions & 2 deletions src/components/installedPopup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
<div class="another-container">
<h2>Not Sure Where to Start?</h2>
<p>
Check out our <a href="https://animated-java.dev/docs/getting-started"
Check out our <a
href="https://animated-java.dev/docs/getting-started/creating-a-blueprint"
>getting started</a
> page to learn how to use Animated Java.
> page to learn how to use Animated Java!
</p>
<p>
You can open our docs at any time via the Animated Java menu at the top of the screen.
Expand Down
12 changes: 12 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ import { exportProject } from './systems/exporter'
import { openBlueprintLoadingDialog } from './interface/blueprintLoadingPopup'
import { openInstallPopup } from './interface/installedPopup'
import { cleanupExportedFiles } from './systems/cleaner'
import mcbFiles from './systems/datapackCompiler/mcbFiles'
import { openChangelogDialog } from './interface/changelogDialog'

// @ts-ignore
globalThis.AnimatedJava = {
Expand Down Expand Up @@ -83,9 +85,19 @@ globalThis.AnimatedJava = {
Undo.finishEdit('Remove Cubes Associated With Texture')
},
cleanupExportedFiles,
mcbFiles,
openChangelogDialog,
},
}

requestAnimationFrame(() => {
const lastVersion = localStorage.getItem('animated-java-last-version')
if (lastVersion !== PACKAGE.version) {
localStorage.setItem('animated-java-last-version', PACKAGE.version)
openChangelogDialog()
}
})

// Uninstall events
events.EXTRACT_MODS.subscribe(() => {
// @ts-ignore
Expand Down
50 changes: 45 additions & 5 deletions src/interface/animatedJavaBarItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { createAction, createBarMenu } from '../util/moddingTools'
import { translate } from '../util/translation'
import { openAboutDialog } from './aboutDialog'
import { openBlueprintSettingsDialog } from './blueprintSettingsDialog'
import { openChangelogDialog } from './changelogDialog'

function createIconImg() {
const IMG = document.createElement('img')
Expand All @@ -24,12 +25,11 @@ function createIconImg() {
})
return IMG
}
const MENU_ID = `${PACKAGE.name}:menu` as `animated_java:menu`
const BLOCKBENCH_MENU_BAR = document.querySelector('#menu_bar') as HTMLDivElement
export const MENU = createBarMenu(
`${PACKAGE.name}:menu`,
[],
() => Format === BLUEPRINT_FORMAT
) as BarMenu & { label: HTMLDivElement }
export const MENU = createBarMenu(MENU_ID, [], () => Format === BLUEPRINT_FORMAT) as BarMenu & {
label: HTMLDivElement
}
MENU.label.style.display = 'inline-block'
MENU.label.innerHTML = 'Animated Java'
MENU.label.prepend(createIconImg())
Expand Down Expand Up @@ -59,6 +59,20 @@ MenuBar.addAction(
MENU.id
)

MenuBar.addAction(
createAction(`${PACKAGE.name}:changelog`, {
icon: 'history',
category: 'animated_java',
name: translate('action.open_changelog.name'),
click() {
openChangelogDialog()
},
}),
MENU.id
)

MENU.structure.push(new MenuSeparator())

MenuBar.addAction(
createAction(`${PACKAGE.name}:blueprint_settings`, {
icon: 'settings',
Expand All @@ -74,6 +88,32 @@ MenuBar.addAction(
MENU.id
)

MenuBar.menus[MENU_ID].structure.push({
id: 'animated_java:extract-open',
name: translate('action.extract.name'),
icon: 'fa-trash-can',
searchable: false,
children: [],
condition() {
return Format === BLUEPRINT_FORMAT
},
})

MenuBar.addAction(
createAction(`${PACKAGE.name}:extract`, {
icon: 'fa-trash-can',
category: 'animated_java',
name: translate('action.extract.confirm'),
condition() {
return Format === BLUEPRINT_FORMAT
},
click() {
void cleanupExportedFiles()
},
}),
MENU_ID + '.animated_java:extract-open'
)

MenuBar.addAction(
createAction(`${PACKAGE.name}:extract`, {
icon: 'fa-trash-can',
Expand Down
18 changes: 18 additions & 0 deletions src/interface/changelogDialog.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import ChangelogDialog from '../components/changelogDialog.svelte'
import { PACKAGE } from '../constants'
import { SvelteDialog } from '../util/svelteDialog'
import { translate } from '../util/translation'

export const DIALOG_ID = `${PACKAGE.name}:animationPropertiesDialog`

export function openChangelogDialog() {
new SvelteDialog({
id: DIALOG_ID,
title: translate('dialog.changelog_dialog.title'),
width: 600,
component: ChangelogDialog,
props: {},
buttons: ['OK!'],
preventKeybinds: true,
}).show()
}
13 changes: 12 additions & 1 deletion src/lang/en.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
### Actions
animated_java.action.open_blueprint_settings.name: Blueprint Settings
animated_java.action.open_documentation.name: Documentation
animated_java.action.open_changelog.name: Changelog
animated_java.action.open_about.name: About
animated_java.action.open_bone_config.name: Bone Config
animated_java.action.open_locator_config.name: Locator Config
animated_java.action.open_text_display_config.name: Text Display Config
animated_java.action.export.name: Export
animated_java.action.extract.name: Extract
animated_java.action.extract.confirm: Confirm Extraction
animated_java.action.create_text_display.title: Add Text Display
animated_java.action.create_vanilla_item_display.title: Add Item Display
animated_java.action.create_vanilla_block_display.title: Add Block Display
Expand All @@ -30,6 +32,9 @@ animated_java.dialog.reset: Reset to Default
animated_java.dialog.about.title: About Animated Java
animated_java.dialog.about.close_button: Close

## Changelog
animated_java.dialog.changelog_dialog.title: Changelog

## Unexpected Error Dialog
animated_java.dialog.unexpected_error.title: An Unexpected Error Occurred!
animated_java.dialog.unexpected_error.close_button: Close
Expand Down Expand Up @@ -584,12 +589,18 @@ animated_java.misc.failed_to_export.custom_models.message: You have disabled res
animated_java.misc.failed_to_export.blueprint_settings.message: There are errors in your blueprint settings! Please fix them before exporting.
animated_java.misc.failed_to_export.blueprint_settings.error_item: 'Found an issue with {0}:'
animated_java.misc.failed_to_export.button: Ok
misc.failed_to_export.invalid_rotation.message: |-
animated_java.misc.failed_to_export.invalid_rotation.message: |-
Some cubes in your model have an invalid rotations.
Cubes must have a rotation of -45, -22.5, 0, 22.5, or 45 degrees, and can only be rotated on a single axis at a time.
If you want to rotate a cube more precisely, or on multiple axes, you must put it into a bone and rotate the bone instead.
All of the invalid cubes are outlined in red in the editor.
Please fix these issues before exporting.
animated_java.misc.failed_to_export.rig_has_textures_but_no_custom_models.message: |-
You have textures applied to your model, but have no custom models (Cubes) to use them!
Please create some Cubes to use these textures, or remove the textures before exporting.
animated_java.misc.failed_to_export.rig_has_custom_models_but_no_textures.message: |-
You have custom models (Cubes) in your model, but have no textures applied to them!
Please apply textures to your Cubes, or remove the Cubes before exporting.
# Format Category
animated_java.format_category.animated_java: Animated Java
Expand Down
Loading

0 comments on commit 4482a54

Please sign in to comment.