Skip to content

Commit 0f777a9

Browse files
committed
actually fix packFormat beeing ignored
1 parent f5b80a7 commit 0f777a9

3 files changed

Lines changed: 8 additions & 5 deletions

File tree

src/emit/data/loot.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ export interface LootRules {
4949
}
5050

5151
export default class LootTableEmitter implements LootRules, ClearableEmitter {
52-
private readonly customTables = new CustomEmitter<LootTable>(this.tablePath)
53-
private readonly customModifiers = new CustomEmitter<LootModifier>(this.modifierPath)
52+
private readonly customTables = new CustomEmitter<LootTable>(it => this.tablePath(it))
53+
private readonly customModifiers = new CustomEmitter<LootModifier>(it => this.modifierPath(it))
5454

5555
private readonly ruled = new RuledEmitter<LootTable, LootTableRule>(
5656
this.logger,

src/emit/data/recipe.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export const EMPTY_RECIPE: RecipeDefinition = {
6666
}
6767

6868
export default class RecipeEmitter implements RecipeRules, ClearableEmitter {
69-
private readonly custom = new CustomEmitter<RecipeDefinition>(this.recipePath)
69+
private readonly custom = new CustomEmitter<RecipeDefinition>(it => this.recipePath(it))
7070

7171
private readonly ruled = new RuledEmitter<Recipe, RecipeRule>(
7272
this.logger,

test/packFormat.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,10 @@ describe('loader respects different pack format versions', () => {
1313

1414
await loader.emit(acceptor)
1515

16-
expect(acceptor.jsonAt('data/minecraft/loot_table/test.json')).toBe(EMPTY_LOOT_TABLE)
17-
expect(acceptor.jsonAt('data/minecraft/recipe/test.json')).toBe(EMPTY_RECIPE)
16+
expect(acceptor.jsonAt('data/example/loot_table/test.json')).toMatchObject(EMPTY_LOOT_TABLE)
17+
expect(acceptor.jsonAt('data/example/recipe/test.json')).toMatchObject(EMPTY_RECIPE)
18+
19+
expect(acceptor.jsonAt('data/example/loot_tables/test.json')).toBeNull()
20+
expect(acceptor.jsonAt('data/example/recipes/test.json')).toBeNull()
1821
})
1922
})

0 commit comments

Comments
 (0)