Skip to content

Commit e5c82bf

Browse files
committed
🐛 Fix unchanged variant bones pointing at missing models on 1.21.2
- item_model rewrite skipped bones that reuse the default model
1 parent 7eb7f74 commit e5c82bf

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/systems/resourcepackCompiler/1.21.2.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,19 @@ const compileResourcePack: ResourcePackCompiler = async ({
112112
for (const variant of Object.values(rig.variants)) {
113113
for (const [boneUuid, variantModel] of Object.entries(variant.models)) {
114114
const bone = rig.nodes[boneUuid] as IRenderedNodes['Bone']
115+
// Hacky workaround for this version enforcing the `item` namespace. Applies to
116+
// unchanged bones too, which point at the default model.
117+
variantModel.item_model = variantModel.item_model.replace(':blueprint/', ':')
115118
if (variantModel.custom_model_data !== -1) continue
116119
const exportPath = variant.is_default
117120
? PathModule.join(correctedModelExportFolder, bone.name + '.json')
118121
: PathModule.join(correctedModelExportFolder, variant.name, bone.name + '.json')
119-
// Hacky workaround for this version enforcing the `item` namespace.
120122
if (variantModel.model?.parent) {
121123
variantModel.model.parent = variantModel.model.parent.replace(
122124
':blueprint/',
123125
':item/'
124126
)
125127
}
126-
variantModel.item_model = variantModel.item_model.replace(':blueprint/', ':')
127128
console.log('Exporting model', variantModel.model, 'to', exportPath)
128129
versionedFiles.set(PathModule.join(exportPath), {
129130
content: autoStringify(variantModel.model),

0 commit comments

Comments
 (0)