@adeficior/data-modifier 1.0.0-rc.14 → 1.0.0-rc.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. package/dist/common/{predicates.d.ts → filters.d.ts} +3 -3
  2. package/dist/common/{predicates.js → filters.js} +3 -3
  3. package/dist/common/filters.js.map +1 -0
  4. package/dist/common/id.d.ts +3 -0
  5. package/dist/common/id.js +6 -1
  6. package/dist/common/id.js.map +1 -1
  7. package/dist/common/ingredient/filter.d.ts +3 -3
  8. package/dist/common/ingredient/filter.js +20 -59
  9. package/dist/common/ingredient/filter.js.map +1 -1
  10. package/dist/common/ingredient/index.d.ts +35 -27
  11. package/dist/common/ingredient/index.js +57 -37
  12. package/dist/common/ingredient/index.js.map +1 -1
  13. package/dist/common/ingredient/serializer.js +1 -1
  14. package/dist/common/ingredient/serializer.js.map +1 -1
  15. package/dist/common/result/filter.d.ts +3 -3
  16. package/dist/common/result/filter.js +12 -35
  17. package/dist/common/result/filter.js.map +1 -1
  18. package/dist/common/result/index.d.ts +20 -16
  19. package/dist/common/result/index.js +25 -17
  20. package/dist/common/result/index.js.map +1 -1
  21. package/dist/common/result/serializer.js +1 -1
  22. package/dist/common/result/serializer.js.map +1 -1
  23. package/dist/common/serializable.d.ts +5 -2
  24. package/dist/emit/assets/lang.js.map +1 -1
  25. package/dist/emit/blacklist.d.ts +3 -3
  26. package/dist/emit/blacklist.js +2 -2
  27. package/dist/emit/blacklist.js.map +1 -1
  28. package/dist/emit/data/loot.d.ts +9 -9
  29. package/dist/emit/data/loot.js +3 -3
  30. package/dist/emit/data/loot.js.map +1 -1
  31. package/dist/emit/data/recipe.d.ts +13 -13
  32. package/dist/emit/data/recipe.js +5 -5
  33. package/dist/emit/data/recipe.js.map +1 -1
  34. package/dist/emit/data/tags.d.ts +4 -4
  35. package/dist/emit/data/tags.js +1 -1
  36. package/dist/emit/data/tags.js.map +1 -1
  37. package/dist/emit/rule/lootTable.d.ts +1 -1
  38. package/dist/emit/rule/lootTable.js.map +1 -1
  39. package/dist/emit/rule/recipe.d.ts +1 -1
  40. package/dist/emit/rule/recipe.js.map +1 -1
  41. package/dist/loader/index.d.ts +4 -3
  42. package/dist/loader/index.js +7 -3
  43. package/dist/loader/index.js.map +1 -1
  44. package/dist/loader/lang.d.ts +1 -2
  45. package/dist/loader/lang.js +1 -1
  46. package/dist/loader/lang.js.map +1 -1
  47. package/dist/loader/loot.d.ts +1 -2
  48. package/dist/loader/loot.js +2 -2
  49. package/dist/loader/loot.js.map +1 -1
  50. package/dist/loader/pack.d.ts +2 -2
  51. package/dist/loader/pack.js +13 -12
  52. package/dist/loader/pack.js.map +1 -1
  53. package/dist/loader/recipe.d.ts +5 -4
  54. package/dist/loader/recipe.js +17 -28
  55. package/dist/loader/recipe.js.map +1 -1
  56. package/dist/loader/registry/dump.js +3 -3
  57. package/dist/loader/registry/dump.js.map +1 -1
  58. package/dist/loader/tags.d.ts +2 -2
  59. package/dist/loader/tags.js +1 -1
  60. package/dist/loader/tags.js.map +1 -1
  61. package/dist/parser/index.d.ts +1 -1
  62. package/dist/parser/index.js.map +1 -1
  63. package/dist/parser/lootTable.d.ts +1 -1
  64. package/dist/parser/lootTable.js +2 -2
  65. package/dist/parser/lootTable.js.map +1 -1
  66. package/dist/parser/recipe/adAstra/conversion.d.ts +2 -2
  67. package/dist/parser/recipe/adAstra/conversion.js +2 -2
  68. package/dist/parser/recipe/adAstra/conversion.js.map +1 -1
  69. package/dist/parser/recipe/adAstra/inputOutput.d.ts +3 -3
  70. package/dist/parser/recipe/adAstra/inputOutput.js +5 -5
  71. package/dist/parser/recipe/adAstra/inputOutput.js.map +1 -1
  72. package/dist/parser/recipe/adAstra/spaceStation.d.ts +2 -2
  73. package/dist/parser/recipe/adAstra/spaceStation.js +2 -2
  74. package/dist/parser/recipe/adAstra/spaceStation.js.map +1 -1
  75. package/dist/parser/recipe/botania/apothecary.d.ts +2 -2
  76. package/dist/parser/recipe/botania/apothecary.js +2 -2
  77. package/dist/parser/recipe/botania/apothecary.js.map +1 -1
  78. package/dist/parser/recipe/botania/brew.d.ts +2 -2
  79. package/dist/parser/recipe/botania/brew.js +2 -2
  80. package/dist/parser/recipe/botania/brew.js.map +1 -1
  81. package/dist/parser/recipe/botania/gogWrapper.d.ts +4 -6
  82. package/dist/parser/recipe/botania/gogWrapper.js +2 -2
  83. package/dist/parser/recipe/botania/gogWrapper.js.map +1 -1
  84. package/dist/parser/recipe/botania/manaInfusion.d.ts +2 -2
  85. package/dist/parser/recipe/botania/manaInfusion.js +2 -2
  86. package/dist/parser/recipe/botania/manaInfusion.js.map +1 -1
  87. package/dist/parser/recipe/botania/nbtWrapper.d.ts +4 -6
  88. package/dist/parser/recipe/botania/nbtWrapper.js +2 -2
  89. package/dist/parser/recipe/botania/nbtWrapper.js.map +1 -1
  90. package/dist/parser/recipe/create/assembly.d.ts +2 -2
  91. package/dist/parser/recipe/create/assembly.js +3 -3
  92. package/dist/parser/recipe/create/assembly.js.map +1 -1
  93. package/dist/parser/recipe/farmersdelight/cooking.d.ts +2 -2
  94. package/dist/parser/recipe/farmersdelight/cooking.js +2 -2
  95. package/dist/parser/recipe/farmersdelight/cooking.js.map +1 -1
  96. package/dist/parser/recipe/farmersdelight/cutting.d.ts +2 -2
  97. package/dist/parser/recipe/farmersdelight/cutting.js +2 -2
  98. package/dist/parser/recipe/farmersdelight/cutting.js.map +1 -1
  99. package/dist/parser/recipe/forge/conditional.d.ts +4 -6
  100. package/dist/parser/recipe/forge/conditional.js +2 -2
  101. package/dist/parser/recipe/forge/conditional.js.map +1 -1
  102. package/dist/parser/recipe/index.d.ts +7 -3
  103. package/dist/parser/recipe/index.js +10 -4
  104. package/dist/parser/recipe/index.js.map +1 -1
  105. package/dist/parser/recipe/manyToMany.d.ts +2 -2
  106. package/dist/parser/recipe/manyToMany.js +2 -2
  107. package/dist/parser/recipe/manyToMany.js.map +1 -1
  108. package/dist/parser/recipe/manyToOne.d.ts +2 -2
  109. package/dist/parser/recipe/manyToOne.js +2 -2
  110. package/dist/parser/recipe/manyToOne.js.map +1 -1
  111. package/dist/parser/recipe/oneToOne.d.ts +2 -2
  112. package/dist/parser/recipe/oneToOne.js +2 -2
  113. package/dist/parser/recipe/oneToOne.js.map +1 -1
  114. package/dist/parser/recipe/roots/component.d.ts +2 -2
  115. package/dist/parser/recipe/roots/component.js +2 -2
  116. package/dist/parser/recipe/roots/component.js.map +1 -1
  117. package/dist/parser/recipe/roots/ritual.d.ts +2 -2
  118. package/dist/parser/recipe/roots/ritual.js +2 -2
  119. package/dist/parser/recipe/roots/ritual.js.map +1 -1
  120. package/dist/parser/recipe/thermal/catalyst.d.ts +2 -2
  121. package/dist/parser/recipe/thermal/catalyst.js +2 -2
  122. package/dist/parser/recipe/thermal/catalyst.js.map +1 -1
  123. package/dist/parser/recipe/thermal/fuel.d.ts +2 -2
  124. package/dist/parser/recipe/thermal/fuel.js +2 -2
  125. package/dist/parser/recipe/thermal/fuel.js.map +1 -1
  126. package/dist/parser/recipe/thermal/index.d.ts +2 -2
  127. package/dist/parser/recipe/thermal/index.js +2 -2
  128. package/dist/parser/recipe/thermal/index.js.map +1 -1
  129. package/dist/parser/recipe/thermal/treeExtraction.d.ts +2 -2
  130. package/dist/parser/recipe/thermal/treeExtraction.js +2 -2
  131. package/dist/parser/recipe/thermal/treeExtraction.js.map +1 -1
  132. package/dist/parser/recipe/vanilla/shaped.d.ts +3 -4
  133. package/dist/parser/recipe/vanilla/shaped.js +2 -2
  134. package/dist/parser/recipe/vanilla/shaped.js.map +1 -1
  135. package/dist/parser/recipe/vanilla/smelting.d.ts +2 -2
  136. package/dist/parser/recipe/vanilla/smelting.js +2 -2
  137. package/dist/parser/recipe/vanilla/smelting.js.map +1 -1
  138. package/dist/parser/recipe/vanilla/smithing.d.ts +2 -2
  139. package/dist/parser/recipe/vanilla/smithing.js +2 -2
  140. package/dist/parser/recipe/vanilla/smithing.js.map +1 -1
  141. package/dist/parser/recipe/vanilla/stonecutting.d.ts +2 -2
  142. package/dist/parser/recipe/vanilla/stonecutting.js +3 -3
  143. package/dist/parser/recipe/vanilla/stonecutting.js.map +1 -1
  144. package/package.json +9 -6
  145. package/dist/common/predicates.js.map +0 -1
@@ -31,15 +31,21 @@ export class RecipeHolder {
31
31
  return this.recipe.getResults();
32
32
  }
33
33
  // TODO rename modifiy & add modifier object
34
- replace(ingredientReplacer, resultReplacer) {
35
- const modified = this.recipe.replace(ingredientReplacer, resultReplacer);
34
+ replace(modifier) {
35
+ const modified = this.recipe.replace(modifier);
36
36
  return new RecipeHolder(this.definition, modified);
37
37
  }
38
38
  replaceIngredient(replace) {
39
- return this.replace(replace, keep());
39
+ return this.replace({
40
+ ingredient: replace,
41
+ result: keep(),
42
+ });
40
43
  }
41
44
  replaceResult(replace) {
42
- return this.replace(keep(), replace);
45
+ return this.replace({
46
+ ingredient: keep(),
47
+ result: replace,
48
+ });
43
49
  }
44
50
  getTypes() {
45
51
  return [this.type, ...this.recipe.additionalTypes()];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/parser/recipe/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAqB,MAAM,oBAAoB,CAAC;AASjE,MAAM,UAAU,cAAc,CAAI,IAAkB,EAAE,EAAK;IACzD,OAAO,CAAC,EAAK,EAAE,EAAE;QACf,IAAI,IAAI,CAAC,EAAE,CAAC;YAAE,OAAO,EAAE,CAAC;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,IAAI;IACX,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,MAAM,OAAO,YAAY;IAIJ;IACA;IAJF,IAAI,CAAe;IAEpC,YACmB,UAA4B,EAC5B,MAAc;QADd,eAAU,GAAV,UAAU,CAAkB;QAC5B,WAAM,GAAN,MAAM,CAAQ;QAE/B,IAAI,CAAC,IAAI,GA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EAAE,OAAO;SAChB,CAAC,CAAC;IACL,CAAC;IAED,QAAQ;QACN,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,CAAC;IACvD,CAAC;CACF;AAED,MAAM,OAAgB,MAAM;IAO1B,eAAe;QACb,OAAO,EAAE,CAAC;IACZ,CAAC;CAGF;AAcD,MAAM,CAAC,OAAO,OAAgB,YAAY;CAQzC"}
@@ -1,7 +1,7 @@
1
1
  import type { Ingredient } from "../../common/ingredient/index.js";
2
2
  import type { Result } from "../../common/result/index.js";
3
3
  import type { RecipeDefinition } from "../../schema/data/recipe.js";
4
- import RecipeParser, { Recipe, type RecipeParseContext, type Replacer } from "./index.js";
4
+ import RecipeParser, { Recipe, type RecipeModifier, type RecipeParseContext } from "./index.js";
5
5
  export type ManyToManyRecipeDefinition = RecipeDefinition & Readonly<{
6
6
  ingredients: unknown[];
7
7
  results: unknown[];
@@ -12,7 +12,7 @@ export declare class ManyToManyRecipe extends Recipe {
12
12
  constructor(ingredients: Ingredient[], results: Result[]);
13
13
  getIngredients(): Ingredient[];
14
14
  getResults(): Result[];
15
- replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): ManyToManyRecipe;
15
+ replace(modifier: RecipeModifier): ManyToManyRecipe;
16
16
  serialize(context: RecipeParseContext): Partial<ManyToManyRecipeDefinition>;
17
17
  }
18
18
  export declare class ManyToManyRecipeParser<TDefinition extends ManyToManyRecipeDefinition> extends RecipeParser<TDefinition, ManyToManyRecipe> {
@@ -13,8 +13,8 @@ export class ManyToManyRecipe extends Recipe {
13
13
  getResults() {
14
14
  return this.results;
15
15
  }
16
- replace(ingredientReplacer, resultReplacer) {
17
- return new ManyToManyRecipe(this.ingredients.map(ingredientReplacer), this.results.map(resultReplacer));
16
+ replace(modifier) {
17
+ return new ManyToManyRecipe(this.ingredients.map(modifier.ingredient), this.results.map(modifier.result));
18
18
  }
19
19
  serialize(context) {
20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7 +1,7 @@
1
1
  import type { Ingredient } from "../../common/ingredient/index.js";
2
2
  import type { Result } from "../../common/result/index.js";
3
3
  import type { RecipeDefinition } from "../../schema/data/recipe.js";
4
- import RecipeParser, { Recipe, type RecipeParseContext, type Replacer } from "./index.js";
4
+ import RecipeParser, { Recipe, type RecipeModifier, type RecipeParseContext } from "./index.js";
5
5
  export type ManyToOneRecipeDefinition = RecipeDefinition & Readonly<{
6
6
  ingredients: unknown[];
7
7
  result: unknown;
@@ -12,7 +12,7 @@ export declare class ManyToOneRecipe extends Recipe {
12
12
  constructor(ingredients: Ingredient[], result: Result);
13
13
  getIngredients(): Ingredient[];
14
14
  getResults(): Result[];
15
- replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): ManyToOneRecipe;
15
+ replace(modifier: RecipeModifier): ManyToOneRecipe;
16
16
  serialize(context: RecipeParseContext): Partial<ManyToOneRecipeDefinition>;
17
17
  }
18
18
  export declare class ManyToOneRecipeParser<TDefinition extends ManyToOneRecipeDefinition> extends RecipeParser<TDefinition, ManyToOneRecipe> {
@@ -13,8 +13,8 @@ export class ManyToOneRecipe extends Recipe {
13
13
  getResults() {
14
14
  return [this.result];
15
15
  }
16
- replace(ingredientReplacer, resultReplacer) {
17
- return new ManyToOneRecipe(this.ingredients.map(ingredientReplacer), resultReplacer(this.result));
16
+ replace(modifier) {
17
+ return new ManyToOneRecipe(this.ingredients.map(modifier.ingredient), modifier.result(this.result));
18
18
  }
19
19
  serialize(context) {
20
20
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"manyToOne.js","sourceRoot":"","sources":["../../../src/parser/recipe/manyToOne.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EACnB,MAAM,GAGP,MAAM,YAAY,CAAC;AAQpB,MAAM,OAAO,eAAgB,SAAQ,MAAM;IAEpB;IACA;IAFrB,YACqB,WAAyB,EACzB,MAAc;QAEjC,KAAK,EAAE,CAAC;QAHW,gBAAW,GAAX,WAAW,CAAc;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,CAAQ;IAGnC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAEQ,OAAO,CAAC,QAAwB;QACvC,OAAO,IAAI,eAAe,CACxB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,EACzC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAC7B,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9C,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;SACjE,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,qBAEX,SAAQ,YAA0C;IAClD,WAAW,CACT,UAAuB,EACvB,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,eAAe,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;CACF"}
@@ -1,7 +1,7 @@
1
1
  import type { Ingredient } from "../../common/ingredient/index.js";
2
2
  import type { Result } from "../../common/result/index.js";
3
3
  import type { RecipeDefinition } from "../../schema/data/recipe.js";
4
- import RecipeParser, { Recipe, type RecipeParseContext, type Replacer } from "./index.js";
4
+ import RecipeParser, { Recipe, type RecipeModifier, type RecipeParseContext } from "./index.js";
5
5
  export type OneToOneRecipeDefinition = RecipeDefinition & Readonly<{
6
6
  ingredient: unknown;
7
7
  result: unknown;
@@ -12,7 +12,7 @@ export declare class OneToOneRecipe extends Recipe {
12
12
  constructor(ingredient: Ingredient, result: Result);
13
13
  getIngredients(): Ingredient[];
14
14
  getResults(): Result[];
15
- replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): OneToOneRecipe;
15
+ replace(modifier: RecipeModifier): OneToOneRecipe;
16
16
  serialize(context: RecipeParseContext): Partial<OneToOneRecipeDefinition>;
17
17
  }
18
18
  export declare class OneToOneRecipeParser<TDefinition extends OneToOneRecipeDefinition> extends RecipeParser<TDefinition, OneToOneRecipe> {
@@ -13,8 +13,8 @@ export class OneToOneRecipe extends Recipe {
13
13
  getResults() {
14
14
  return [this.result];
15
15
  }
16
- replace(ingredientReplacer, resultReplacer) {
17
- return new OneToOneRecipe(ingredientReplacer(this.ingredient), resultReplacer(this.result));
16
+ replace(modifier) {
17
+ return new OneToOneRecipe(modifier.ingredient(this.ingredient), modifier.result(this.result));
18
18
  }
19
19
  serialize(context) {
20
20
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"oneToOne.js","sourceRoot":"","sources":["../../../src/parser/recipe/oneToOne.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EACnB,MAAM,GAGP,MAAM,YAAY,CAAC;AAQpB,MAAM,OAAO,cAAe,SAAQ,MAAM;IAEnB;IACA;IAFrB,YACqB,UAAsB,EACtB,MAAc;QAEjC,KAAK,EAAE,CAAC;QAHW,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAQ;IAGnC,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAEQ,OAAO,CACd,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,cAAc,CACvB,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,EACnC,cAAc,CAAC,IAAI,CAAC,MAAM,CA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;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9C,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,oBAEX,SAAQ,YAAyC;IACjD,WAAW,CACT,UAAuB,EACvB,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  import type { Ingredient } from "../../../common/ingredient/index.js";
2
2
  import type { RecipeDefinition } from "../../../schema/data/recipe.js";
3
- import type { RecipeParseContext, Replacer } from "../index.js";
3
+ import type { RecipeModifier, RecipeParseContext } from "../index.js";
4
4
  import RecipeParser, { Recipe } from "../index.js";
5
5
  export type RootComponentRecipeDefinition = RecipeDefinition & Readonly<{
6
6
  effect: string;
@@ -11,7 +11,7 @@ export declare class RootComponentRecipe extends Recipe {
11
11
  constructor(ingredients: Ingredient[]);
12
12
  getIngredients(): Ingredient[];
13
13
  getResults(): never[];
14
- replace(ingredientReplacer: Replacer<Ingredient>): RootComponentRecipe;
14
+ replace(modifier: RecipeModifier): RootComponentRecipe;
15
15
  serialize(context: RecipeParseContext): Partial<RootComponentRecipeDefinition>;
16
16
  }
17
17
  export declare class RootComponentRecipeParser extends RecipeParser<RootComponentRecipeDefinition, RootComponentRecipe> {
@@ -11,8 +11,8 @@ export class RootComponentRecipe extends Recipe {
11
11
  getResults() {
12
12
  return [];
13
13
  }
14
- replace(ingredientReplacer) {
15
- return new RootComponentRecipe(this.ingredients.map(ingredientReplacer));
14
+ replace(modifier) {
15
+ return new RootComponentRecipe(this.ingredients.map(modifier.ingredient));
16
16
  }
17
17
  serialize(context) {
18
18
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/parser/recipe/roots/component.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQnD,MAAM,OAAO,mBAAoB,SAAQ,MAAM;IAChB;IAA7B,YAA6B,WAAyB;QACpD,KAAK,EAAE,CAAC;QADmB,gBAAW,GAAX,WAAW,CAAc;IAEtD,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,OAAO,CAAC,kBAAwC;QACvD,OAAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAC3E,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;SACjE,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,yBAA0B,SAAQ,YAG9C;IACC,WAAW,CACT,UAAyC,EACzC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3E,OAAO,IAAI,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC9C,CAAC;CACF"}
1
+ {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../src/parser/recipe/roots/component.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQnD,MAAM,OAAO,mBAAoB,SAAQ,MAAM;IAChB;IAA7B,YAA6B,WAAyB;QACpD,KAAK,EAAE,CAAC;QADmB,gBAAW,GAAX,WAAW,CAAc;IAEtD,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,OAAO,CAAC,QAAwB;QACvC,OAAO,IAAI,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;IAC5E,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,IAAI,CAAC,WAAW,CAAC;SACjE,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,yBAA0B,SAAQ,YAG9C;IACC,WAAW,CACT,UAAyC,EACzC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3E,OAAO,IAAI,mBAAmB,CAAC,WAAW,CAAC,CAAC;IAC9C,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  import type { Ingredient } from "../../../common/ingredient/index.js";
2
2
  import type { Result } from "../../../common/result/index.js";
3
- import type { RecipeParseContext, Replacer } from "../index.js";
3
+ import type { RecipeModifier, RecipeParseContext } from "../index.js";
4
4
  import RecipeParser from "../index.js";
5
5
  import { ManyToOneRecipe, type ManyToOneRecipeDefinition } from "../manyToOne.js";
6
6
  export type RootRitualRecipeDefinition = ManyToOneRecipeDefinition & Readonly<{
@@ -13,7 +13,7 @@ export declare class RootRitualRecipe extends ManyToOneRecipe {
13
13
  private readonly incenses;
14
14
  constructor(ingredients: Ingredient[], result: Result, incenses?: Ingredient[]);
15
15
  getIngredients(): Ingredient[];
16
- replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): RootRitualRecipe;
16
+ replace(modifier: RecipeModifier): RootRitualRecipe;
17
17
  }
18
18
  export declare class RootRitualRecipeParser extends RecipeParser<RootRitualRecipeDefinition, RootRitualRecipe> {
19
19
  deserialize(definition: RootRitualRecipeDefinition, context: RecipeParseContext): RootRitualRecipe;
@@ -9,8 +9,8 @@ export class RootRitualRecipe extends ManyToOneRecipe {
9
9
  getIngredients() {
10
10
  return [...super.getIngredients(), ...this.incenses];
11
11
  }
12
- replace(ingredientReplacer, resultReplacer) {
13
- return new RootRitualRecipe(this.incenses.map(ingredientReplacer), resultReplacer(this.result), this.incenses.map(ingredientReplacer));
12
+ replace(modifier) {
13
+ return new RootRitualRecipe(this.incenses.map(modifier.ingredient), modifier.result(this.result), this.incenses.map(modifier.ingredient));
14
14
  }
15
15
  }
16
16
  export class RootRitualRecipeParser extends RecipeParser {
@@ -1 +1 @@
1
- {"version":3,"file":"ritual.js","sourceRoot":"","sources":["../../../../src/parser/recipe/roots/ritual.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,MAAM,aAAa,CAAC;AACvC,OAAO,EACL,eAAe,GAEhB,MAAM,iBAAiB,CAAC;AAUzB,MAAM,OAAO,gBAAiB,SAAQ,eAAe;IAIhC;IAHnB,YACE,WAAyB,EACzB,MAAc,EACG,WAAyB,EAAE;QAE5C,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAFV,aAAQ,GAAR,QAAQ,CAAmB;IAG9C,CAAC;IAEQ,cAAc;QACrB,OAAO,CAAC,GAAG,KAAK,CAAC,cAAc,EAAE,EAAE,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IACvD,CAAC;IAEQ,OAAO,CACd,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,gBAAgB,CACzB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,kBAAkB,CAAC,EACrC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,EAC3B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,kBAAk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AC,CACvC,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,YAG3C;IACC,WAAW,CACT,UAAsC,EACtC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;QAC3E,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,MAAM,QAAQ,GACZ,UAAU,CAAC,QAAQ;YACnB,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACtD,OAAO,IAAI,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7D,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  import type { Ingredient } from "../../../common/ingredient/index.js";
2
2
  import type { RecipeDefinition } from "../../../schema/data/recipe.js";
3
- import type { RecipeParseContext, Replacer } from "../index.js";
3
+ import type { RecipeModifier, RecipeParseContext } from "../index.js";
4
4
  import RecipeParser, { Recipe } from "../index.js";
5
5
  export type ThermalCatalystRecipeDefinition = RecipeDefinition & Readonly<{
6
6
  ingredient: unknown;
@@ -15,7 +15,7 @@ export declare class ThermalCatalystRecipe extends Recipe {
15
15
  constructor(ingredient: Ingredient);
16
16
  getIngredients(): Ingredient[];
17
17
  getResults(): never[];
18
- replace(ingredientReplacer: Replacer<Ingredient>): Recipe;
18
+ replace(modifier: RecipeModifier): ThermalCatalystRecipe;
19
19
  serialize(context: RecipeParseContext): Partial<ThermalCatalystRecipeDefinition>;
20
20
  }
21
21
  export declare class ThermalCatalystRecipeParser extends RecipeParser<ThermalCatalystRecipeDefinition, ThermalCatalystRecipe> {
@@ -11,8 +11,8 @@ export class ThermalCatalystRecipe extends Recipe {
11
11
  getResults() {
12
12
  return [];
13
13
  }
14
- replace(ingredientReplacer) {
15
- return new ThermalCatalystRecipe(ingredientReplacer(this.ingredient));
14
+ replace(modifier) {
15
+ return new ThermalCatalystRecipe(modifier.ingredient(this.ingredient));
16
16
  }
17
17
  serialize(context) {
18
18
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"catalyst.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/catalyst.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAYnD,MAAM,OAAO,qBAAsB,SAAQ,MAAM;IAClB;IAA7B,YAA6B,UAAsB;QACjD,KAAK,EAAE,CAAC;QADmB,eAAU,GAAV,UAAU,CAAY;IAEnD,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,OAAO,CAAC,kBAAwC;QACvD,OAAO,IAAI,qBAAqB,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACxE,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,2BAA4B,SAAQ,YAGhD;IACC,WAAW,CACT,UAA2C,EAC3C,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrE,OAAO,IAAI,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC;CACF"}
1
+ {"version":3,"file":"catalyst.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/catalyst.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAYnD,MAAM,OAAO,qBAAsB,SAAQ,MAAM;IAClB;IAA7B,YAA6B,UAAsB;QACjD,KAAK,EAAE,CAAC;QADmB,eAAU,GAAV,UAAU,CAAY;IAEnD,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,OAAO,CAAC,QAAwB;QACvC,OAAO,IAAI,qBAAqB,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACzE,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,2BAA4B,SAAQ,YAGhD;IACC,WAAW,CACT,UAA2C,EAC3C,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrE,OAAO,IAAI,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
1
  import type { Ingredient } from "../../../common/ingredient/index.js";
2
2
  import type { RecipeDefinition } from "../../../schema/data/recipe.js";
3
- import type { RecipeParseContext, Replacer } from "../index.js";
3
+ import type { RecipeModifier, RecipeParseContext } from "../index.js";
4
4
  import RecipeParser, { Recipe } from "../index.js";
5
5
  export type ThermalFuelRecipeDefinition = RecipeDefinition & Readonly<{
6
6
  energy: number;
@@ -11,7 +11,7 @@ export declare class ThermalFuelRecipe extends Recipe {
11
11
  constructor(ingredient: Ingredient);
12
12
  getIngredients(): Ingredient[];
13
13
  getResults(): never[];
14
- replace(ingredientReplacer: Replacer<Ingredient>): Recipe;
14
+ replace(modifier: RecipeModifier): ThermalFuelRecipe;
15
15
  serialize(context: RecipeParseContext): Partial<ThermalFuelRecipeDefinition>;
16
16
  }
17
17
  export declare class ThermalFuelRecipeParser extends RecipeParser<ThermalFuelRecipeDefinition, ThermalFuelRecipe> {
@@ -12,8 +12,8 @@ export class ThermalFuelRecipe extends Recipe {
12
12
  getResults() {
13
13
  return [];
14
14
  }
15
- replace(ingredientReplacer) {
16
- return new ThermalFuelRecipe(ingredientReplacer(this.ingredient));
15
+ replace(modifier) {
16
+ return new ThermalFuelRecipe(modifier.ingredient(this.ingredient));
17
17
  }
18
18
  serialize(context) {
19
19
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"fuel.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/fuel.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQnD,iCAAiC;AACjC,MAAM,OAAO,iBAAkB,SAAQ,MAAM;IACd;IAA7B,YAA6B,UAAsB;QACjD,KAAK,EAAE,CAAC;QADmB,eAAU,GAAV,UAAU,CAAY;IAEnD,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,OAAO,CAAC,kBAAwC;QACvD,OAAO,IAAI,iBAAiB,CAAC,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACpE,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,uBAAwB,SAAQ,YAG5C;IACC,WAAW,CACT,UAAuC,EACvC,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrE,OAAO,IAAI,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC3C,CAAC;CACF"}
1
+ {"version":3,"file":"fuel.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/fuel.ts"],"names":[],"mappings":"AAGA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAQnD,iCAAiC;AACjC,MAAM,OAAO,iBAAkB,SAAQ,MAAM;IACd;IAA7B,YAA6B,UAAsB;QACjD,KAAK,EAAE,CAAC;QADmB,eAAU,GAAV,UAAU,CAAY;IAEnD,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,EAAE,CAAC;IACZ,CAAC;IAEQ,OAAO,CAAC,QAAwB;QACvC,OAAO,IAAI,iBAAiB,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IACrE,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;SAC3D,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,uBAAwB,SAAQ,YAG5C;IACC,WAAW,CACT,UAAuC,EACvC,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrE,OAAO,IAAI,iBAAiB,CAAC,UAAU,CAAC,CAAC;IAC3C,CAAC;CACF"}
@@ -1,7 +1,7 @@
1
1
  import type { Ingredient } from "../../../common/ingredient/index.js";
2
2
  import type { Result } from "../../../common/result/index.js";
3
3
  import type { RecipeDefinition } from "../../../schema/data/recipe.js";
4
- import type { RecipeParseContext, Replacer } from "../index.js";
4
+ import type { RecipeModifier, RecipeParseContext } from "../index.js";
5
5
  import RecipeParser, { Recipe } from "../index.js";
6
6
  export type ThermalRecipeDefinition = RecipeDefinition & Readonly<{
7
7
  ingredient?: unknown;
@@ -16,7 +16,7 @@ export declare class ThermalRecipe extends Recipe {
16
16
  constructor(ingredients: Ingredient[], results: Result[]);
17
17
  getIngredients(): Ingredient[];
18
18
  getResults(): Result[];
19
- replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): Recipe;
19
+ replace(modifier: RecipeModifier): ThermalRecipe;
20
20
  serialize(context: RecipeParseContext): Partial<ThermalRecipeDefinition>;
21
21
  }
22
22
  export declare class ThermalRecipeParser extends RecipeParser<ThermalRecipeDefinition, ThermalRecipe> {
@@ -14,8 +14,8 @@ export class ThermalRecipe extends Recipe {
14
14
  getResults() {
15
15
  return this.results;
16
16
  }
17
- replace(ingredientReplacer, resultReplacer) {
18
- return new ThermalRecipe(this.ingredients.map(ingredientReplacer), this.results.map(resultReplacer));
17
+ replace(modifier) {
18
+ return new ThermalRecipe(this.ingredients.map(modifier.ingredient), this.results.map(modifier.result));
19
19
  }
20
20
  serialize(context) {
21
21
  const serialized = {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAWnD,MAAM,OAAO,aAAc,SAAQ,MAAM;IAEpB;IACA;IAFnB,YACmB,WAAyB,EACzB,OAAiB;QAElC,KAAK,EAAE,CAAC;QAHS,gBAAW,GAAX,WAAW,CAAc;QACzB,YAAO,GAAP,OAAO,CAAU;IAGpC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAED,UAAU;QACR,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAED,OAAO,CACL,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,aAAa,CACtB,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,kBAAkB,CAAC,EACxC,IAAI,CAAC,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QACJ,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,YAGxC;IACC,WAAW,CACT,UAAmC,EACnC,OAA2B;QAE3B,sCAAsC;QAEtC,MAAM,WAAW,GAAG,UAAU,CAAC,UAAU;YACvC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;YACrD,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC;QAEjE,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;YAC1B,MAAM,IAAI,iBAAiB,CAAC,8BAA8B,EAAE,UAAU,CAAC,CAAC;QAE1E,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC;YAC9C,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC;YAC/C,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC;QAEhD,OAAO,IAAI,aAAa,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACjD,CAAC;CACF"}
@@ -2,7 +2,7 @@ import type { BlockId } from "@adeficior/data-modifier/generated";
2
2
  import { type Ingredient } from "../../../common/ingredient/index.js";
3
3
  import type { Result } from "../../../common/result/index.js";
4
4
  import type { RecipeDefinition } from "../../../schema/data/recipe.js";
5
- import RecipeParser, { Recipe, type RecipeParseContext, type Replacer } from "../index.js";
5
+ import RecipeParser, { Recipe, type RecipeModifier, type RecipeParseContext } from "../index.js";
6
6
  export type TreeExtractionRecipeDefinition = RecipeDefinition & Readonly<{
7
7
  leaves: BlockId;
8
8
  trunk: BlockId;
@@ -15,7 +15,7 @@ export declare class TreeExtractionRecipe extends Recipe {
15
15
  constructor(trunk: Ingredient, leaves: Ingredient, result: Result);
16
16
  getIngredients(): Ingredient[];
17
17
  getResults(): Result[];
18
- replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): TreeExtractionRecipe;
18
+ replace(modifier: RecipeModifier): TreeExtractionRecipe;
19
19
  private serializeBlockIngredient;
20
20
  serialize(context: RecipeParseContext): Partial<TreeExtractionRecipeDefinition>;
21
21
  }
@@ -18,8 +18,8 @@ export class TreeExtractionRecipe extends Recipe {
18
18
  getResults() {
19
19
  return [this.result];
20
20
  }
21
- replace(ingredientReplacer, resultReplacer) {
22
- return new TreeExtractionRecipe(ingredientReplacer(this.trunk), ingredientReplacer(this.leaves), resultReplacer(this.result));
21
+ replace(modifier) {
22
+ return new TreeExtractionRecipe(modifier.ingredient(this.trunk), modifier.ingredient(this.leaves), modifier.result(this.result));
23
23
  }
24
24
  serializeBlockIngredient(ingredient) {
25
25
  if (ingredient instanceof BlockIngredient) {
@@ -1 +1 @@
1
- {"version":3,"file":"treeExtraction.js","sourceRoot":"","sources":["../../../../src/parser/recipe/thermal/treeExtraction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,eAAe,GAEhB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,YAAY,EAAE,EACnB,MAAM,GAGP,MAAM,aAAa,CAAC;AASrB,MAAM,OAAO,oBAAqB,SAAQ,MAAM;IAE3B;IACA;IACA;IAHnB,YACmB,KAAiB,EACjB,MAAkB,EAClB,MAAc;QAE/B,KAAK,EAAE,CAAC;QAJS,UAAK,GAAL,KAAK,CAAY;QACjB,WAAM,GAAN,MAAM,CAAY;QAClB,WAAM,GAAN,MAAM,CAAQ;IAGjC,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAED,UA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;QAE3B,OAAO;YACL,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9C,KAAK,EAAE,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,KAAK,CAAC;YAChD,MAAM,EAAE,IAAI,CAAC,wBAAwB,CAAC,IAAI,CAAC,MAAM,CAAC;SACnD,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,0BAA2B,SAAQ,YAG/C;IACC,WAAW,CACT,UAA0C,EAC1C,OAA2B;QAE3B,MAAM,KAAK,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CACtC,IAAI,eAAe,CAAC,UAAU,CAAC,KAAK,CAAC,CACtC,CAAC;QACF,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CACvC,IAAI,eAAe,CAAC,UAAU,CAAC,MAAM,CAAC,CACvC,CAAC;QACF,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC;CACF"}
@@ -1,7 +1,6 @@
1
- import type { Ingredient } from "../../../common/ingredient/index.js";
2
1
  import type { Result } from "../../../common/result/index.js";
3
2
  import type { RecipeDefinition } from "../../../schema/data/recipe.js";
4
- import type { RecipeParseContext, Replacer } from "../index.js";
3
+ import type { RecipeModifier, RecipeParseContext } from "../index.js";
5
4
  import RecipeParser, { Recipe } from "../index.js";
6
5
  import type { IngredientMap, IngredientMapInput } from "../ingredientMap.js";
7
6
  export type ShapedRecipeDefinition = RecipeDefinition & Readonly<{
@@ -13,9 +12,9 @@ export declare class ShapedRecipe extends Recipe {
13
12
  private readonly ingredients;
14
13
  private readonly result;
15
14
  constructor(ingredients: IngredientMap, result: Result);
16
- getIngredients(): Ingredient[];
15
+ getIngredients(): import("../../../common/ingredient/index.js").Ingredient[];
17
16
  getResults(): Result[];
18
- replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): ShapedRecipe;
17
+ replace(modifier: RecipeModifier): ShapedRecipe;
19
18
  serialize(context: RecipeParseContext): Partial<ShapedRecipeDefinition>;
20
19
  }
21
20
  export declare class ShapedParser extends RecipeParser<ShapedRecipeDefinition, ShapedRecipe> {
@@ -13,8 +13,8 @@ export class ShapedRecipe extends Recipe {
13
13
  getResults() {
14
14
  return [this.result];
15
15
  }
16
- replace(ingredientReplacer, resultReplacer) {
17
- return new ShapedRecipe(this.ingredients.replace(ingredientReplacer), resultReplacer(this.result));
16
+ replace(modifier) {
17
+ return new ShapedRecipe(this.ingredients.replace(modifier.ingredient), modifier.result(this.result));
18
18
  }
19
19
  serialize(context) {
20
20
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"shaped.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/shaped.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAUnD,MAAM,OAAO,YAAa,SAAQ,MAAM;IAEnB;IACA;IAFnB,YACmB,WAA0B,EAC1B,MAAc;QAE/B,KAAK,EAAE,CAAC;QAHS,gBAAW,GAAX,WAAW,CAAe;QAC1B,WAAM,GAAN,MAAM,CAAQ;IAGjC,CAAC;IAED,cAAc;QACZ,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IACjC,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,CACL,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,YAAY,CACrB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAC5C,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAC5B,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,GAAG,EAAE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,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC;YACxC,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;SAC/C,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,YAAa,SAAQ,YAGjC;IACC,WAAW,CACT,UAAkC,EAClC,OAA2B;QAE3B,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACtE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC/C,CAAC;CACF"}
@@ -1,7 +1,7 @@
1
1
  import type { Ingredient } from "../../../common/ingredient/index.js";
2
2
  import type { Result } from "../../../common/result/index.js";
3
3
  import type { RecipeDefinition } from "../../../schema/data/recipe.js";
4
- import type { RecipeParseContext, Replacer } from "../index.js";
4
+ import type { RecipeModifier, RecipeParseContext } from "../index.js";
5
5
  import RecipeParser, { Recipe } from "../index.js";
6
6
  export type SmeltingRecipeDefinition = RecipeDefinition & Readonly<{
7
7
  ingredient: unknown;
@@ -14,7 +14,7 @@ export declare class SmeltingRecipe extends Recipe {
14
14
  constructor(ingredient: Ingredient, result: Result);
15
15
  getIngredients(): Ingredient[];
16
16
  getResults(): Result[];
17
- replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): SmeltingRecipe;
17
+ replace(modifier: RecipeModifier): SmeltingRecipe;
18
18
  serialize(context: RecipeParseContext): Partial<SmeltingRecipeDefinition>;
19
19
  }
20
20
  export declare class SmeltingParser extends RecipeParser<SmeltingRecipeDefinition, SmeltingRecipe> {
@@ -13,8 +13,8 @@ export class SmeltingRecipe extends Recipe {
13
13
  getResults() {
14
14
  return [this.result];
15
15
  }
16
- replace(ingredientReplacer, resultReplacer) {
17
- return new SmeltingRecipe(ingredientReplacer(this.ingredient), resultReplacer(this.result));
16
+ replace(modifier) {
17
+ return new SmeltingRecipe(modifier.ingredient(this.ingredient), modifier.result(this.result));
18
18
  }
19
19
  serialize(context) {
20
20
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"smelting.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/smelting.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASnD,MAAM,OAAO,cAAe,SAAQ,MAAM;IAErB;IACA;IAFnB,YACmB,UAAsB,EACtB,MAAc;QAE/B,KAAK,EAAE,CAAC;QAHS,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAQ;IAGjC,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAEQ,OAAO,CACd,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,cAAc,CACvB,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,EACnC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAC5B,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;YAC1D,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;SAC/C,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,cAAe,SAAQ,YAGnC;IACC,WAAW,CACT,UAAoC,EACpC,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACrE,MAAM,MAAM,GAAG,OAAO,CAAC,O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AAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,cAAc,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAChD,CAAC;CACF"}
@@ -1,7 +1,7 @@
1
1
  import type { Ingredient } from "../../../common/ingredient/index.js";
2
2
  import type { Result } from "../../../common/result/index.js";
3
3
  import type { RecipeDefinition } from "../../../schema/data/recipe.js";
4
- import type { RecipeParseContext, Replacer } from "../index.js";
4
+ import type { RecipeModifier, RecipeParseContext } from "../index.js";
5
5
  import RecipeParser, { Recipe } from "../index.js";
6
6
  export type SmithingRecipeDefinition = RecipeDefinition & Readonly<{
7
7
  base: unknown;
@@ -15,7 +15,7 @@ export declare class SmithingRecipe extends Recipe {
15
15
  constructor(base: Ingredient, addition: Ingredient, result: Result);
16
16
  getIngredients(): Ingredient[];
17
17
  getResults(): Result[];
18
- replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): SmithingRecipe;
18
+ replace(modifier: RecipeModifier): SmithingRecipe;
19
19
  serialize(context: RecipeParseContext): Partial<SmithingRecipeDefinition>;
20
20
  }
21
21
  export declare class SmithingParser extends RecipeParser<SmithingRecipeDefinition, SmithingRecipe> {
@@ -15,8 +15,8 @@ export class SmithingRecipe extends Recipe {
15
15
  getResults() {
16
16
  return [this.result];
17
17
  }
18
- replace(ingredientReplacer, resultReplacer) {
19
- return new SmithingRecipe(ingredientReplacer(this.base), ingredientReplacer(this.addition), resultReplacer(this.result));
18
+ replace(modifier) {
19
+ return new SmithingRecipe(modifier.ingredient(this.base), modifier.ingredient(this.addition), modifier.result(this.result));
20
20
  }
21
21
  serialize(context) {
22
22
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"smithing.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/smithing.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASnD,MAAM,OAAO,cAAe,SAAQ,MAAM;IAErB;IACA;IACA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UAAoC,EACpC,OAA2B;QAE3B,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACzD,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACjE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QACzD,OAAO,IAAI,cAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;CACF"}
@@ -1,7 +1,7 @@
1
1
  import type { Ingredient } from "../../../common/ingredient/index.js";
2
2
  import type { Result } from "../../../common/result/index.js";
3
3
  import type { RecipeDefinition } from "../../../schema/data/recipe.js";
4
- import type { RecipeParseContext, Replacer } from "../index.js";
4
+ import type { RecipeModifier, RecipeParseContext } from "../index.js";
5
5
  import RecipeParser, { Recipe } from "../index.js";
6
6
  export type StonecuttingRecipeDefinition = RecipeDefinition & Readonly<{
7
7
  ingredient: unknown;
@@ -14,7 +14,7 @@ export declare class StonecuttingRecipe extends Recipe {
14
14
  constructor(ingredient: Ingredient, result: Result);
15
15
  getIngredients(): Ingredient[];
16
16
  getResults(): Result[];
17
- replace(ingredientReplacer: Replacer<Ingredient>, resultReplacer: Replacer<Result>): StonecuttingRecipe;
17
+ replace(modifier: RecipeModifier): StonecuttingRecipe;
18
18
  serialize(context: RecipeParseContext): Partial<StonecuttingRecipeDefinition>;
19
19
  }
20
20
  export declare class StonecuttingParser extends RecipeParser<StonecuttingRecipeDefinition, StonecuttingRecipe> {
@@ -14,13 +14,13 @@ export class StonecuttingRecipe extends Recipe {
14
14
  getResults() {
15
15
  return [this.result];
16
16
  }
17
- replace(ingredientReplacer, resultReplacer) {
18
- return new StonecuttingRecipe(ingredientReplacer(this.ingredient), resultReplacer(this.result));
17
+ replace(modifier) {
18
+ return new StonecuttingRecipe(modifier.ingredient(this.ingredient), modifier.result(this.result));
19
19
  }
20
20
  serialize(context) {
21
21
  return {
22
22
  ingredient: context.ingredients.serialize(this.ingredient),
23
- result: context.ingredients.serialize(this.result),
23
+ result: context.results.serialize(this.result),
24
24
  };
25
25
  }
26
26
  }
@@ -1 +1 @@
1
- {"version":3,"file":"stonecutting.js","sourceRoot":"","sources":["../../../../src/parser/recipe/vanilla/stonecutting.ts"],"names":[],"mappings":"AAIA,OAAO,YAAY,EAAE,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AASnD,qCAAqC;AACrC,MAAM,OAAO,kBAAmB,SAAQ,MAAM;IAEzB;IACA;IAFnB,YACmB,UAAsB,EACtB,MAAc;QAE/B,KAAK,EAAE,CAAC;QAHS,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAQ;IAGjC,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC3B,CAAC;IAED,UAAU;QACR,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAEQ,OAAO,CACd,kBAAwC,EACxC,cAAgC;QAEhC,OAAO,IAAI,kBAAkB,CAC3B,kBAAkB,CAAC,IAAI,CAAC,UAAU,CAAC,EACnC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAC5B,CAAC;IACJ,CAAC;IAEQ,SAAS,CAChB,OAA2B;QAE3B,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;YAC1D,MAAM,EAAE,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;SACnD,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,YAGvC;IACC,WAAW,CACT,UAAwC,EACxC,OAA2B;QAE3B,MAAM,UAAU,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,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