Skip to content

Commit

Permalink
🛠️ Fix export versioning issues
Browse files Browse the repository at this point in the history
- Realized that 1.21.0's data pack format is significantly different from 1.20.5.
  • Loading branch information
SnaveSutit committed Oct 22, 2024
1 parent cc364a7 commit b144da9
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/blueprintSettingsDialog.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@
label={translate('dialog.blueprint_settings.target_minecraft_version.title')}
tooltip={translate('dialog.blueprint_settings.target_minecraft_version.description')}
options={Object.fromEntries(Object.keys(mcbFiles).map(v => [v, v]))}
defaultOption={Object.keys(mcbFiles).at(-1) || '1.21.1'}
defaultOption={Object.keys(mcbFiles).at(-1) || '1.21.2'}
bind:value={targetMinecraftVersion}
/>

Expand Down
7 changes: 6 additions & 1 deletion src/systems/datapackCompiler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ async function generateRootEntityPassengers(rig: IRenderedRig, rigHash: string)
item.set('Count', new NbtInt(1))
break
}
case '1.20.5': {
case '1.20.5':
case '1.21.0': {
item.set(
'components',
new NbtCompound().set(
Expand Down Expand Up @@ -409,6 +410,10 @@ async function generateRootEntityPassengers(rig: IRenderedRig, rigHash: string)
}
break
}
default: {
// Skips nodes that are not actually riding the root entity.
continue
}
}

passengers.add(passenger)
Expand Down
6 changes: 5 additions & 1 deletion src/systems/datapackCompiler/mcbFiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import static_1_20_5 from './1.20.5/static.mcb'
import animation_1_21_2 from './1.21.2/animation.mcb'
import static_1_21_2 from './1.21.2/static.mcb'

export type MinecraftVersion = '1.20.4' | '1.20.5' | '1.21.2'
export type MinecraftVersion = '1.20.4' | '1.20.5' | '1.21.0' | '1.21.2'

export default {
'1.20.4': {
Expand All @@ -16,6 +16,10 @@ export default {
animation: animation_1_20_5,
static: static_1_20_5,
},
'1.21.0': {
animation: animation_1_20_5,
static: static_1_20_5,
},
'1.21.2': {
animation: animation_1_21_2,
static: static_1_21_2,
Expand Down
1 change: 1 addition & 0 deletions src/systems/resourcepackCompiler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ import _1_21_2 from './1.21.2'
export default {
'1.20.4': _1_20_5,
'1.20.5': _1_20_5,
'1.21.0': _1_20_5,
'1.21.2': _1_21_2,
}
4 changes: 3 additions & 1 deletion src/util/minecraftUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,10 @@ export function getDataPackFormat(version: MinecraftVersion): number {
return 26
case '1.20.5':
return 41
case '1.21.2':
case '1.21.0':
return 48
case '1.21.2':
return 57
default:
return Infinity
}
Expand Down

0 comments on commit b144da9

Please sign in to comment.