Skip to content

Commit b144da9

Browse files
committed
🛠️ Fix export versioning issues
- Realized that 1.21.0's data pack format is significantly different from 1.20.5.
1 parent cc364a7 commit b144da9

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

src/components/blueprintSettingsDialog.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@
566566
label={translate('dialog.blueprint_settings.target_minecraft_version.title')}
567567
tooltip={translate('dialog.blueprint_settings.target_minecraft_version.description')}
568568
options={Object.fromEntries(Object.keys(mcbFiles).map(v => [v, v]))}
569-
defaultOption={Object.keys(mcbFiles).at(-1) || '1.21.1'}
569+
defaultOption={Object.keys(mcbFiles).at(-1) || '1.21.2'}
570570
bind:value={targetMinecraftVersion}
571571
/>
572572

src/systems/datapackCompiler/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@ async function generateRootEntityPassengers(rig: IRenderedRig, rigHash: string)
293293
item.set('Count', new NbtInt(1))
294294
break
295295
}
296-
case '1.20.5': {
296+
case '1.20.5':
297+
case '1.21.0': {
297298
item.set(
298299
'components',
299300
new NbtCompound().set(
@@ -409,6 +410,10 @@ async function generateRootEntityPassengers(rig: IRenderedRig, rigHash: string)
409410
}
410411
break
411412
}
413+
default: {
414+
// Skips nodes that are not actually riding the root entity.
415+
continue
416+
}
412417
}
413418

414419
passengers.add(passenger)

src/systems/datapackCompiler/mcbFiles.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import static_1_20_5 from './1.20.5/static.mcb'
55
import animation_1_21_2 from './1.21.2/animation.mcb'
66
import static_1_21_2 from './1.21.2/static.mcb'
77

8-
export type MinecraftVersion = '1.20.4' | '1.20.5' | '1.21.2'
8+
export type MinecraftVersion = '1.20.4' | '1.20.5' | '1.21.0' | '1.21.2'
99

1010
export default {
1111
'1.20.4': {
@@ -16,6 +16,10 @@ export default {
1616
animation: animation_1_20_5,
1717
static: static_1_20_5,
1818
},
19+
'1.21.0': {
20+
animation: animation_1_20_5,
21+
static: static_1_20_5,
22+
},
1923
'1.21.2': {
2024
animation: animation_1_21_2,
2125
static: static_1_21_2,

src/systems/resourcepackCompiler/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ import _1_21_2 from './1.21.2'
44
export default {
55
'1.20.4': _1_20_5,
66
'1.20.5': _1_20_5,
7+
'1.21.0': _1_20_5,
78
'1.21.2': _1_21_2,
89
}

src/util/minecraftUtil.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,10 @@ export function getDataPackFormat(version: MinecraftVersion): number {
224224
return 26
225225
case '1.20.5':
226226
return 41
227-
case '1.21.2':
227+
case '1.21.0':
228228
return 48
229+
case '1.21.2':
230+
return 57
229231
default:
230232
return Infinity
231233
}

0 commit comments

Comments
 (0)