Skip to content

Commit 43bef3c

Browse files
committed
😭 Begin fixing the mess of conflicts
1 parent b721e42 commit 43bef3c

File tree

38 files changed

+6352
-1394
lines changed

38 files changed

+6352
-1394
lines changed

.yarn/install-state.gz

-6.39 KB
Binary file not shown.

eslint.config.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// @ts-expect-error
21
import checkFile from 'eslint-plugin-check-file'
32
import svelteEslint from 'eslint-plugin-svelte'
43
import svelteParser from 'svelte-eslint-parser'
@@ -64,7 +63,7 @@ const CUSTOM_RULES: ConfigWithExtends['rules'] = {
6463
'@typescript-eslint/no-explicit-any': 'off',
6564
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
6665
'@typescript-eslint/array-type': ['warn', { default: 'array-simple' }],
67-
'@typescript-eslint/consistent-indexed-object-style': ['warn', 'record'],
66+
'@typescript-eslint/consistent-indexed-object-style': ['warn', 'interface'],
6867
'@typescript-eslint/consistent-generic-constructors': 'warn',
6968
'@typescript-eslint/no-namespace': 'off',
7069
'@typescript-eslint/restrict-template-expressions': 'off',

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@
126126
"mc-build": "^3.5.1",
127127
"request-progress": "^3.0.0",
128128
"svelte-ace": "^1.0.21",
129-
"svelte-dnd-action": "^0.9.38"
129+
"svelte-dnd-action": "^0.9.38",
130+
"svelte-multiselect": "^11.1.1"
130131
},
131132
"packageManager": "yarn@4.6.0+sha512.5383cc12567a95f1d668fbe762dfe0075c595b4bfff433be478dbbe24e05251a8e8c3eb992a986667c1d53b6c3a9c85b8398c35a960587fbd9fa3a0915406728"
132133
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

src/blockbench-additions/model-formats/ajblueprint/dfu.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ function updateModelToOld1_0(model: any) {
105105
}
106106

107107
if (
108-
model.animations &&
109-
model.animations.find((a: any) =>
108+
model.animations?.find((a: any) =>
110109
Object.keys(a.animators as Record<string, any>).find(name => name === 'effects')
111110
)
112111
) {
@@ -197,7 +196,7 @@ function updateModelToOld1_4(model: any) {
197196
}
198197

199198
// region v0.3.10
200-
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars
199+
// eslint-disable-next-line @typescript-eslint/naming-convention
201200
function updateModelTo0_3_10(model: any) {
202201
console.log('Processing model for AJ 0.3.10', JSON.parse(JSON.stringify(model)))
203202
}
@@ -218,7 +217,7 @@ function updateModelTo1_0pre1(model: any) {
218217
meta: {
219218
format: 'animated_java_blueprint',
220219
format_version: '0.5.0',
221-
uuid: model.meta.uuid || guid(),
220+
uuid: model.meta.uuid ?? guid(),
222221
last_used_export_namespace: model.animated_java.settings.project_namespace,
223222
},
224223
project_settings: {
@@ -258,9 +257,9 @@ function updateModelTo1_0pre1(model: any) {
258257
variants: {
259258
default: {
260259
name: 'default',
261-
display_name: defaultVariant.name || 'Default',
262-
uuid: defaultVariant.uuid || guid(),
263-
texture_map: defaultVariant.textureMap || {},
260+
display_name: defaultVariant.name ?? 'Default',
261+
uuid: defaultVariant.uuid ?? guid(),
262+
texture_map: defaultVariant.textureMap ?? {},
264263
// @ts-ignore
265264
excluded_bones: [],
266265
},
@@ -413,14 +412,14 @@ function updateModelTo1_0pre6(model: any): IBlueprintFormatJSON {
413412
delete defaultVariant.excluded_bones
414413
}
415414

416-
for (const variant of model?.variants?.list || []) {
415+
for (const variant of model?.variants?.list ?? []) {
417416
if (variant?.excluded_bones) {
418417
variant.excluded_nodes = variant.excluded_bones
419418
delete variant.excluded_bones
420419
}
421420
}
422421

423-
for (const animation of model?.animations || []) {
422+
for (const animation of model?.animations ?? []) {
424423
if (animation?.excluded_bones) {
425424
animation.excluded_nodes = animation.excluded_bones
426425
delete animation.excluded_bones

src/blockbench-additions/model-formats/ajblueprint/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import EVENTS from '@aj/util/events'
22
import * as blueprintSettings from '../../../blueprintSettings'
33
import { PACKAGE } from '../../../constants'
44
import { injectSvelteCompomponent } from '../../../util/injectSvelteComponent'
5-
import { toSafeFunctionName } from '../../../util/minecraftUtil'
5+
import { sanitizePathName } from '../../../util/minecraftUtil'
66
import { addProjectToRecentProjects } from '../../../util/misc'
77
import { Syncable } from '../../../util/stores'
88
import { translate } from '../../../util/translation'
@@ -99,7 +99,7 @@ export function convertToBlueprint() {
9999
}
100100
for (const animation of Blockbench.Animation.all) {
101101
animation.createUniqueName(Blockbench.Animation.all.filter(a => a !== animation))
102-
animation.name = toSafeFunctionName(animation.name)
102+
animation.name = sanitizePathName(animation.name)
103103
}
104104
for (const cube of Cube.all) {
105105
cube.setUVMode(false)
@@ -274,7 +274,7 @@ export const BLUEPRINT_CODEC = new Blockbench.Codec('animated_java_blueprint', {
274274
parseGroups(model.outliner)
275275

276276
for (const group of Group.all) {
277-
group.name = toSafeFunctionName(group.name)
277+
group.name = sanitizePathName(group.name)
278278
}
279279
}
280280

@@ -346,7 +346,7 @@ export const BLUEPRINT_CODEC = new Blockbench.Codec('animated_java_blueprint', {
346346

347347
// region > compile
348348
compile(options) {
349-
if (!options) options = {}
349+
options ??= {}
350350
console.log(`Compiling Animated Java Blueprint from ${Project!.name}...`)
351351
if (!Project) throw new Error('No project to compile.')
352352

src/blockbench-additions/outliner-elements/itemDisplay.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { getCurrentVersion } from '@aj/systems/minecraft-temp/versionManager'
44
import { CommonDisplayConfig, ItemDisplayConfig, type Serialized } from '@aj/systems/node-configs'
55
import EVENTS from '@events'
66
import { PACKAGE } from '../../constants'
7-
import { VANILLA_ITEM_DISPLAY_CONFIG_ACTION } from '../../ui/dialogs/item-display-config'
87
import {
98
createAction,
109
createBlockbenchMod,
@@ -47,7 +46,7 @@ export class ItemDisplay extends ResizableOutlinerElement {
4746

4847
public menu = new Menu([
4948
...Outliner.control_menu_group,
50-
VANILLA_ITEM_DISPLAY_CONFIG_ACTION,
49+
ITEM_DISPLAY_CONFIG_ACTION,
5150
'_',
5251
'rename',
5352
'delete',

src/blockbench-additions/outliner-elements/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { sanitizePathName } from '../util/minecraftUtil'
1+
import { sanitizePathName } from '@aj/util/minecraftUtil'
22
import { BlockDisplay } from './blockDisplay'
33
import { ItemDisplay } from './itemDisplay'
44
import { TextDisplay } from './textDisplay'

src/components/keyframePanels/commandsKeyframePanel.svelte

Lines changed: 0 additions & 97 deletions
This file was deleted.

src/svelte-components/multiSelect.svelte renamed to src/svelte-components/dialog-items/multiSelect.svelte

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
<script lang="ts">
22
import MultiSelect, { type ObjectOption } from 'svelte-multiselect'
3-
import { Valuable } from '../../util/stores'
3+
import { Syncable } from '../../util/stores'
44
import { translate } from '../../util/translation'
55
import BaseDialogItem from './baseDialogItem.svelte'
66
77
type StringOption = ObjectOption & { value: string }
88
99
export let label: string
10-
export let tooltip: string = ''
10+
export let tooltip = ''
1111
export let options: StringOption[]
1212
export let defaultValue: StringOption[]
13-
export let value: Valuable<string[]>
13+
export let value: Syncable<string[]>
1414
1515
let selected: StringOption[] = $value
1616
.filter(v => options.find(o => o.value == v))
1717
.map(v => options.find(o => o.value == v)!)
1818
19-
let warning_text = ''
19+
let warningText = ''
2020
2121
if (selected.length === 0) {
2222
selected = defaultValue
@@ -31,11 +31,11 @@
3131
// FIXME - This warning is unique to the targeted minecraft version setting.
3232
// Since the only use of this component is in the targeted minecraft version setting, this is fine... for now.
3333
if (selected.length > 1) {
34-
warning_text = translate(
34+
warningText = translate(
3535
'dialog.blueprint_settings.target_minecraft_versions.warning.multiple_versions'
3636
)
3737
} else {
38-
warning_text = ''
38+
warningText = ''
3939
}
4040
}
4141
@@ -48,7 +48,7 @@
4848
}
4949
</script>
5050

51-
<BaseDialogItem {label} {tooltip} {onReset} let:id {warning_text}>
51+
<BaseDialogItem {label} {tooltip} {onReset} let:id {warningText}>
5252
<div class="dialog_bar form_bar multi-select-container">
5353
<label class="name_space_left" for={id}>{label}</label>
5454
<MultiSelect

0 commit comments

Comments
 (0)