Skip to content

Commit 88df18d

Browse files
committed
🐛 Fix display item model merging in 1.20.4
1 parent 8011ebb commit 88df18d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/systems/resourcepackCompiler/1.20.4.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ const compileResourcePack: ResourcePackCompiler = async ({
131131
coreFiles,
132132
versionedFiles,
133133
rig,
134+
resourcePackPath,
134135
displayItemPath,
135136
textureExportFolder,
136137
modelExportFolder,
@@ -150,9 +151,10 @@ const compileResourcePack: ResourcePackCompiler = async ({
150151

151152
// Display Item
152153
const displayItemModel = new PredicateItemModel()
153-
if (fs.existsSync(displayItemPath)) {
154+
const absoluteDisplayItemPath = PathModule.join(resourcePackPath, displayItemPath)
155+
if (fs.existsSync(absoluteDisplayItemPath)) {
154156
console.warn('Display item already exists! Attempting to merge...')
155-
displayItemModel.readExisting(displayItemPath)
157+
displayItemModel.readExisting(absoluteDisplayItemPath)
156158
}
157159

158160
displayItemModel.lastOverrideId = Math.max(

src/systems/resourcepackCompiler/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ interface ResourcePackCompilerOptions {
2727
coreFiles: Map<string, ExportedFile>
2828
versionedFiles: Map<string, ExportedFile>
2929
rig: IRenderedRig
30+
resourcePackPath: string
3031
displayItemPath: string
3132
textureExportFolder: string
3233
modelExportFolder: string
@@ -81,6 +82,7 @@ export default async function compileResourcePack(
8182
// Move paths into versioned overlay folders.
8283
await VERSIONED_RESOURCE_PACK_COMPILERS[version]({
8384
...options,
85+
resourcePackPath: versionedResourcePackFolder,
8486
ajmeta,
8587
coreFiles,
8688
versionedFiles,

0 commit comments

Comments
 (0)